-
Notifications
You must be signed in to change notification settings - Fork 918
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]Add create workspace page #6179
[Workspace]Add create workspace page #6179
Conversation
Signed-off-by: Lin Wang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6179 +/- ##
==========================================
+ Coverage 67.35% 67.42% +0.07%
==========================================
Files 3353 3362 +9
Lines 65083 65258 +175
Branches 10483 10524 +41
==========================================
+ Hits 43837 44001 +164
- Misses 18695 18700 +5
- Partials 2551 2557 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Lin Wang <[email protected]>
…eate-page Signed-off-by: Lin Wang <[email protected]>
export const WORKSPACE_LIST_APP_ID = 'workspace_list'; | ||
export const WORKSPACE_UPDATE_APP_ID = 'workspace_update'; | ||
export const WORKSPACE_OVERVIEW_APP_ID = 'workspace_overview'; | ||
// These features will be checked and disabled in checkbox on default. |
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.
Can you give more detail about comments here? I'm a little bit lost here based on the comment here. thanks
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.
The user needs to select which features will be enabled when creating or updating workspace. The enabled features will be list on the left navigation. The workspace overview and workspace update should be selected by default which means every workspace should have these two pages.
try { | ||
result = await workspaceClient.create(data); | ||
} catch (error) { | ||
notifications?.toasts.addDanger({ |
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.
Can we add tests for cover error handling, such as server errors or unexpected responses here. thanks
}; | ||
} | ||
if (!isValidNameOrDescription(formData.name)) { | ||
currentFormErrors = { |
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.
Do we have test cover for not valid name or description with errors? Thanks
export const WORKSPACE_UPDATE_APP_ID = 'workspace_update'; | ||
export const WORKSPACE_OVERVIEW_APP_ID = 'workspace_overview'; | ||
// These features will be checked and disabled in checkbox on default. | ||
export const DEFAULT_CHECKED_FEATURES_IDS = [WORKSPACE_UPDATE_APP_ID, WORKSPACE_OVERVIEW_APP_ID]; |
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.
DEFAULT_CHECKED_FEATURES_IDS, I'm assuming that you want to mention here by selected
, like DEFAULT_SELECTED_FEATURES_IDS, right? Thanks
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.
I think we can rename to it.
})} | ||
onCancel={closeCancelModal} | ||
onConfirm={() => application?.navigateToApp(WORKSPACE_LIST_APP_ID)} | ||
cancelButtonText={i18n.translate('workspace.form.cancelButtonText.', { |
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.
Is workspace.form.cancelButtonText.
or workspace.form.cancelButtonText
?
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.
Should remove .
, thank you.
…eate-page Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
…eate-page Signed-off-by: Lin Wang <[email protected]>
* Add workspace create page Signed-off-by: Lin Wang <[email protected]> * Add change log for create workspace Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Update annotation for default selected features ids Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Add unit tests for unselected single feature Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> (cherry picked from commit f5896b8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* Add workspace create page Signed-off-by: Lin Wang <[email protected]> * Add change log for create workspace Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Update annotation for default selected features ids Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Add unit tests for unselected single feature Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> (cherry picked from commit f5896b8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This PR is for adding workspace create page. All code changes are under workspace plugin folder. Will register a new workspace create application. This application allow user create workspace from the user interface.
Issues Resolved
closes #6181
Screenshot
Testing the changes
yarn osd bootstrap
config/opensearch_dashboards.yml
addworkspace.enabled: true
yarn start --no-base-path
Create workspace
buttonhttp://localhost:5601/app/w/<workspace_id>/workspace_overview
Check List
yarn test:jest
yarn test:jest_integration