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

[Worksapce] Hide delete button for non osd admins in workspace list #8315

Merged

Conversation

Kapian1234
Copy link
Contributor

Description

Hide delete button for non osd admins in workspace list

Issues Resolved

Screenshot

Testing the changes

Changelog

  • fix: Hide delete button for non osd admins in workspace list

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

Signed-off-by: Kapian1234 <wanjinch@amazon.com>
Comment on lines +320 to 333
isDashboardAdmin && (
<>
<EuiButton color="danger" iconType="trash" onClick={onClick}>
Delete {selection.length} Workspace
</EuiButton>
{deletedWorkspaces && deletedWorkspaces.length > 0 && (
<DeleteWorkspaceModal
selectedWorkspaces={deletedWorkspaces}
onClose={() => setDeletedWorkspaces([])}
/>
)}
</>
)
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we hide the checkbox as well? the only action user can take for multiple select is batch delete, if we hide the delete button and keep multi select, that looks a little wired user can't do anything after select.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Signed-off-by: Kapian1234 <wanjinch@amazon.com>
Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 60.98%. Comparing base (9fd0f0b) to head (2437438).
Report is 179 commits behind head on main.

Files with missing lines Patch % Lines
...rkspace/public/components/workspace_list/index.tsx 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8315      +/-   ##
==========================================
- Coverage   64.14%   60.98%   -3.17%     
==========================================
  Files        3743     3743              
  Lines       88836    88845       +9     
  Branches    13852    13857       +5     
==========================================
- Hits        56981    54179    -2802     
- Misses      31240    31312      +72     
- Partials      615     3354    +2739     
Flag Coverage Δ
Linux_1 28.85% <40.00%> (-1.22%) ⬇️
Linux_2 56.34% <ø> (-2.52%) ⬇️
Linux_3 37.78% <ø> (-2.58%) ⬇️
Linux_4 29.94% <ø> (-1.64%) ⬇️
Windows_1 28.87% <40.00%> (-1.22%) ⬇️
Windows_2 56.29% <ø> (-2.52%) ⬇️
Windows_3 37.78% <ø> (-2.58%) ⬇️
Windows_4 29.94% <ø> (-1.64%) ⬇️

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.

@ruanyl ruanyl merged commit 8fb8fed into opensearch-project:main Sep 29, 2024
64 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 29, 2024
…8315)

* hide delete_workspace button for non osd admins in workspace list

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* Changeset file for PR #8315 created/updated

* Disable selection of workspaces for non osd admins

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

---------

Signed-off-by: Kapian1234 <wanjinch@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 8fb8fed)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Sep 30, 2024
…8315) (#8376)

* hide delete_workspace button for non osd admins in workspace list



* Changeset file for PR #8315 created/updated

* Disable selection of workspaces for non osd admins



---------



(cherry picked from commit 8fb8fed)

Signed-off-by: Kapian1234 <wanjinch@amazon.com>
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>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Oct 3, 2024
…pensearch-project#8315) (opensearch-project#8376)

* hide delete_workspace button for non osd admins in workspace list



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

* Disable selection of workspaces for non osd admins



---------



(cherry picked from commit 8fb8fed)

Signed-off-by: Kapian1234 <wanjinch@amazon.com>
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>
@ananzh ananzh added the v2.18.0 label Oct 30, 2024
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.

5 participants