Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workspaces): folders #6856

Merged
merged 27 commits into from
Oct 30, 2023
Merged

feat(workspaces): folders #6856

merged 27 commits into from
Oct 30, 2023

Conversation

wanlingt
Copy link
Contributor

Problem

(Attempt 2, first attempt was reverted in #6844)
Related PR for fix to first attempt: #6843

Closes FRM-1245

Tests

QA tests in notion

hanstirtaputra and others added 26 commits July 29, 2022 10:24
* feat: add get workspaces endpoint skeleton

* feat: add create workspace API endpoint

* feat: add update workspace title API endpoint

* feat: add delete workspace API endpoint

* feat: add get workspace forms API endpoint

* feat: add delete workspace forms API endpoint

* feat: add move workspace forms API endpoint

* feat: add auth and logging for workspace routes

* feat: update workspace service to take in necessasry parameters

* feat: add request body for delete workspace api
* feat: add workspace database model

* feat: add workspace db model tests

* refactor: update variable naming in workspace tests

* feat: update workspace formId validation to test for existent admin

* feat: add WorkspaceDto

* fix: update workspace formIds validation rules

* fix: removed unused database fields renaming

* refactor: simplify expression for workspace formIds validation

* feat: add timestamps for workspace db model

* fix: add more workspace model tests and rename test descriptions

* fix: reduce maximum title length of workspace to 50 chars
* fix: removed unused database fields renaming

* feat: add timestamps for workspace db model

* feat: add get workspaces functionality

* feat: add get workspaces tests

* feat: update workspace mapRouteError to include more MongoErrors

* refactor: remove unused MissingUserError in workspace service

* fix: include _id in Workspace type

* feat: add test to check workspace ordering in GET API

* refactor: rename mock constant in model tests

* refactor: remove unused virtual count in workspace model

* feat: add controller test for database conflict error
* feat: add create workspace functionality

* feat: add tests for create workspace functionality

* fix: remove return type for create workspace method in model

* feat: add database conflict error test for workspace controller

* fix: failing tests

* fix: update joi validation for workspace title to 50 chars
* feat: add update workspace title functionality

* feat: add update workspace title functionality tests

* refactor: workspace model to simplify function call

* feat: add workspace admin permissions check for udpate workspace title

* fix: return appropriate error when unable to update workspace title

* refactor: use object arguments for updateWorkspaceTitle

* fix: broken test cases

* feat: add route test for update title when user has no permissions

* refactor: remove admin field from updateWorkspaceTitle

* fix: update workspace validation implementation

* refactor: workspace utils error messaging
* refactor: move Workspace contents to a WorkspaceContent component

* feat: add side menu view to WorkspacePage

* feat: add mobile view for workspace page

* feat: use msw for GET workspaces instead of hardcoding in WorkspacePage

* refactor: WorkspacePage to combine mobile and desktop views

* fix: update size and page validation in useWorkspaceForms

* fix: remove react rollout banner since workspaces is released after rollout

* feat: update workspace page to include AdminNavBar
* feat: add create workspace modal view for desktop and mobile

* refactor: move create workspace modal to CreateOrRenameWorkspaceModal.tsx

* feat: add storybook for create workspace modal

* feat: add edit workspace icon button

* chore: cleanup unused formCount prop in WorkspaceHeader

* feat: add rename workspace modal

* feat: add storybook for rename workspace modal

* feat: add delete workspace modal

* feat: add delete workspace modal storybook

* refactor: split CreateOrRenameWorkspaceModal to Create and Rename modals

* feat: add RenameWorkspaceModal storybook

* fix: add isFullWidth for mobile viewport modal buttons

* refactor: cleanup unused minLength validator in workspaceValidation
* feat: add delete workspace functionality

* feat: add delete workspace functionality tests

* refactor: use object function argument for deleteWorkspace

* fix: move deleteWorkspace transaction logic to WorkspaceService

* feat: update deleteWorkspace to return boolean instead of void

* refactor: deleteWorkspace transaction to use mongoose withTransaction

* fix: use form document method to archive forms instead of static method

This resolves the issue of failing transaction due to 'nearest' readPreference for FormSchema.
Setting readPreference for static queries throws an error.

* fix: tests for deleteWorkspace functionality

* refactor: remove admin field from deleteWorkspace

* fix: delete workspace transaction to update model instead of documents

Fixed the readPreference issue in multi-document transactions by setting
readPreference in updateMany function on FormModel to be 'primary'

* refactor: workspace service test to reduce db queries

* fix: remove unused session parameter from form model archive method
…paces functionality (#6418)

* feat: add delete workspace functionality

* feat: add delete workspace functionality tests

* refactor: use object function argument for deleteWorkspace

* fix: move deleteWorkspace transaction logic to WorkspaceService

* feat: update deleteWorkspace to return boolean instead of void

* refactor: deleteWorkspace transaction to use mongoose withTransaction

* fix: use form document method to archive forms instead of static method

This resolves the issue of failing transaction due to 'nearest' readPreference for FormSchema.
Setting readPreference for static queries throws an error.

* fix: tests for deleteWorkspace functionality

* refactor: remove admin field from deleteWorkspace

* fix: delete workspace transaction to update model instead of documents

Fixed the readPreference issue in multi-document transactions by setting
readPreference in updateMany function on FormModel to be 'primary'

* refactor: workspace service test to reduce db queries

* fix: remove unused session parameter from form model archive method

* fix: add new flag to deleteWorkspace findOneAndDelete

* feat: add move forms to another workspace functionality

* test: happy path remove and add formIds to workspace

* test: fix delete and add move form happy path workspace routes

* test: happy path test for workspace service move form

* test: add error test for workspace routes

---------

Co-authored-by: Hans Tirtaputra <[email protected]>
* feat: add api services for workspace

* feat: update Workspace page with default workspace

* feat: update workspace context

* feat: add workspace mutations

* chore: trim workspace content props

* feat: add functionality for rename and delete workspace

* feat: add default workspace to menu

* feat: implement create workspace

* feat: update workspace header

* feat: implement row action and move form to workspace

* feat: remove workspace mocks from browser

* feat: remove form from workspaces after archive

* feat: reset rename modal useform value

* fix: do not mutate if title is same

* fix: move to selected workspace even form exists

* fix: do not switch to workspace after moving

* fix: mobile mode for workspace

* chore: clean unused attributes

* chore: improve spacing for desktop workspace header

* chore: improve spacing for mobile view too

* fix: align workspace with develop

* fix: useQuery keys

* feat: delete workspace message

* fix: BE tests

* fix: delete workspace copy

* chore: abstract out use context form workspace modals

* fix: mock workspace for storybook

* fix: mobile workspace page grid and menu padding

* feat: display checkbox on form's current workspace

* feat: use callback and memo for workspace row actions

* feat: mobile drawer actions

* fix: move emptyworkspace to WorkspaceContent
…#6592)

* fix: remove form from workspace upon collaborator removal

* fix: typing of default workspace

* fix: return promise and catch error
* fix: UI updates from design review

* feat: change text style of default workspace

* feat: bold deleted workspace name

* feat: drawer for mobile workspace edit

* fix: separate form count from the workspace title

* feat: update workspace content and removed unused WorkspacePageContent

* feat: update empty workspace component with folder variation

* feat: display emptyworkspace based on whether default

* chore: copy fixes

* chore: copy for aria-label
)

* feat: create and move form to workspace transaction

* feat: inject workspace Id to create form handler

* fix: promise return of create form transaction

* fix: invalidate workspace query cache when creating form

* feat: allow for optional workspaceId param in duplicate form

* feat: update dupe form wizard to duplicate to active workspace

* fix: do not send workspaceId if is default workspace

* test: fix admin controller tests

* test: add workspaceId test to admin controller

* chore: abstract processing of form into workspace for testing

* test: form into workspace processing

* chore: use duplicate dto for duplicate controller

* chore: use duplicate dto in FE mutations

* docs: improve explanation of workspaceId logic

* chore: use CreateFormBodyDto type for validator
* feat: route to remove workspace from forms

* feat: FE mutation to remove form from workspaces

* feat: add remove form from workspace to row actions

* chore: remove deprecated workspace form routes

* fix: design review

* fix: show workspace header for empty workspaces

* fix: span the workspace content

* test: workspace route test for removing from

* feat: use a post request for removing forms for extensibility

* test: update tests

* fix: update remove form workspace service users

* test: fix admin form controller tests

* refactor: abstract out empty workspace components

* chore: update meta action name and messages

* refactor: de-DRY workspace click

* chore: remove unused method and imports

* fix: revert mobile margins

* fix: prevent overflow of folder name in mobile
* chore: update copy of workspace validation messages

* chore: remove bolding from workspace titel

* feat: folders feature announcement

* fix: conditional rendering of create workspace modal

* fix: change border to grid level

* fix: make content bg always neutral 100

* fix: apply column length to both md and lg
* fix: empty grey scrollbars

* fix: alignment of text in empty folder

* fix: reduce length of workspace title to 25

* fix: add min width to button to prevent text overflow

* fix: conditionally rename modal

* fix: reset move workspace state on close

* fix: use constants for min and max title length

* fix: use rem over px
* feat: use svg

* feat: use svg instead of animation json

* ref: add type to AnnouncementsFeatureList

* fix: use correct import file path

* fix: change announcement date to 2023-10-26

* fix: delete unused json
@linear
Copy link

linear bot commented Oct 30, 2023

@mergify mergify bot mentioned this pull request Oct 30, 2023
2 tasks
features: [
{
title: 'Introducing Folders!',
date: new Date('25 Oct 2023 GMT+8'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the date to 31st?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes!! thanks!

Copy link
Contributor

@KenLSM KenLSM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wanlingt wanlingt merged commit 8fc9ceb into develop Oct 30, 2023
15 checks passed
@wanlingt wanlingt deleted the form-v2/form-workspaces branch October 30, 2023 08:01
@wanlingt wanlingt mentioned this pull request Oct 30, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants