Skip to content

Commit

Permalink
Merge pull request #6 from KevinFCormier/simplify-messages
Browse files Browse the repository at this point in the history
Reduce duplication of messages
  • Loading branch information
vishsanghishetty authored Jan 22, 2025
2 parents ee0f1f1 + 2dd259b commit 52c80bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frontend/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1884,11 +1884,13 @@
"Name needs to be unique to the namespace on each of the managed clusters.": "Name needs to be unique to the namespace on each of the managed clusters.",
"The name specifies the network attached to the nodes in the format <namespace>/<name> to reference the multus network attachment definition": "The name specifies the network attached to the nodes in the format <namespace>/<name> to reference the multus network attachment definition",
"Name your search and provide a description so that you can access it in the future.": "Name your search and provide a description so that you can access it in the future.",
"name.invalid.dns.label": "The name is invalid. $t(import.form.invalid.dns.label)",
"namespace": "namespace",
"Namespace": "Namespace",
"Namespace where the selected Argo application resources are deployed.": "Namespace where the selected Argo application resources are deployed.",
"Namespace: {{namespace}}": "Namespace: {{namespace}}",
"namespace.exists.error": "The namespace you selected is already used by an existing managed cluster.",
"namespace.invalid.dns.label": "The namespace is invalid. $t(import.form.invalid.dns.label)",
"Namespaces": "Namespaces",
"Namespaces match label expressions": "Namespaces match label expressions",
"Namespaces match labels": "Namespaces match labels",
Expand Down Expand Up @@ -2869,7 +2871,6 @@
"The maximum number of non-compliant cluster policy details that pass to the Ansible platform as extra variables. When it is set to 0, it means no limit. The default value is 1000.": "The maximum number of non-compliant cluster policy details that pass to the Ansible platform as extra variables. When it is set to 0, it means no limit. The default value is 1000.",
"The name for the credential.": "The name for the credential.",
"The name for the node pool.": "The name for the node pool.",
"The name is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character \"-\" is also permitted, as long as it does not appear in the first or last position.": "The name is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character \"-\" is also permitted, as long as it does not appear in the first or last position.",
"The name of the cloud section of the clouds.yaml to use for establishing communication to the OpenStack server.": "The name of the cloud section of the clouds.yaml to use for establishing communication to the OpenStack server.",
"The name of the default vSphere datastore to use.": "The name of the default vSphere datastore to use.",
"The name of the placement rule should match the placement rule name in a placement binding so that it is bound to a policy or policy set. The placement rule name must be unique to the namespace.": "The name of the placement rule should match the placement rule name in a placement binding so that it is bound to a policy or policy set. The placement rule name must be unique to the namespace.",
Expand All @@ -2879,7 +2880,6 @@
"The name of the vSphere cluster to use.": "The name of the vSphere cluster to use.",
"The name of the vSphere datacenter to use.": "The name of the vSphere datacenter to use.",
"The name or names of security standards the policy is related to. For example, National Institute of Standards and Technology (NIST) and Payment Card Industry (PCI).": "The name or names of security standards the policy is related to. For example, National Institute of Standards and Technology (NIST) and Payment Card Industry (PCI).",
"The namespace is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character \"-\" is also permitted, as long as it does not appear in the first or last position.": "The namespace is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character \"-\" is also permitted, as long as it does not appear in the first or last position.",
"The namespace on the hub cluster where the policy resources will be created.": "The namespace on the hub cluster where the policy resources will be created.",
"The OpenShift Gitops Operator is required on the hub cluster as well as all managed clusters you are targeting to create an application set pull model type.": "The OpenShift Gitops Operator is required on the hub cluster as well as all managed clusters you are targeting to create an application set pull model type.",
"The OpenShift GitOps Operator is required on the managed clusters to create an application set pull model type. Make sure the operator is installed on all managed clusters you are targeting.": "The OpenShift GitOps Operator is required on the managed clusters to create an application set pull model type. Make sure the operator is installed on all managed clusters you are targeting.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,11 @@ export default function CreateCluster(props: { infrastructureType: ClusterInfras
const dnsLabelRegex = new RegExp(VALID_DNS_LABEL)

if (!dnsLabelRegex.test(namespace) || namespace.length > 63) {
return t(
'The namespace is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character "-" is also permitted, as long as it does not appear in the first or last position.'
)
return t('namespace.invalid.dns.label')
}

if (!dnsLabelRegex.test(name) || name.length > 63) {
return t(
'The name is invalid. The value must be a valid DNS label that consists of up to 63 lowercase alphanumeric characters. The character "-" is also permitted, as long as it does not appear in the first or last position.'
)
return t('name.invalid.dns.label')
}

return undefined
Expand Down

0 comments on commit 52c80bf

Please sign in to comment.