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]Fix workspace description error when name invalid #8079

Conversation

wanglam
Copy link
Contributor

@wanglam wanglam commented Sep 9, 2024

Description

This PR is for fixing workspace description field error when name invalid in the workspace create and detail page.

Issues Resolved

#8081

Screenshot

image
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
  • Input a invalid workspace name, such as "Observability~!@"
  • Click "Create workspace" button
  • Workspace name should show error and workspace description should not show error
  • Input a valid workspace name, and click "Create workspace" button
  • Go to the created workspace page and click "Edit" button
  • Input a in valid workspace name and click "Save changes" button
  • Workspace name should show error and workspace description should not show error

Changelog

  • fix: [Workspace]Fix workspace description error when name invalid

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: Lin Wang <wonglam@amazon.com>
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.58%. Comparing base (cedba8e) to head (1fea6fa).
Report is 73 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8079   +/-   ##
=======================================
  Coverage   60.58%   60.58%           
=======================================
  Files        3738     3738           
  Lines       88674    88674           
  Branches    13782    13782           
=======================================
  Hits        53727    53727           
  Misses      31662    31662           
  Partials     3285     3285           
Flag Coverage Δ
Linux_1 28.76% <ø> (ø)
Linux_2 56.27% <ø> (ø)
Linux_3 37.51% <ø> (ø)
Linux_4 29.60% <ø> (ø)
Windows_1 28.77% <ø> (ø)
Windows_2 56.22% <ø> (ø)
Windows_3 37.52% <ø> (ø)
Windows_4 29.60% <ø> (ø)

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.

onChange={setDescription}
error={formErrors.name?.message}
/>
<WorkspaceDescriptionField value={formData.description} onChange={setDescription} />
Copy link
Member

@ruanyl ruanyl Sep 9, 2024

Choose a reason for hiding this comment

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

Does description field have validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No validation for description field for now.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I thought we have 200 size limit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the workspace description field will turn to red. And the create workspace button will be disabled when description text over 200 characters. But the "Saved changes" button won't be disabled in the edit mode in workspace detail page. Do we need to add this in current PR?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with having it in a separate PR

@ruanyl ruanyl merged commit ee5d482 into opensearch-project:main Sep 9, 2024
80 of 81 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 9, 2024
* Fix workspace description error when name invalid

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Changeset file for PR #8079 created/updated

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit ee5d482)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 9, 2024
* Fix workspace description error when name invalid

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Changeset file for PR #8079 created/updated

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit ee5d482)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Sep 10, 2024
…8083)

* Fix workspace description error when name invalid



* Changeset file for PR #8079 created/updated

---------



(cherry picked from commit ee5d482)

Signed-off-by: Lin Wang <wonglam@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>
ruanyl pushed a commit that referenced this pull request Sep 10, 2024
…8084)

* Fix workspace description error when name invalid



* Changeset file for PR #8079 created/updated

---------



(cherry picked from commit ee5d482)

Signed-off-by: Lin Wang <wonglam@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>
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