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

[Workspace]Disable confirm button during collaborators operation #8604

Merged

Conversation

wanglam
Copy link
Contributor

@wanglam wanglam commented Oct 16, 2024

Description

This PR addresses an issue where the confirm modal was closed after initiating collaborator updates or deletions, allowing users to perform other operations while the API call was in progress. Previously, if changes were made during the API call, the last operation could be missed or overwritten.

To resolve this issue, the following changes have been made:

  1. The confirm button is now disabled during collaborator updates and deletions to prevent additional operations from being triggered while the API call is in progress.

2. The confirm modal remains open during collaborator updates and deletions, preventing users from performing other operations until the current operation is completed. Done by #8594

By keeping the confirm modal open and disabling the confirm button, the user interface now accurately reflects the ongoing operation and prevents potential data loss or inconsistencies caused by concurrent operations.

Screenshot

image
image

Testing the changes

  • Clone branch code and run yarn osd bootstrap --single-version loose
  • Add below configs in config/opensearch_dashboards.yml
savedObjects.permission.enabled: true
workspace.enabled: true
uiSettings:
  overrides:
    'home:useNewHomePage': true
opensearchDashboards.dashboardAdmin.users: ['admin']
  • Run yarn start --no-base-path
  • Login with admin user
  • Visit an existing workspace setting page
  • Add some users or groups by "Add collaborators" button
  • Check the left checkbox in some table rows
  • Click "Actions" button at the top right of table
  • Click "Change access level"
  • Click "Admin"
  • Click "Confirm" button and it should be disabled during updating
  • Click "Delete x collaborator" button at the top left of table
  • Click "Confirm" button in popped confirm modal
  • The "Confirm" button should be disabled during deleting

Changelog

  • feat: [Workspace]Keep confirm modal and disable confirm button during collaborators operation

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.89%. Comparing base (a41f0c5) to head (85aab86).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8604   +/-   ##
=======================================
  Coverage   60.88%   60.89%           
=======================================
  Files        3790     3790           
  Lines       90250    90259    +9     
  Branches    14151    14152    +1     
=======================================
+ Hits        54945    54959   +14     
+ Misses      31835    31829    -6     
- Partials     3470     3471    +1     
Flag Coverage Δ
Linux_1 29.11% <100.00%> (+0.01%) ⬆️
Linux_2 56.39% <ø> (ø)
Linux_3 37.71% <ø> (ø)
Linux_4 29.81% <ø> (ø)
Windows_1 29.13% <100.00%> (+0.01%) ⬆️
Windows_2 56.34% <ø> (ø)
Windows_3 37.71% <ø> (ø)
Windows_4 29.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanglam wanglam changed the title [Workspace]Keep confirm modal and disable confirm button during collaborators operation [Workspace]Disable confirm button during collaborators operation Oct 18, 2024
Hailong-am
Hailong-am previously approved these changes Oct 18, 2024
SuZhou-Joe
SuZhou-Joe previously approved these changes Oct 18, 2024
@wanglam wanglam dismissed stale reviews from SuZhou-Joe and Hailong-am via 85aab86 October 18, 2024 12:07
@SuZhou-Joe SuZhou-Joe merged commit 896ac00 into opensearch-project:main Oct 18, 2024
67 of 68 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 18, 2024
* Keep confirm modal and disable confirm button during operation

Signed-off-by: Lin Wang <[email protected]>

* Changeset file for PR #8604 created/updated

---------

Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 896ac00)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Oct 18, 2024
…) (#8653)

* Keep confirm modal and disable confirm button during operation



* Changeset file for PR #8604 created/updated

---------



(cherry picked from commit 896ac00)

Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
amsiglan pushed a commit to amsiglan/OpenSearch-Dashboards that referenced this pull request Oct 19, 2024
…nsearch-project#8604)

* Keep confirm modal and disable confirm button during operation

Signed-off-by: Lin Wang <[email protected]>

* Changeset file for PR opensearch-project#8604 created/updated

---------

Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
sejli pushed a commit to sejli/OpenSearch-Dashboards that referenced this pull request Oct 21, 2024
…nsearch-project#8604)

* Keep confirm modal and disable confirm button during operation

Signed-off-by: Lin Wang <[email protected]>

* Changeset file for PR opensearch-project#8604 created/updated

---------

Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Oct 30, 2024
…nsearch-project#8604)

* Keep confirm modal and disable confirm button during operation

Signed-off-by: Lin Wang <[email protected]>

* Changeset file for PR opensearch-project#8604 created/updated

---------

Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants