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

Ability to pass regex to form from create/edit #2264

Merged
merged 1 commit into from
Aug 12, 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
9 changes: 8 additions & 1 deletion src/lib/pages/nexus-create-endpoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let error: NetworkError | undefined = undefined;
export let loading = false;
export let isCloud = false;
export let nameRegexPattern: RegExp = /^[A-Za-z_][A-Za-z0-9_]*$/;

$: createDisabled =
$endpointForm.spec.name === '' ||
Expand All @@ -30,7 +31,13 @@
<h1 data-testid="namespace-selector-title">
{translate('nexus.create-endpoint')}
</h1>
<NexusForm {error} {targetNamespaceList} {callerNamespaceList} {isCloud} />
<NexusForm
{nameRegexPattern}
{error}
{targetNamespaceList}
{callerNamespaceList}
{isCloud}
/>
<div class="flex items-center gap-4">
<Button
variant="primary"
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 @@ -20,6 +20,7 @@
export let error: NetworkError | undefined = undefined;
export let loading = false;
export let isCloud = false;
export let nameRegexPattern: RegExp = /^[A-Za-z_][A-Za-z0-9_]*$/;

let deleteConfirmationModalOpen = false;
let confirmDeleteInput = '';
Expand Down Expand Up @@ -49,6 +50,7 @@
</div>
<NexusForm
{endpoint}
{nameRegexPattern}
{targetNamespaceList}
{callerNamespaceList}
{error}
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 @@ -40,7 +40,7 @@
export let nameDisabled = false;
export let isCloud = true;
export let nameHintText = translate('nexus.endpoint-name-hint');
export let nameRegexPattern = /^[A-Za-z_][A-Za-z0-9_]*$/;
export let nameRegexPattern: RegExp;

let name = endpoint?.spec?.name || '';
let description = endpoint?.spec?.descriptionString || '';
Expand Down
Loading