mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(kube): add a11y props for smoke tests [EE-6747] (#11263)
This commit is contained in:
parent
42c2a52a6b
commit
6c70049ecc
26 changed files with 143 additions and 62 deletions
|
@ -40,7 +40,7 @@ export function StorageClassDatatable({ storageClassValues }: Props) {
|
|||
className="mr-2 mb-0"
|
||||
id={`kubeSetup-storageToggle${storageClassValue.Name}`}
|
||||
name={`kubeSetup-storageToggle${storageClassValue.Name}`}
|
||||
dataCy={`kubeSetup-storageToggle${storageClassValue.Name}`}
|
||||
data-cy={`kubeSetup-storageToggle${storageClassValue.Name}`}
|
||||
/>
|
||||
<span>{storageClassValue.Name}</span>
|
||||
</div>
|
||||
|
@ -69,7 +69,7 @@ export function StorageClassDatatable({ storageClassValues }: Props) {
|
|||
)
|
||||
}
|
||||
className="mr-2 mb-0"
|
||||
dataCy={`kubeSetup-storageExpansionToggle${storageClassValue.Name}`}
|
||||
data-cy={`kubeSetup-storageExpansionToggle${storageClassValue.Name}`}
|
||||
id={`kubeSetup-storageExpansionToggle${storageClassValue.Name}`}
|
||||
name={`kubeSetup-storageExpansionToggle${storageClassValue.Name}`}
|
||||
/>
|
||||
|
|
|
@ -11,10 +11,10 @@ import { Tooltip } from '@@/Tip/Tooltip';
|
|||
import { Button } from '@@/buttons';
|
||||
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
|
||||
import { TextTip } from '@@/Tip/TextTip';
|
||||
import { Card } from '@@/Card';
|
||||
import { InputGroup } from '@@/form-components/InputGroup';
|
||||
import { InlineLoader } from '@@/InlineLoader';
|
||||
import { Select } from '@@/form-components/ReactSelect';
|
||||
import { Card } from '@@/Card';
|
||||
import { InputGroup } from '@@/form-components/InputGroup';
|
||||
|
||||
import { AnnotationsForm } from '../../annotations/AnnotationsForm';
|
||||
|
||||
|
@ -399,9 +399,16 @@ export function IngressForm({
|
|||
<div className="row">
|
||||
<div className="form-group col-sm-6 col-lg-4 !pl-0 !pr-2">
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon required>Hostname</InputGroup.Addon>
|
||||
<InputGroup.Addon
|
||||
required
|
||||
as="label"
|
||||
htmlFor={`ingress_host_${hostIndex}`}
|
||||
>
|
||||
Hostname
|
||||
</InputGroup.Addon>
|
||||
<InputGroup.Input
|
||||
name={`ingress_host_${hostIndex}`}
|
||||
id={`ingress_host_${hostIndex}`}
|
||||
type="text"
|
||||
className="form-control form-control-sm"
|
||||
placeholder="e.g. example.com"
|
||||
|
@ -411,6 +418,7 @@ export function IngressForm({
|
|||
}
|
||||
/>
|
||||
</InputGroup>
|
||||
|
||||
{errors[`hosts[${hostIndex}].host`] && (
|
||||
<FormError className="!mb-0 mt-1">
|
||||
{errors[`hosts[${hostIndex}].host`]}
|
||||
|
@ -420,10 +428,17 @@ export function IngressForm({
|
|||
|
||||
<div className="form-group col-sm-6 col-lg-4 !pl-2 !pr-0">
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon>TLS secret</InputGroup.Addon>
|
||||
<InputGroup.Addon
|
||||
as="label"
|
||||
htmlFor={`ingress_tls_${hostIndex}`}
|
||||
>
|
||||
TLS secret
|
||||
</InputGroup.Addon>
|
||||
<Select
|
||||
key={tlsOptions.toString() + host.Secret}
|
||||
name={`ingress_tls_${hostIndex}`}
|
||||
inputId={`ingress_tls_${hostIndex}`}
|
||||
options={tlsOptions}
|
||||
value={
|
||||
host.Secret !== undefined
|
||||
? {
|
||||
|
@ -442,7 +457,6 @@ export function IngressForm({
|
|||
}
|
||||
noOptionsMessage={() => 'No TLS secrets available'}
|
||||
size="sm"
|
||||
options={tlsOptions}
|
||||
/>
|
||||
{!host.NoHost && (
|
||||
<div className="input-group-btn">
|
||||
|
@ -501,10 +515,17 @@ export function IngressForm({
|
|||
>
|
||||
<div className="form-group col-sm-3 col-xl-2 !m-0 !pl-0">
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon required>Service</InputGroup.Addon>
|
||||
<InputGroup.Addon
|
||||
required
|
||||
as="label"
|
||||
htmlFor={`ingress_service_${hostIndex}_${pathIndex}`}
|
||||
>
|
||||
Service
|
||||
</InputGroup.Addon>
|
||||
<Select
|
||||
key={serviceOptions.toString() + path.ServiceName}
|
||||
name={`ingress_service_${hostIndex}_${pathIndex}`}
|
||||
id={`ingress_service_${hostIndex}_${pathIndex}`}
|
||||
options={serviceOptions}
|
||||
value={
|
||||
path.ServiceName
|
||||
|
@ -551,12 +572,17 @@ export function IngressForm({
|
|||
{servicePorts && (
|
||||
<>
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon required>
|
||||
<InputGroup.Addon
|
||||
required
|
||||
as="label"
|
||||
htmlFor={`ingress_servicePort_${hostIndex}_${pathIndex}`}
|
||||
>
|
||||
Service port
|
||||
</InputGroup.Addon>
|
||||
<Select
|
||||
key={servicePorts.toString() + path.ServicePort}
|
||||
name={`ingress_servicePort_${hostIndex}_${pathIndex}`}
|
||||
id={`ingress_servicePort_${hostIndex}_${pathIndex}`}
|
||||
options={
|
||||
servicePorts[path.ServiceName]?.map(
|
||||
(portOption) => ({
|
||||
|
@ -607,10 +633,16 @@ export function IngressForm({
|
|||
|
||||
<div className="form-group col-sm-3 col-xl-2 !m-0 !pl-0">
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon>Path type</InputGroup.Addon>
|
||||
<Select<Option<string>>
|
||||
<InputGroup.Addon
|
||||
as="label"
|
||||
htmlFor={`ingress_pathType_${hostIndex}_${pathIndex}`}
|
||||
>
|
||||
Path type
|
||||
</InputGroup.Addon>
|
||||
<Select
|
||||
key={servicePorts.toString() + path.PathType}
|
||||
name={`ingress_pathType_${hostIndex}_${pathIndex}`}
|
||||
id={`ingress_pathType_${hostIndex}_${pathIndex}`}
|
||||
options={
|
||||
pathTypes?.map((type) => ({
|
||||
label: type,
|
||||
|
@ -657,10 +689,17 @@ export function IngressForm({
|
|||
|
||||
<div className="form-group col-sm-3 col-xl-3 !m-0 !pl-0">
|
||||
<InputGroup size="small">
|
||||
<InputGroup.Addon required>Path</InputGroup.Addon>
|
||||
<InputGroup.Addon
|
||||
required
|
||||
as="label"
|
||||
htmlFor={`ingress_route_${hostIndex}-${pathIndex}`}
|
||||
>
|
||||
Path
|
||||
</InputGroup.Addon>
|
||||
<InputGroup.Input
|
||||
className="form-control"
|
||||
name={`ingress_route_${hostIndex}-${pathIndex}`}
|
||||
id={`ingress_route_${hostIndex}-${pathIndex}`}
|
||||
placeholder="/example"
|
||||
data-pattern="/^(\/?[a-zA-Z0-9]+([a-zA-Z0-9-/_]*[a-zA-Z0-9])?|[a-zA-Z0-9]+)|(\/){1}$/"
|
||||
data-cy={`k8sAppCreate-route_${hostIndex}-${pathIndex}`}
|
||||
|
|
|
@ -13,7 +13,7 @@ export function LoadBalancerFormSection() {
|
|||
disable the use of load balancers in this namespace.
|
||||
</TextTip>
|
||||
<SwitchField
|
||||
dataCy="k8sNamespaceCreate-loadBalancerQuotaToggle"
|
||||
data-cy="k8sNamespaceCreate-loadBalancerQuotaToggle"
|
||||
label="Load balancer quota"
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
fieldClass="pt-2"
|
||||
|
|
|
@ -81,16 +81,19 @@ export function ResourceQuotaFormSection({
|
|||
inputId="memory-limit"
|
||||
>
|
||||
<div className="col-xs-8">
|
||||
<SliderWithInput
|
||||
value={Number(values.memory) ?? 0}
|
||||
onChange={(value) =>
|
||||
onChange({ ...values, memory: `${value}` })
|
||||
}
|
||||
max={memoryLimit}
|
||||
step={128}
|
||||
dataCy="k8sNamespaceCreate-memoryLimit"
|
||||
visibleTooltip
|
||||
/>
|
||||
{memoryLimit >= 0 && (
|
||||
<SliderWithInput
|
||||
value={Number(values.memory) ?? 0}
|
||||
onChange={(value) =>
|
||||
onChange({ ...values, memory: `${value}` })
|
||||
}
|
||||
max={memoryLimit}
|
||||
step={128}
|
||||
dataCy="k8sNamespaceCreate-memoryLimit"
|
||||
visibleTooltip
|
||||
inputId="memory-limit"
|
||||
/>
|
||||
)}
|
||||
{errors?.memory && (
|
||||
<FormError className="pt-1">{errors.memory}</FormError>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue