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

config: add Service.RequiredLabels #3531

Merged
merged 8 commits into from
Jan 15, 2024
Merged

Conversation

mastercactapus
Copy link
Member

Description:
Adds a Required Labels field for services.

  • Creating a new service will require the user to input a value for the label
  • Editing a service will allow updating required label(s), but not force

Which issue(s) this PR fixes:
Part of #3425

Out of Scope:

  • Displaying labels on details page (in another PR)
  • Reporting on services missing required labels
  • Enforcing a hard requirement via API or otherwise
  • Validating the input beyond empty/not-empty

Screenshots:
image
image

Describe any introduced user-facing changes:

  • Required service labels will now appear in the ServiceForm
  • Create Service dialog will require a user to set a value

Describe any introduced API changes:
N/A

Copy link
Collaborator

@tony-tvu tony-tvu left a comment

Choose a reason for hiding this comment

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

A couple things that should be addressed:

  • There's no validation on admin configs page for invalid label keys.
  • There's no error message when editing a service config's label and submitting.

@github-actions github-actions bot added size/m and removed size/s labels Dec 26, 2023
@mastercactapus
Copy link
Member Author

@tony-tvu good catch, I added the validation for Config and updated the form to display label value errors. you can validate it by adding trailing space to the value in one of the dialogs

@Forfold Forfold self-requested a review December 28, 2023 19:03
Copy link
Contributor

@Forfold Forfold left a comment

Choose a reason for hiding this comment

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

It would be nice to see this hidden requirement before submitting and receiving an error. Also, the error message displayed could definitely be improved (likely very out of scope though) since it's using the fieldName+index: and not the Field Name:

Screenshot 2023-12-28 at 11 07 51 AM

@Forfold
Copy link
Contributor

Forfold commented Dec 28, 2023

One more UX related topic, can we make it so we know that we are filling out a label when creating a service? Maybe have the field name be Service Label, and the actual set label can be a fixed left-adornment within the text field.

Old:

Screenshot 2023-12-28 at 11 11 14 AM

New:

Screenshot 2023-12-28 at 11 16 18 AM

The FormField code for the new, if accepted:

<FormField
  ...
  label='Service Label'
  InputProps={{
    startAdornment: (
      <InputAdornment position='start'>
        {labelName}:
      </InputAdornment>
    ),
  }}
/>

@mastercactapus
Copy link
Member Author

@Forfold

  • for the validation bit, it's not ideal but yeah probably out of scope since it's just following the existing pattern.
  • I agree with updating the text to include the format though, I'll work on that.
  • Hmm, I never thought about an adornment, I do like that better, not sure about Service Label though on every field -- there could be several; how would that look if there were 5?

I'd like to switch to the adornment thing if we can figure out how to label the fields in a way that's not too repetitive

@Forfold
Copy link
Contributor

Forfold commented Dec 29, 2023

@mastercactapus

I think I would be okay with it since each would have a unique adornment.

Or if there's more than 1 we could put in the effort to make it like the admin config text field:

-Service Labels--------------------
| first/key:                      |
-----------------------------------
-----------------------------------
| second/key:                     |
-----------------------------------
-----------------------------------
| third/key:                      |
-----------------------------------

@Forfold
Copy link
Contributor

Forfold commented Jan 4, 2024

Updated the label ux:

(one label required)
Screenshot 2024-01-04 at 9 44 08 AM

(more than one label required)
Screenshot 2024-01-04 at 9 44 45 AM

@mastercactapus mastercactapus merged commit 5984cef into master Jan 15, 2024
@mastercactapus mastercactapus deleted the svc-required-labels branch January 15, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants