Commit Graph
8 Commits
Author SHA1 Message Date
Ivan Starkov db97945c69 build: Remove ORI permission system (#3624)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-29 08:04:20 +03:00
Bogdan Chadkin cb5e43580b refactor: replace uuid with crypto.randomUUID() (#3218)
crypto.randomUUID() is globally available in node and browser
environments. Uuid package is no longer necessary for our cases.
2024-04-21 15:38:39 +07:00
Ivan Starkov b85cfa7950 fix: Switch on single router (#3006)
## Description

Preparation on using std trpc protocol for everything

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-03-13 16:54:31 +03:00
Ivan Starkov d1469f9e1d feat: Add ability to disable clone and copy for view links (#2983)
## Description


### HAS MIGRATION, CAN'T BE TESTED ONLINE


Pro users can add additional permissions to auth tokens
<img width="358" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/df294ac3-e98c-465d-8115-f74ff075ff2d">

In case of cloning is disabled user will see

<img width="448" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/c77e5598-ba0a-4a40-82fc-3aab7c1d107f">

In case of copying

<img width="506" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/a92ec66f-0b7a-4666-aa20-911de51c9d28">





## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-03-11 08:52:37 +03:00
Ivan Starkov f3f7f88df3 Add admin (publish) permissions to tokens (#2221)
## Description

Add admin permissions to shared links

<img width="328" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/972a46b9-154b-4426-9d8c-ab62ebf9a9e3">

<img width="283" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/d187da84-4d49-4308-b6ea-f09cb7a09e8c">


Share links for now disabled for admin role. Will do in the next
iteration after releasing above.


## Steps for reproduction

Create admin token link.
Open in incognito, see Publish is working.

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-09-04 12:10:29 +03:00
Ivan Starkov 86dc7e74aa Fix unexpected error issue on project loading (#1612)
## Description

This is fast fix, in the future we would need to review all out errors
Intead of this 
<img width="415" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/78e214ca-2780-4449-b0a7-9854456c4eef">

We are now trying to login user first, and then show this 
<img width="386" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/0744ed68-eedd-47f7-a6c0-ccf049bd47e4">

Also instead of Unexpected Error showing real error.


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 15:53:15 +04:00
Bogdan Chadkin e1fa2075a5 Enforce server constraints for packages (#1507)
Ref
https://remix.run/docs/en/1.15.0/guides/constraints#server-code-pruning

Remix use NAME.server.ts extension to enforce omitting module from
client bundles. Though we heavily used `/server` in packages which had
no affect and blocked us in using a few node apis which were not
polifilled with empty modules while bundling for client.

Here I replaced `/server` with `/index.server` and removed all legacy
server entry points which are not longer necessary with new typescript
resolution.
2023-04-22 09:14:14 +07:00
Ivan Starkov 8e5d0a2186 Shared tokens UI + Api (#894)
## Description

ref #548

Add shared links with builder/viewer permissions.

`editor` permission is now disabled as we don't know a simple way to
allow editing images and text only cc @TrySound would need your opinion
on this.

createTrpcRemixProxy now wraps input in `JSON.stringify` and unwraps
before the TRPC call. Otherwise, all params are FormData string entries
and may cause errors.

createTrpcRemixProxy useQuery/useMutation now returns Remix useFetcher
state parameter.


**`patch` auth call added, we must do any Auth mutate operations in a
single call, otherwise if some call failed we are in troubles.**
Example on token relation update.
Remove viewer relation.
Add editor relation. <- If the call failed here user just loses all
permissions.
In case of patch both operations are completed in a single transaction -
(delete+insert)





## Steps for reproduction

Having migrations works locally only with 
`isFeatureEnabled("share2")` flag.

Click the share button then add/rename/update/copy share links.

The previous Share button is removed.

**TODO In Next PR:**

Different UI for builder and viewer links i.e.
[this](https://github.com/webstudio-is/webstudio-designer/issues/548#issuecomment-1406947059).

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-01 10:51:20 +03:00