Commit Graph

30 Commits

Author SHA1 Message Date
Chuck Driesler 9bafc388aa fix(workspaces): prohibit workspace guests from being project owners (#3244)
* fix(workspaces): prohibit workspace guests from being project owners

* Small FE fix

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-10-14 10:02:17 +01:00
Alessandro Magionami 2a06c7cdac fix(workspaces): do not update project every time a new user is added to workspace (#3087) 2024-09-24 11:16:51 +02:00
Gergő Jedlicska 00c01db923 feat(workspaces): add workspace slug support (#2982)
* feat(workspaces): add workspace slug support

* chore(workspaces): lint

* feat(workspaces): add slug validation and generation

* fix(workspaces): test lint miss
2024-09-18 13:29:36 +02:00
Chuck Driesler 56d392424d feat(workspaces): move project to workspace (#2992)
* feat(workspaces): move project, like this

* fix(workspaces): use new event

* fix(workspaces): add resolver again after merge

* chore(workspaces): lint

* fix(workspaces): works but is a bit illegal

* fix(workspaces): use service update

* chore(workspaces): add unit tests

* fix(workspaces): use transaction

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-09-18 10:38:27 +02:00
Chuck Driesler ac6dd70d27 feat(workspaces): default workspace project role (#3013)
* feat(workspaces): enable default project role in workspace

* fix(workspaces): not satisfying

* chore(workspaces): phrasing

* fix(workspaces): use new field in role mapping

* chore(workspaces): use roles

* fix(workspaces): update tests

* fix(workspaces): more parallel role update errors

* chore(workspaces): like this now

* chore(workspaces): revert changes to deps

* fix(workspaces): assert domain type conversion at gql layer

* fix(workspaces): repair tests

* fix(workspaces): fix more tests
2024-09-17 22:17:10 +02:00
Chuck Driesler b5c9e62bcb chore(workspaces): perform workspace project role update via events (#2980)
* chore(workspaces): perform workspace project role update via events

* chore(workspaces): commented

* fix(workspaces): transactions in events

* fix(workspaces): transaction limits
2024-09-13 10:30:06 +02:00
Gergő Jedlicska c3b05abd6f fix(workspaces): assign role on workspace join (#2864) 2024-09-03 18:54:06 +02:00
Gergő Jedlicska fd814286ac gergo/web 1779 prevent enabling domain protection if workspace has no (#2848)
* feat(workspaces): do not allow discoverablity if no verified domains

* feat(workspaces): do not allow domainBasedMembershipProtection if no verified domains

* test(workspaces): fix tests

* test(workspaces): fix invites test
2024-09-02 16:40:43 +02:00
Gergő Jedlicska 0b0853bb3c feat(workspaces): do not allow discoverablity if no verified domains (#2847)
* feat(workspaces): do not allow discoverablity if no verified domains

* test(workspaces): fix tests
2024-09-02 15:47:57 +02:00
Chuck Driesler 8ec0d364cb Chuck/web 1614 unify workspaceproject role creation (#2795)
* fix(workspaces): transact all simultaneous workspace-project role changes

* fix(workspaces): more correct usage of transactions

* fix(workspaces): add tests for transaction-based role changes

* fix(workspaces): do not leak knex into domain

* fix(workspaces): transaction-ify factory functions

* fix(workspaces): factory-ify some old functions

* fix(workspaces): missed a resolver

* chore(workspaces): get tests in order

* park it

* chore(workspaces): failing tests

* WHAT DO YOU WANT

* fix(workspaces): i lived bitch

* fix(workspaces): remove test that is no longer true

* fix(workspaces): better repo/service boundaries

* right

* fix(workspaces): service in injected

* fix(workspaces): repair references

* refactor(workspaces): role management rework

* chore(workspaces): adjust tests to match new behaviour

* lint lint lint

* fix(workspaces): fix tests

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-08-30 09:56:56 +02:00
Chuck Driesler bbd5146e5a fix(workspaces): add pagination to workspace team members (#2644)
* fix(workspaces): a suggestion of paginated teams

* fix(workspaces): workspace team pagination (?)

* fix(workspaces): pagination based on acl createdAt

* fix(workspaces): fix some roles-related tests

* fix(workspaces): improve query and tests

* fix(workspaces): collaborators query without incorrect groupBy

* fix(workspaces): add default values to migration

* Fixed queries and fragments

* Merged main

* Remove comment

* chore(workspaces): update WorkspaceCollaboratorCollection mocks

* chore(workspaces): fix role test

* chore(workspaces); ope

* fix(workspaces): move workspace acl timestamps to separate table

* Merge?

* fix(workspaces) drop that table

* fix(workspaces): cursor

* fix(workspaceInvites): undo merge borkage

* fix(workspaces): rework workspace member pagination

* fix(workspaces): fix test

* fix(workspaces): test test

* fix(workspaces): literally garbage

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-08-29 21:17:37 +02:00
Alessandro Magionami a0224e2f40 Alessandro/web 1660 workspace cost items subtotal and currency (#2793)
* chore(workspaces): workspace cost schema

* chore(workspaces): test helper for workspace cost

* feat(workspaces): workspace billing cost

* fix(workspaces): fix onProjectCreated failing for the project creator if the creator is a member

* refactor(workspaces): change workspace cost calculation to a simpler query

* test(workspaceCost): fix costing logic and tests

* fix(workspaceTests): project emmiter needs owner now

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-08-29 13:45:04 +02:00
Gergő Jedlicska 32919c89da gergo/web 1746 add resolver for workspace domain policy compliance per user (#2797)
* fix(users): verified should be a public limited user field

* feat(workspaceSecurity): update security tab copy

* feat(workspaces): add limited user domain policy compliance check
2024-08-29 11:11:08 +02:00
Gergő Jedlicska 08e941f8af Poor man's SSO (#2641)
* Implemented workspace general page

* Added notifications to user input

* Allowed non-admins to view but not edit

* Added redirect to homeroute

* Fixed validation

* Squashed commit of the following:

commit 7bf14ab8af0f76b4c9d0aa87fc08085af7c34959
Author: Chuck Driesler <chuck@speckle.systems>
Date:   Tue Aug 6 19:40:50 2024 +0200

    mob next [ci-skip] [ci skip] [skip ci]

    lastFile:packages/server/modules/workspacesCore/migrations/20240806160740_workspace_domains.ts

commit 8aa3fb0cb052c10eeeb83bf9874ae0d1c065e480
Author: Alessandro Magionami <alessandro.magionami@gmail.com>
Date:   Tue Aug 6 18:54:15 2024 +0200

    mob next [ci-skip] [ci skip] [skip ci]

    lastFile:packages/server/modules/core/domain/userEmails/operations.ts

commit 66dfd0cf6c15a789c8f96a65a3168323e83a7b9e
Author: Chuck Driesler <chuck@speckle.systems>
Date:   Tue Aug 6 18:30:22 2024 +0200

    mob next [ci-skip] [ci skip] [skip ci]

    lastFile:packages/server/modules/workspacesCore/domain/types.ts

Co-authored-by: Alessandro Magionami <alessandro.magionami@gmail.com>

* Move General to workspaces folder

* feat(workspaces): inputs on security section

* feat(workspaces): add domain to workspace mutation

* chore(workspaces): add blocked domains list

* fix(workspaces): modals with buttons

* feat(workspaceDomains): delete domain

* fix(workspaces): use  mutation

* fix(workspaces): present user verified domains as options

* Moved sidebar menu to a composable

* Added coming soon tag back

* feat(workspaces): create domains resolver for workspace

* chore(workspaces): fix tests

* chore(workspaces): fix types

* chore(workspaces): fix linter

* fix(workspaces): do some delete I think

* chore(workspaces): add domainBasedMembershipProtectionEnabled field to workspace

* chore(workspaces): improve validation for email domain

* fix(workspace): query and do the thing

* chore(workspaces): add graphql schema for domainBasedMembershipProtection

* chore(workspaces): lint and test failures

* fix(workspaces): test issues w new field

* feat(workspaces): add discoverability flag

* chore(workspaces): they made me do it

* feat(workspaces): enable toggling domain protection

* feat(workspaces): add discoverability toggle to workspace settings

* feat(workspace): auto enable discoverability on first domain registration

* feat(workspace): discoverability toggle fixes

* fix(eventBus): fix tests

* feat(workspaces): user discoverable workspaces (#2620)

* feat(workspaces): it works just trust me

* fix(workspaces): don't worry about it

* fix(workspaces); happy path success

* fix(workspaces): almost there

* fix(workspaces): successful tests!

* fix(workspaces): we have DISCOVERED (#2621)

* Fixed linting issue

* Updated query

* Updated validation rules

* Updated validation rules

* Fix unsaved file with type export

* Addressed PR comments

* Updated cache

* Updated item classes, add fragment back

* Gergo/web 1574 join workspaces via discovery (#2623)

* chore(useremails): add find verified emails by user function

* chore(workspace): table helper for workspace domains

* chore(workspace): get workspace with domains function

* chore(workspace): test get workspace with domains function

* feat(workspace): restrict workspace membership when updating workspace role

* chore(workspaces): fix types

* feat(workspaces): WIP join

* feat(workspaces): join button makes u join

* chore(useremails): fix type for find verified emails function

* feat(workspaces): join

* feat(workspace): prevent inviting user without email matching domain

* chore(workspaces): fix linter

* fix(workspaces): invoke join (gergo wrote this)

* fuck

* fix(workspaces): properly get discoverable workspaces

* fix(workspaces): test

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Chuck Driesler <chuck@speckle.systems>

* fix(workspaces): some query stuff

* fix(workspaces): mutate cache instead of refetch

* fix(workspaces): more adjustments to gql query and fragment structure

* fix(workspaces): queries, style, structure

* fix(workspaces): match discoverability with current styles

* chore(workspaces): lint lint lint

* fix(workspaces): got it twisted

* chore(workspaces): fix test

* fix(workspaces): route to joined workspace on join

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
Co-authored-by: Chuck Driesler <chuck@speckle.systems>
Co-authored-by: Alessandro Magionami <alessandro.magionami@gmail.com>
2024-08-26 13:33:16 +02:00
Chuck Driesler 63735eb044 feat(workspaces): work(space) invader default logos (#2708)
* feat(workspaces): add default logo index

* Added WorkspaceAvatar component

* Added WorkspaceAvatar component

* Fix issues

* Fix Avatar

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-08-21 13:53:37 +01:00
Chuck Driesler 09c29619b4 fix(workspaces): guests do not get workspace-wide project access (#2622)
* fix(workspaces): guests do not get workspace-wide project access

* fix(workspaces): update roles-related test

* fix(workspaces): roles only update on member add
2024-08-14 09:54:47 +01:00
Kristaps Fabians Geikins 4dae1569cd feat(fe2): invite + list workspace invites (#2629)
* list invites table

* invites list works

* update last reminded date on resend

* fix FE

* WIP invitedialog + updated debounced utility

* invite create works

* exclude users correctly

* more adjustments

* minor cleanup

* using workspace invite server role

* test fix

* fixed multiple root eslint issues

* minor adjustments
2024-08-12 11:30:01 +03:00
Chuck Driesler b27640194a feat(workspaces): support workspace deletion (#2569)
* feat(workspaces): delete workspace repo function

* feat(workspaces): services for the resolver, crack order of operations, migration

* fix(workspaces): add tests for delete

* fix(workspaces): better service boundary

* fix(workspaces): linttttt
2024-08-07 10:36:52 +02:00
Chuck Driesler c97ccb48a1 fix(workspaces): support workspace logos as base64 strings (#2556)
* fix(workspaces): support workspace logos as base64 strings

* fix(workspaces): fix those testsss

* fix(workspaces): migration! and more test fixes
2024-08-02 13:04:20 +02:00
Chuck Driesler 8a9659f223 feat(workspaces): workspace member role resolvers (#2540)
* feat(workspaces): update/delete workspace role resolvers

* chore(workspaces): gql tests for role changes

* fix(workspaces): test syntax oops

* fix(workspaces): got it twisted

* fix(workspaces): simplify api surface, better return types

* fix(workspaces): correct role type usage, improve tests

* fix(workspaces): authorize in resolver

* fix(workspaces): correct usage of authorizeResolver
2024-08-01 09:36:52 +01:00
Kristaps Fabians Geikins ede566eed9 feat(server): serverInvites refactor + workspace invites CRUD & GQL API (#2530)
* prep for new resources algo

* typescriptifying stuff

* minor types fix

* migrate to resources col

* repo & creation updated, WIP processing/retrieval

* WIP invite processing

* finished finalization refactor

* project invite management

* transformed all invites services

* fixed up projects & core serverinvites resolvers

* test fixes

* WIP workspace create GQL & test

* basic invite creation test works

* a buncha working tests

* more tests

* cancelation tests

* minor invite use refactor

* invite retrieval tasks

* invite use() works as expected

* filtering out broken invites

* enabled invite retrieval by token irregardless of who is it for

* minor adjustments

* tests fix

* test config improvements

* test env adjustment

* extra test case

* making resource access limits harder to ignore

* linter fixes

* eventBus type cleanup

* better generic names

* refactored serverinvites resource migration

* fix(server): better error message in project invite edge case
2024-07-29 14:37:54 +03:00
Chuck Driesler 6eaf3c8c92 feat(workspaces): cru(d) resolvers (#2521)
* feat(workspaces): drop createdByUserId from the dataschema

* feat(workspaces): repositories WIP

* merge

* protect against removing last admin in workspace

* quick impl and stub tests

* add tests

* services

* unit tests for role services

* feat(workspaces): authorize project creation if workspace specified

* feat(workspaces): emit project created event

* feat(workspaces): assign roles on project create in workspace

* feat(workspaces): update project roles when user added to workspace

* feat(workspaces): stencil gql resolvers

* fix(workspaces): lol lmao

* fix(workspaces): perform automatic project role update in service function

* fix(workspaces): also delete roles

* fix(workspaces): broke tests again oops

* fix(workspaces): update `onProjectCreated` listener to use new repo method

* fix(workspaces): use service function in event listener

* fix(workspaces): get workspace projects via existing stream repo functions

* fix(workspaces): roles mapping in domain, use enum

* feat(workspaces): stencil gql api and resolvers

* fix(workspaces): repair type reference in tests

* fix(workspaces): consolidate files, use different existing stream-getter

* fix(workspaces): more specific error

* fix(workspaces): roles and scopes

* fix(workspaces): yield per page

* fix(workspaces): some test dry

* fix(workspaces): superdry

* fix(workspaces): add scopes

* fix(workspaces): classic

* feat(workspaces): create workspace mutation

* feat(workspaces): I'm sure everything will be fine

* fix(workspaces): yep

* fix(workspaces): successful gql e2e test

* feat(workspaces): update workspace resolver

* chore(workspaces): update resolver test

* feat(workspaces): some retrieval resolvers

* chore(workspaces): tests for query resolvers

* fix(chore): revert temp test command change

* fix(workspaces): test structure and gql types

* fix(workspaces): validate user authz to perform some operations

* fix(workspaces): use existing test infrastructure

* fix(workspaces): stop `isPublic` check if authorizing a workspace resource

* fix(workspaces): better test hygiene

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-07-25 12:58:28 +01:00
Chuck Driesler 66eb539aa0 feat(workspaces): assign project roles for workspace projects (#2499)
* feat(workspaces): drop createdByUserId from the dataschema

* feat(workspaces): repositories WIP

* merge

* protect against removing last admin in workspace

* quick impl and stub tests

* add tests

* services

* unit tests for role services

* feat(workspaces): authorize project creation if workspace specified

* feat(workspaces): emit project created event

* feat(workspaces): assign roles on project create in workspace

* feat(workspaces): update project roles when user added to workspace

* fix(workspaces): perform automatic project role update in service function

* fix(workspaces): also delete roles

* fix(workspaces): broke tests again oops

* fix(workspaces): update `onProjectCreated` listener to use new repo method

* fix(workspaces): use service function in event listener

* fix(workspaces): get workspace projects via existing stream repo functions

* fix(workspaces): roles mapping in domain, use enum

* fix(workspaces): repair type reference in tests

* fix(workspaces): consolidate files, use different existing stream-getter

* fix(workspaces): more specific error

* fix(workspaces): yield per page

* fix(workspaces): some test dry

* fix(workspaces): superdry

* fix(workspaces): classic

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-07-20 00:03:27 +01:00
Gergő Jedlicska ee6e5e22b1 gergo/eventBus (#2498)
* feat(eventBus): WIP event bus typescript wizardy

* feat(eventBus): final eventbus setup with all the typescript foo

* fix(workspaces): fix workspace core imports

* test(workspaces): fix expected events name

* test(workspaces): fix tests
2024-07-12 15:35:40 +02:00
Chuck Driesler e703bb7415 WEB-1140 manage user workspace membership services (#2460)
* feat(workspaces): drop createdByUserId from the dataschema

* feat(workspaces): repositories WIP

* merge

* protect against removing last admin in workspace

* quick impl and stub tests

* add tests

* services

* unit tests for role services

* fix(workspaces): maybe tests work like this

* fix(workspaces): dry

* fix(workspaces): initialize tests better

* fix(workspaces): so true

* fix(workspaces): right

* fix(workspaces): self nit

* fix(workspaces): better repository structure

* fix(workspaces): repair tests, use `example.org`

* fix(workspaces): add tests for new repo functions, repair other tests

* fix(workspaces): better distinction between service-level guarantees and repo-level guarantees

* fix(workspaces): review comments and stencil tests

* fix(workspaces): add tests

* fix(workspaces): tests work

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-07-09 18:26:59 +02:00
Gergő Jedlicska 28ce7c757c feat(workspaces): add repository function implementations
Co-authored-by: Charles Driesler <chuck@speckle.systems>
2024-07-04 13:46:48 +01:00
Charles Driesler a4c9fbab16 ugh 2024-06-28 14:30:51 +01:00
Charles Driesler fc69e26905 event emitter test 2024-06-28 12:41:49 +01:00
Gergő Jedlicska c046979640 test(workspaces): fix tests 2024-06-28 07:50:14 +02:00
Gergő Jedlicska ff0cd77483 feat(workspaces): wip workspace creation 2024-06-25 17:07:38 +02:00