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

fix(KFLUXUI-260): It's unclear to users from representation in UI that components must be unique per workspace #93

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

janaki29
Copy link
Contributor

@janaki29 janaki29 commented Jan 21, 2025

Fixes

https://issues.redhat.com/browse/KFLUXUI-260)

Description

  1. Helper text is added for user conveying component names should be unique within tenant's namespace.
    Helper Text:** Must be unique within tenant namespace **

  2. When creating application, if component name is duplicate then error message is updated to following message:
    "Component already exists in this namespace. Edit the name to be unique and try again."

  3. Unique default component name suggested after adding a URL while creating an application.
    If same component name exists within namespace, then suffix "-[Ramndom Number]" is added.
    Example: Component "sample-component" already exists within namespace, so suggested default component added is
    "sample-component-50". Screenshot is also attached.

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

  1. Helper Text for Component Name Input
image
  1. Updated error message for duplicate Component Name
image

3.Unique Default Component name is suggested

image

@janaki29 janaki29 changed the title Application updates fix(KFLUXUI-260): It's unclear to users from representation in UI that components must be unique per workspace Jan 21, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.14%. Comparing base (4609b37) to head (a4af9f1).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   80.11%   80.14%   +0.02%     
==========================================
  Files         570      570              
  Lines       21452    21542      +90     
  Branches     5050     5078      +28     
==========================================
+ Hits        17187    17265      +78     
- Misses       4241     4252      +11     
- Partials       24       25       +1     
Flag Coverage Δ
unittests 80.14% <100.00%> (+0.02%) ⬆️

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.

Copy link
Contributor

@StanislavJochman StanislavJochman left a comment

Choose a reason for hiding this comment

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

LGTM

@janaki29 janaki29 requested a review from sahil143 January 29, 2025 12:42
Comment on lines +40 to +45
<HelperText>
<HelperTextItem>
Must be unique within tenant namespace{' '}
<span className="component-section-helper-text-namespace-highlighted">{namespace}</span>
</HelperTextItem>
</HelperText>
Copy link
Collaborator

Choose a reason for hiding this comment

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

use input field prop helperText to set the helper text,

Comment on lines +1 to +3
.component-section-helper-text-namespace-highlighted{
font-weight: 800;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing new line

Suggested change
.component-section-helper-text-namespace-highlighted{
font-weight: 800;
}
.component-section {
&__component-name {
&--helper-text {
font-weight: var(--pf-v5-global--FontWeight--bold);
}
}
}

Comment on lines +74 to +81
if (
error?.json?.reason === 'AlreadyExists' &&
error?.json?.details?.kind === 'components'
)
formikHelpers.setStatus({
submitError: `Component "${error.json?.details?.name}" already exists in this namespace. Edit the name to be unique and try again.`,
});
else formikHelpers.setStatus({ submitError: error.message });
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems redundant, you added helper text indicating name should be unique in namespace. We should just show the error message returned by the api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants