[COMPASS-6538] When an import is in progress, disable import buttons across Compass Created: 21/Feb/23  Updated: 21/Mar/23  Resolved: 05/Mar/23

Status: Closed
Project: Compass
Component/s: Import/Export
Affects Version/s: None
Fix Version/s: 1.36.0

Type: Task Priority: Major - P3
Reporter: Rhys Howell Assignee: Rhys Howell
Resolution: Done Votes: 0
Labels: import, milestone-2a
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File export disabled.png    
Issue Links:
Depends
is depended on by COMPASS-6539 Prevent import menu item usage while ... Closed
Epic Link: COMPASS-5576
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Whale

 Description   

As a result of the import and export flows now becoming non-blocking functionality in Compass we need to maintain the current state of importing and exporting with the rest of Compass. Let's add an import-export react context to Compass to provide the current state of import and export. We can add a provider of import-export state to compass-home’s Workspace component. Subscribers like compass-crud and compass-aggregations get the status of import-export with a hook so it knows that the import/export buttons can be disabled. The state is updated from import-export.

Something like:
type ImportExportState =

{   isImportInProgress: boolean;   isExportInProgress: boolean; }

;

With a context value:
type ImportExportContext =

{   updateImportExportState: (newState: ImportExportState) => void;   importExportState: ImportExportState; }

;

Once the import-export context is available we can use it from other parts of Compass. When an import is in progress the import button in the collection toolbar is disabled, with a tooltip that indicates an operation is in progress and only one operation can happen at once.

The `State` section of the UI technical design has more detailed information: https://docs.google.com/document/d/1MfWGXHcCUTVTQBSpfhUwSYUwCGSpU-O3pzd0diJ3UUY/edit#heading=h.28rryh7bm7kx 

Note: No concrete import example in the designs as it's all LeafyGreen components
https://www.figma.com/file/4sXj42XyicBsdQkYIugHaV/Compass-Import%2FExport?node-id=360%3A26444&t=c6prcyyhaaAhiZDW-1 



 Comments   
Comment by Githook User [ 21/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: COMPASS-6427-export-json
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Comment by Githook User [ 10/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: replace-reflux-with-redux-in-query-bar
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Comment by Githook User [ 06/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: 1.36-releases
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Comment by Githook User [ 06/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: remove-type-field
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Comment by Githook User [ 05/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: github-link
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Comment by Githook User [ 05/Mar/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(compass-import-export): show message when import is in progress COMPASS-6538, COMPASS-6539 (#4132)
Branch: main
https://github.com/mongodb-js/compass/commit/b8ab4b1659165c57382a9c877ec7499a8caffef2

Generated at Wed Feb 07 22:43:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.