PHACDataHub / sci-portal

1 stars 0 forks source link

Add validation for the label fields #435

Closed seanpoulter-foci closed 3 months ago

seanpoulter-foci commented 4 months ago

Add validation for the label inputs based on https://cloud.google.com/resource-manager/docs/labels-overview#requirements.

Technical Implementation

The simple validation example is documented at https://backstage.io/docs/features/software-templates/input-examples:

        maxLength: 8
        pattern: '^([a-zA-Z][a-zA-Z0-9]*)(-[a-zA-Z0-9]+)*$'

The errors aren't great. We'd probably want custom validation for a "ResourceLabel" input field, which isn't too far off the kebab-case example on https://backstage.io/docs/features/software-templates/writing-custom-field-extensions.