-
Notifications
You must be signed in to change notification settings - Fork 892
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
Edit wizard directly on dashboard #2508
Edit wizard directly on dashboard #2508
Conversation
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
6832821
to
3f9f9e0
Compare
Codecov Report
@@ Coverage Diff @@
## main #2508 +/- ##
==========================================
- Coverage 66.74% 66.72% -0.02%
==========================================
Files 3201 3201
Lines 60948 60955 +7
Branches 9267 9271 +4
==========================================
- Hits 40679 40675 -4
- Misses 18052 18062 +10
- Partials 2217 2218 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Now that we have some test coverage for saving and loading (thanks!), we should also include unit tests for this flow, particularly because there are five separate user flows that are a little confusing to mentally model. |
@joshuarrrr Yea i agree. Do you think it is more appropriate to write functional tests for these flows? Since it involves with user clicking different button and toggle. Also when i was writing the unit tests for get_top_nav_config() function, i included a unit test for the edit logic there. OpenSearch-Dashboards/src/plugins/wizard/public/application/utils/get_top_nav_config.test.tsx Line 140 in b75e07d
|
@joshuarrrr yeah there is a functional test we plan on adding for this flow. |
@abbyhu2000 how was that test for the edit flow previously passing if the change is being made here? |
@ashwin-pc When i am writing my last PR(create wizard directly from dashboard), i include the editing logic in the onSave() function. So when i am writing unit tests for onSave(), i am able to mock the props of onSave and test that part of the logic. However, in order for editing wizard from dashboard to work, the logic that's needed inside the topNavConfig constant to call that onSave() function with the correct props are still missing, so this PR added those logics. Previously when we try to edit wizard directly from dashboard, the changes were not being saved after we click |
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.
LGTM
defaultMessage: 'Finish editing wizard and return to the last app', | ||
} | ||
), | ||
testId: 'wizardsaveAndReturnButton', |
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.
NIT: Casing is off on this one.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-2508-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d6197a7827cc6858fb31af98154f8e8324b80fe3
# Push it to GitHub
git push --set-upstream origin backport/backport-2508-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: Sergey V. Osipov <sipopo@yandex.ru>
Description
Edit wizard directly on dashboard following the steps:
Edit
button on the top nav bar of the dashboardWhen finish editing wizard, there are some different options for saving that wizard, this PR ensures the below five different flows for editing wizard all work as expected:
Save and return
button on top nav bar --> will save the original wizard and return back to the dashboard without displaying an additional save modalSave as
button on top nav bar --> will open a save modalsave as new wizard
toggle on +add to dashboard after saving
toggle on + Save and return buttonsave as new wizard
toggle on +add to dashboard after saving
toggle off + Save buttonsave as new wizard
toggle off +return to dashboard after saving
toggle on + Save and return buttonsave as new wizard
toggle off +return to dashboard after saving
toggle off + Save buttonIssues Resolved
#2382
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr