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

Pass helpText prop to Nexus Form #2265

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading