Skip to content

Commit

Permalink
Pass helpText prop to Nexus Form (#2265)
Browse files Browse the repository at this point in the history
* Pass helptext to form

* Update translations
  • Loading branch information
Alex-Tideman authored Aug 13, 2024
1 parent 6b2cf56 commit 5197587
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/i18n/locales/en/nexus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Strings = {
'endpoint-name-hint':
'Endpoint name must start with A-Z, a-z or _ and can only contain A-Z, a-z, 0-9, or _',
'endpoint-name-hint-with-dash':
'Endpoint name must start with A-Z, a-z or _ and can only contain A-Z, a-z, 0-9, _ or -',
'Endpoint name must start with A-Z or a-z and can only contain A-Z, a-z, 0-9 or -',
'access-policy': 'Access Policy',
'allowed-caller-namespaces': 'Allowed caller namespaces',
'allowed-caller-namespaces-description':
Expand Down
2 changes: 2 additions & 0 deletions src/lib/pages/nexus-create-endpoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
export let loading = false;
export let isCloud = false;
export let nameRegexPattern: RegExp = /^[A-Za-z_][A-Za-z0-9_]*$/;
export let nameHintText = translate('nexus.endpoint-name-hint');
$: createDisabled =
$endpointForm.spec.name === '' ||
Expand All @@ -33,6 +34,7 @@
</h1>
<NexusForm
{nameRegexPattern}
{nameHintText}
{error}
{targetNamespaceList}
{callerNamespaceList}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/pages/nexus-edit-endpoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
export let loading = false;
export let isCloud = false;
export let nameRegexPattern: RegExp = /^[A-Za-z_][A-Za-z0-9_]*$/;
export let nameHintText = translate('nexus.endpoint-name-hint');
let deleteConfirmationModalOpen = false;
let confirmDeleteInput = '';
Expand Down Expand Up @@ -50,6 +51,7 @@
</div>
<NexusForm
{endpoint}
{nameHintText}
{nameRegexPattern}
{targetNamespaceList}
{callerNamespaceList}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/nexus-form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
export let error: NetworkError | undefined = undefined;
export let nameDisabled = false;
export let isCloud = true;
export let nameHintText = translate('nexus.endpoint-name-hint');
export let nameHintText: string;
export let nameRegexPattern: RegExp;
let name = endpoint?.spec?.name || '';
Expand Down

0 comments on commit 5197587

Please sign in to comment.