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]Add right sidebar to workspace create form #7750

Conversation

wanglam
Copy link
Contributor

@wanglam wanglam commented Aug 19, 2024

Description

This PR is for adding workspace right sidebar to workspace create form. Mainly includes below changes:

  1. Move workspace_form inside workspace_creator folder
  2. Add right side bar to workspace create form

Issues Resolved

#7765

Screenshot

image

Testing the changes

  • Clone branch code and run yarn osd bootstrap --single-version ignore
  • Add below configs in config/opensearch_dashboards.yml
savedObjects.permission.enabled: true
workspace.enabled: true
uiSettings:
  overrides:
    'home:useNewHomePage': true
  • Run yarn start --no-base-path
  • Login and visit workspace create page
  • The right sidebar will displayed, the form summary will be changed and the create button can be clicked.

Changelog

  • feat: [Workspace]Add right sidebar to workspace create form

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

opensearch-changeset-bot bot added a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Aug 19, 2024
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 98.59155% with 1 line in your changes missing coverage. Please review.

Project coverage is 64.32%. Comparing base (07504f6) to head (6e2ae44).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...nents/workspace_creator/workspace_creator_form.tsx 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7750      +/-   ##
==========================================
+ Coverage   64.30%   64.32%   +0.02%     
==========================================
  Files        3674     3676       +2     
  Lines       81138    81185      +47     
  Branches    12927    12943      +16     
==========================================
+ Hits        52174    52222      +48     
+ Misses      25752    25751       -1     
  Partials     3212     3212              
Flag Coverage Δ
Linux_1 30.27% <98.59%> (+0.05%) ⬆️
Linux_2 56.19% <ø> (ø)
Linux_3 40.61% <ø> (+<0.01%) ⬆️
Linux_4 31.40% <ø> (ø)
Windows_1 30.29% <98.59%> (+0.05%) ⬆️
Windows_2 56.14% <ø> (ø)
Windows_3 40.62% <ø> (ø)
Windows_4 31.40% <ø> (ø)

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 pushed a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Aug 22, 2024
@wanglam wanglam force-pushed the feat-add-workspace-create-right-sidebar branch from 5eca186 to 1278a74 Compare August 22, 2024 13:13
@wanglam wanglam marked this pull request as ready for review August 22, 2024 16:10
ruanyl
ruanyl previously approved these changes Aug 23, 2024
Comment on lines 39 to 70
return {
[RightSidebarScrollField.UseCase]: i18n.translate(
'workspace.form.summary.panel.useCase.title',
{
defaultMessage: 'Use case',
}
),
[RightSidebarScrollField.Name]: i18n.translate('workspace.form.summary.panel.name.title', {
defaultMessage: 'Name',
}),
[RightSidebarScrollField.Description]: i18n.translate(
'workspace.form.summary.panel.description.title',
{
defaultMessage: 'Description',
}
),
[RightSidebarScrollField.Color]: i18n.translate('workspace.form.summary.panel.color.title', {
defaultMessage: 'Accent color',
}),
[RightSidebarScrollField.DataSource]: i18n.translate(
'workspace.form.summary.panel.dataSources.title',
{
defaultMessage: 'Data sources',
}
),
[RightSidebarScrollField.Member]: i18n.translate(
'workspace.form.summary.panel.members.title',
{
defaultMessage: 'Members',
}
),
}[field];
Copy link
Member

Choose a reason for hiding this comment

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

Nit: maybe can just make it a constant, then use it at where it's needed with SCROLL_FIELDS[field]

Suggested change
return {
[RightSidebarScrollField.UseCase]: i18n.translate(
'workspace.form.summary.panel.useCase.title',
{
defaultMessage: 'Use case',
}
),
[RightSidebarScrollField.Name]: i18n.translate('workspace.form.summary.panel.name.title', {
defaultMessage: 'Name',
}),
[RightSidebarScrollField.Description]: i18n.translate(
'workspace.form.summary.panel.description.title',
{
defaultMessage: 'Description',
}
),
[RightSidebarScrollField.Color]: i18n.translate('workspace.form.summary.panel.color.title', {
defaultMessage: 'Accent color',
}),
[RightSidebarScrollField.DataSource]: i18n.translate(
'workspace.form.summary.panel.dataSources.title',
{
defaultMessage: 'Data sources',
}
),
[RightSidebarScrollField.Member]: i18n.translate(
'workspace.form.summary.panel.members.title',
{
defaultMessage: 'Members',
}
),
}[field];
const SCROLL_FIELDS = {
[RightSidebarScrollField.UseCase]: i18n.translate(
'workspace.form.summary.panel.useCase.title',
{
defaultMessage: 'Use case',
}
),
[RightSidebarScrollField.Name]: i18n.translate('workspace.form.summary.panel.name.title', {
defaultMessage: 'Name',
}),
[RightSidebarScrollField.Description]: i18n.translate(
'workspace.form.summary.panel.description.title',
{
defaultMessage: 'Description',
}
),
[RightSidebarScrollField.Color]: i18n.translate('workspace.form.summary.panel.color.title', {
defaultMessage: 'Accent color',
}),
[RightSidebarScrollField.DataSource]: i18n.translate(
'workspace.form.summary.panel.dataSources.title',
{
defaultMessage: 'Data sources',
}
),
[RightSidebarScrollField.Member]: i18n.translate(
'workspace.form.summary.panel.members.title',
{
defaultMessage: 'Members',
}
),
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good to me, will update.

@wanglam wanglam marked this pull request as draft August 27, 2024 09:26
wanglam pushed a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Aug 28, 2024
@wanglam wanglam force-pushed the feat-add-workspace-create-right-sidebar branch 2 times, most recently from 8e1f1e9 to 60d235b Compare August 28, 2024 07:43
wanglam pushed a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Aug 28, 2024
wanglam pushed a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Aug 28, 2024
@wanglam wanglam force-pushed the feat-add-workspace-create-right-sidebar branch from 60d235b to fc002b0 Compare August 28, 2024 09:35
@wanglam wanglam force-pushed the feat-add-workspace-create-right-sidebar branch from fc002b0 to 6294070 Compare August 29, 2024 03:58
@wanglam wanglam marked this pull request as ready for review August 29, 2024 05:07
@SuZhou-Joe SuZhou-Joe merged commit 76d7a8b into opensearch-project:main Aug 30, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 30, 2024
* Move workspace form inside workspace creator

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

* Remove enter details panel

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

* Rename workspace_form to workspace_creator_form

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

* Clarify workspace form types

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

* Add right sidebar to workspace creator

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

* Add submitting lock for workspace create page

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

* Changeset file for PR #7750 created/updated

* Fix form submitting lock not been covered

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

---------

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 76d7a8b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Aug 30, 2024
* Move workspace form inside workspace creator



* Remove enter details panel



* Rename workspace_form to workspace_creator_form



* Clarify workspace form types



* Add right sidebar to workspace creator



* Add submitting lock for workspace create page



* Changeset file for PR #7750 created/updated

* Fix form submitting lock not been covered



---------



(cherry picked from commit 76d7a8b)

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>
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.

4 participants