-
Notifications
You must be signed in to change notification settings - Fork 934
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 select data source panel for non dashboard admin in workspace create/edit page #7213
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7213 +/- ##
==========================================
- Coverage 67.62% 67.62% -0.01%
==========================================
Files 3471 3471
Lines 68613 68615 +2
Branches 11165 11167 +2
==========================================
Hits 46399 46399
- Misses 19510 19511 +1
- Partials 2704 2705 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with minor comments
src/plugins/workspace/public/components/workspace_form/workspace_form.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/workspace/public/components/workspace_form/workspace_form.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
…ce_form.test.tsx Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com>
…ce_form.tsx Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7213-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 662ee4102539a2714090e18fe01486ee0f833420
# Push it to GitHub
git push --set-upstream origin backport/backport-7213-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
…in workspace create/edit page (#7213) * only enable select data source panel for dashboard admin Signed-off-by: tygao <tygao@amazon.com> * test: update create and update tests setup Signed-off-by: tygao <tygao@amazon.com> * Changeset file for PR #7213 created/updated * test: update workspace create test case Signed-off-by: tygao <tygao@amazon.com> * Changeset file for PR #7213 created/updated * Update src/plugins/workspace/public/components/workspace_form/workspace_form.test.tsx Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com> * Update src/plugins/workspace/public/components/workspace_form/workspace_form.tsx Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com> * Update changelogs/fragments/7213.yml Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Tianyu Gao <tygao@amazon.com> * add data source judge Signed-off-by: tygao <tygao@amazon.com> * update plugin configuration Signed-off-by: tygao <tygao@amazon.com> * update with form change Signed-off-by: tygao <tygao@amazon.com> * update tests with form change Signed-off-by: tygao <tygao@amazon.com> --------- Signed-off-by: tygao <tygao@amazon.com> Signed-off-by: Tianyu Gao <tygao@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com> (cherry picked from commit 662ee41) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…in workspace create/edit page (#7213) (#7259) * only enable select data source panel for dashboard admin * test: update create and update tests setup * Changeset file for PR #7213 created/updated * test: update workspace create test case * Changeset file for PR #7213 created/updated * Update src/plugins/workspace/public/components/workspace_form/workspace_form.test.tsx * Update src/plugins/workspace/public/components/workspace_form/workspace_form.tsx * Update changelogs/fragments/7213.yml * add data source judge * update plugin configuration * update with form change * update tests with form change --------- (cherry picked from commit 662ee41) Signed-off-by: tygao <tygao@amazon.com> Signed-off-by: Tianyu Gao <tygao@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> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com>
Description
Hide select data source panel for non dashboard admin or when data source is disabled in workspace create/edit page
Screenshot
Non OSD admin
OSD admin
Testing the changes
Dashboard admin and data source is enabled
Set username in
opensearchDashboards.dashboardAdmin.users
anddata_source.enabled: true
in YML, then go to workspace create page or edit page, you will see select data source panelNon Dashboard admin
Set other username in
opensearchDashboards.dashboardAdmin.users
in YML(If you don't set a value you will still be treated as dashboard admin), then go to workspace create page or edit page, you won't see select data source panel.Data source disabled
Set
data_source.enabled: false
in YML, then go to workspace create page or edit page, you won't see select data source panel.Changelog
Check List
yarn test:jest
yarn test:jest_integration