[Workspace]Fix page crash caused by invalid workspace color#7671
Merged
SuZhou-Joe merged 2 commits intoopensearch-project:mainfrom Aug 12, 2024
Merged
Conversation
opensearch-changeset-bot bot
added a commit
to wanglam/OpenSearch-Dashboards
that referenced
this pull request
Aug 9, 2024
b480aa6 to
c1d5d3d
Compare
opensearch-changeset-bot bot
added a commit
to wanglam/OpenSearch-Dashboards
that referenced
this pull request
Aug 9, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7671 +/- ##
=======================================
Coverage 63.69% 63.69%
=======================================
Files 3633 3634 +1
Lines 80126 80140 +14
Branches 12695 12702 +7
=======================================
+ Hits 51034 51043 +9
- Misses 25984 25987 +3
- Partials 3108 3110 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
37b85d9 to
6a4944f
Compare
opensearch-changeset-bot bot
added a commit
to wanglam/OpenSearch-Dashboards
that referenced
this pull request
Aug 9, 2024
opensearch-changeset-bot bot
added a commit
to wanglam/OpenSearch-Dashboards
that referenced
this pull request
Aug 9, 2024
Signed-off-by: Lin Wang <wonglam@amazon.com>
5b68990 to
ec91b97
Compare
Hailong-am
reviewed
Aug 9, 2024
Comment on lines
+6
to
+8
| // Reference https://github.com/opensearch-project/oui/blob/main/src/services/color/is_valid_hex.ts | ||
| export const validateWorkspaceColor = (color?: string) => | ||
| !!color && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color); |
Collaborator
There was a problem hiding this comment.
can we replace it with import { is_valid_hex } from '@opensearch-project/oui/lib/services/color';?
Collaborator
Author
There was a problem hiding this comment.
That not works fine in my local. Seems can't import from @opensearch-project/oui/lib/services/color;
I've tried import { isValidHex } from '@elastic/eui';, but it not works for server side.
ruanyl
approved these changes
Aug 9, 2024
SuZhou-Joe
approved these changes
Aug 12, 2024
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Aug 12, 2024
* Add validation for workspace color Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #7671 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 248c8ff) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl
pushed a commit
that referenced
this pull request
Aug 12, 2024
…7681) * Add validation for workspace color * Changeset file for PR #7671 created/updated --------- (cherry picked from commit 248c8ff) 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR for fixing page crashed after invalid color be assigned to avatar component in the Workspace Menu component.
Issues Resolved
#7672
Screenshot
Testing the changes
1.Go to 'Create workspace' page
2.Fill workspace name and select use case, input a invalid color.
3.Click on 'Create workspace' button
4.Workspace should not be created with invalid color, it should show form error
Changelog
Check List
yarn test:jestyarn test:jest_integration