1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 07:15:23 +02:00

chore(data-cy): require data-cy attributes [EE-6880] (#11453)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run

This commit is contained in:
Ali 2024-04-11 12:11:38 +12:00 committed by GitHub
parent 3cad13388c
commit d38085a560
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
538 changed files with 2571 additions and 595 deletions

View file

@ -9,7 +9,7 @@
<div class="form-group">
<label for="service_name" class="col-sm-2 control-label text-left">Name</label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="formValues.Name" id="service_name" placeholder="e.g. myService" />
<input type="text" class="form-control" ng-model="formValues.Name" id="service_name" placeholder="e.g. myService" data-cy="service-name-input" />
</div>
</div>
<!-- !name-input -->
@ -42,7 +42,7 @@
<div>
<label class="control-label col-sm-2 text-left"> Replicas </label>
<div class="col-sm-8">
<input type="number" class="form-control" ng-model="formValues.Replicas" id="replicas" placeholder="e.g. 3" />
<input type="number" class="form-control" ng-model="formValues.Replicas" id="replicas" placeholder="e.g. 3" data-cy="docker-service-create-replica-count-input" />
</div>
</div>
</div>
@ -59,7 +59,7 @@
<!-- host-port -->
<div class="input-group col-sm-3 input-group-sm">
<span class="input-group-addon">host</span>
<input type="text" class="form-control" ng-model="portBinding.PublishedPort" placeholder="e.g. 80 or 1.2.3.4:80 (optional)" />
<input type="text" class="form-control" ng-model="portBinding.PublishedPort" placeholder="e.g. 80 or 1.2.3.4:80 (optional)" data-cy="host-port-input" />
</div>
<!-- !host-port -->
<span style="margin: 0 10px 0 10px">
@ -68,7 +68,7 @@
<!-- container-port -->
<div class="input-group col-sm-3 input-group-sm">
<span class="input-group-addon">container</span>
<input type="text" class="form-control" ng-model="portBinding.TargetPort" placeholder="e.g. 80" />
<input type="text" class="form-control" ng-model="portBinding.TargetPort" placeholder="e.g. 80" data-cy="container-port-input" />
</div>
<!-- !container-port -->
<!-- protocol-actions -->
@ -159,7 +159,14 @@
<div class="form-group">
<label for="service_command" class="col-sm-2 col-lg-1 control-label text-left">Command</label>
<div class="col-sm-9">
<input type="text" class="form-control" ng-model="formValues.Command" id="service_command" placeholder="e.g. /usr/bin/nginx -t -c /mynginx.conf" />
<input
type="text"
class="form-control"
ng-model="formValues.Command"
id="service_command"
placeholder="e.g. /usr/bin/nginx -t -c /mynginx.conf"
data-cy="service-command-input"
/>
</div>
</div>
<!-- !command-input -->
@ -167,7 +174,14 @@
<div class="form-group">
<label for="service_entrypoint" class="col-sm-2 col-lg-1 control-label text-left">Entrypoint</label>
<div class="col-sm-9">
<input type="text" class="form-control" ng-model="formValues.EntryPoint" id="service_entrypoint" placeholder="e.g. /bin/sh -c" />
<input
type="text"
class="form-control"
ng-model="formValues.EntryPoint"
id="service_entrypoint"
placeholder="e.g. /bin/sh -c"
data-cy="service-entrypoint-input"
/>
</div>
</div>
<!-- !entrypoint-input -->
@ -175,11 +189,11 @@
<div class="form-group">
<label for="service_workingdir" class="col-sm-2 col-lg-1 control-label text-left">Working Dir</label>
<div class="col-sm-4">
<input type="text" class="form-control" ng-model="formValues.WorkingDir" id="service_workingdir" placeholder="e.g. /myapp" />
<input type="text" class="form-control" ng-model="formValues.WorkingDir" id="service_workingdir" placeholder="e.g. /myapp" data-cy="service-workingdir-input" />
</div>
<label for="service_user" class="col-sm-1 control-label text-left">User</label>
<div class="col-sm-4">
<input type="text" class="form-control" ng-model="formValues.User" id="service_user" placeholder="e.g. nginx" />
<input type="text" class="form-control" ng-model="formValues.User" id="service_user" placeholder="e.g. nginx" data-cy="service-user-input" />
</div>
</div>
<!-- !workdir-user-input -->
@ -188,7 +202,7 @@
<div class="form-group">
<label for="log-driver" class="col-sm-2 col-lg-1 control-label text-left">Driver</label>
<div class="col-sm-4">
<select class="form-control" ng-model="formValues.LogDriverName" id="log-driver">
<select class="form-control" ng-model="formValues.LogDriverName" id="log-driver" data-cy="service-creation-logging-driver">
<option selected value="">Default logging driver</option>
<option ng-repeat="driver in availableLoggingDrivers" ng-value="driver">{{ driver }}</option>
<option value="none">none</option>
@ -226,11 +240,11 @@
<div ng-repeat="opt in formValues.LogDriverOpts" class="mt-1">
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">option</span>
<input type="text" class="form-control" ng-model="opt.name" placeholder="e.g. FOO" />
<input type="text" class="form-control" ng-model="opt.name" placeholder="e.g. FOO" data-cy="service-creation-logging-driver-option" />
</div>
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="opt.value" placeholder="e.g. bar" />
<input type="text" class="form-control" ng-model="opt.value" placeholder="e.g. bar" data-cy="service-creation-logging-driver-option-value" />
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removeLogDriverOpt($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>
@ -264,7 +278,13 @@
<div class="input-group col-sm-6">
<div class="input-group input-group-sm w-full">
<span class="input-group-addon">container</span>
<input type="text" class="form-control" ng-model="volume.Target" placeholder="e.g. /path/in/container" />
<input
type="text"
class="form-control"
ng-model="volume.Target"
placeholder="e.g. /path/in/container"
data-cy="service-creation-volume-container-path"
/>
</div>
<div class="small text-warning" ng-show="!volume.Target"> <pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon> Target is required. </div>
</div>
@ -295,6 +315,7 @@
class="form-control"
ng-model="volume.Source"
ng-options="vol as ((vol.Id|truncate:30) + ' - ' + (vol.Driver|truncate:30)) for vol in availableVolumes"
data-cy="volume-source-select"
>
<option selected disabled value="">Select a volume</option>
</select>
@ -306,7 +327,7 @@
<div class="input-group input-group-sm col-sm-6" ng-if="volume.Type === 'bind'">
<div class="input-group input-group-sm w-full">
<span class="input-group-addon">host</span>
<input type="text" class="form-control" ng-model="volume.Source" placeholder="e.g. /path/on/host" />
<input type="text" class="form-control" ng-model="volume.Source" placeholder="e.g. /path/on/host" data-cy="service-creation-volume-host-path" />
</div>
<div class="small text-warning" ng-show="!volume.Source"> <pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon> Source is required. </div>
</div>
@ -337,7 +358,7 @@
<div class="form-group">
<label for="container_network" class="col-sm-2 col-lg-1 control-label text-left">Network</label>
<div class="col-sm-9">
<select class="form-control" ng-model="formValues.Network">
<select class="form-control" ng-model="formValues.Network" data-cy="create-service-network-select">
<option selected disabled hidden value="">Select a network</option>
<option ng-repeat="net in availableNetworks | orderBy: 'Name'" ng-value="net.Name">{{ net.Name }}</option>
</select>
@ -356,7 +377,7 @@
<!-- network-input-list -->
<div class="col-sm-12 form-inline" style="margin-top: 10px">
<div ng-repeat="network in formValues.ExtraNetworks" style="margin-top: 2px">
<select class="form-control" ng-model="network.Name">
<select class="form-control" ng-model="network.Name" data-cy="create-service-extra-network-select-{{ $index }}">
<option selected disabled hidden value="">Select a network</option>
<option ng-repeat="net in availableNetworks" ng-value="net.Name">{{ net.Name }}</option>
</select>
@ -381,7 +402,7 @@
<div ng-repeat="variable in formValues.HostsEntries" style="margin-top: 2px">
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. host:IP" />
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. host:IP" data-cy="service-creation-hosts-entry" />
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removeHostsEntry($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>
@ -421,11 +442,11 @@
<div ng-repeat="label in formValues.Labels" style="margin-top: 2px">
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">name</span>
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" />
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" data-cy="service-creation-label" />
</div>
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" />
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" data-cy="service-creation-label-value" />
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removeLabel($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>
@ -448,11 +469,11 @@
<div ng-repeat="label in formValues.ContainerLabels" style="margin-top: 2px">
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">name</span>
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" />
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" data-cy="service-creation-container-label" />
</div>
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" />
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" data-cy="service-creation-container-label-value" />
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removeContainerLabel($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>

View file

@ -14,7 +14,13 @@
<div ng-repeat="config in formValues.Configs" style="margin-top: 2px">
<div class="input-group col-sm-4 input-group-sm">
<span class="input-group-addon">config</span>
<select class="form-control" ng-change="checkIfConfigDuplicated()" ng-model="config.model" ng-options="config.Name for config in availableConfigs | orderBy: 'Name'">
<select
class="form-control"
ng-change="checkIfConfigDuplicated()"
ng-model="config.model"
ng-options="config.Name for config in availableConfigs | orderBy: 'Name'"
data-cy="docker-stack-configs-select"
>
<option value="" selected="selected">Select a config</option>
</select>
</div>

View file

@ -4,10 +4,17 @@
<div class="form-group">
<label for="memory-reservation" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px"> Memory reservation </label>
<div class="col-sm-3">
<slider model="formValues.MemoryReservation" floor="0" ceil="state.sliderMaxMemory" step="256" ng-if="state.sliderMaxMemory"></slider>
<slider
model="formValues.MemoryReservation"
floor="0"
ceil="state.sliderMaxMemory"
step="256"
ng-if="state.sliderMaxMemory"
data-cy="docker-services-create-memory-reservation-slider"
></slider>
</div>
<div class="col-sm-2">
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryReservation" />
<input type="number" data-cy="docker-services-create-memory-reservation-input" min="0" class="form-control" ng-model="formValues.MemoryReservation" />
</div>
<div class="col-sm-4">
<p class="small text-muted" style="margin-top: 7px"> Minimum memory available on a node to run a task (<b>MB</b>) </p>
@ -18,10 +25,17 @@
<div class="form-group">
<label for="memory-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px"> Memory limit </label>
<div class="col-sm-3">
<slider model="formValues.MemoryLimit" floor="0" ceil="state.sliderMaxMemory" step="256" ng-if="state.sliderMaxMemory"></slider>
<slider
model="formValues.MemoryLimit"
floor="0"
ceil="state.sliderMaxMemory"
step="256"
ng-if="state.sliderMaxMemory"
data-cy="docker-services-create-memory-limit-slider"
></slider>
</div>
<div class="col-sm-2">
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryLimit" />
<input type="number" data-cy="docker-services-create-memory-limit-input" min="0" class="form-control" ng-model="formValues.MemoryLimit" />
</div>
<div class="col-sm-4" style="margin-top: 7px">
<p class="small text-muted"> Maximum memory usage per task (<b>MB</b>) </p>
@ -32,7 +46,15 @@
<div class="form-group">
<label for="cpu-reservation" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px"> CPU reservation </label>
<div class="col-sm-5">
<slider model="formValues.CpuReservation" floor="0" ceil="state.sliderMaxCpu" step="0.25" precision="2" ng-if="state.sliderMaxCpu"></slider>
<slider
model="formValues.CpuReservation"
floor="0"
ceil="state.sliderMaxCpu"
step="0.25"
precision="2"
ng-if="state.sliderMaxCpu"
data-cy="docker-services-create-cpu-reservation-slider"
></slider>
</div>
<div class="col-sm-4" style="margin-top: 20px">
<p class="small text-muted"> Minimum CPU available on a node to run a task </p>
@ -43,7 +65,15 @@
<div class="form-group">
<label for="cpu-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px"> CPU limit </label>
<div class="col-sm-5">
<slider model="formValues.CpuLimit" floor="0" ceil="state.sliderMaxCpu" step="0.25" precision="2" ng-if="state.sliderMaxCpu"></slider>
<slider
model="formValues.CpuLimit"
floor="0"
ceil="state.sliderMaxCpu"
step="0.25"
precision="2"
ng-if="state.sliderMaxCpu"
data-cy="docker-services-create-cpu-limit-slider"
></slider>
</div>
<div class="col-sm-4" style="margin-top: 20px">
<p class="small text-muted"> Maximum CPU usage per task </p>
@ -63,17 +93,17 @@
<div ng-repeat="constraint in formValues.PlacementConstraints" style="margin-top: 2px">
<div class="input-group col-sm-4 input-group-sm">
<span class="input-group-addon">name</span>
<input type="text" class="form-control" ng-model="constraint.key" placeholder="e.g. node.role" />
<input type="text" class="form-control" ng-model="constraint.key" placeholder="e.g. node.role" data-cy="docker-services-create-placement-constraint-name-{{ $index }}" />
</div>
<div class="input-group col-sm-1 input-group-sm">
<select name="constraintOperator" class="form-control" ng-model="constraint.operator">
<select name="constraintOperator" class="form-control" ng-model="constraint.operator" data-cy="docker-services-create-placement-constraint-operator-">
<option value="==">==</option>
<option value="!=">!=</option>
</select>
</div>
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="constraint.value" placeholder="e.g. manager" />
<input type="text" class="form-control" ng-model="constraint.value" placeholder="e.g. manager" data-cy="docker-services-create-placement-constraint-value-{{ $index }}" />
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removePlacementConstraint($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>
@ -94,11 +124,23 @@
<div ng-repeat="preference in formValues.PlacementPreferences" style="margin-top: 2px">
<div class="input-group col-sm-4 input-group-sm">
<span class="input-group-addon">strategy</span>
<input type="text" class="form-control" ng-model="preference.strategy" placeholder="e.g. spread" />
<input
type="text"
class="form-control"
ng-model="preference.strategy"
placeholder="e.g. spread"
data-cy="docker-services-create-placement-preference-strategy-{{ $index }}"
/>
</div>
<div class="input-group col-sm-5 input-group-sm">
<span class="input-group-addon">value</span>
<input type="text" class="form-control" ng-model="preference.value" placeholder="e.g. node.labels.datacenter" />
<input
type="text"
class="form-control"
ng-model="preference.value"
placeholder="e.g. node.labels.datacenter"
data-cy="docker-services-create-placement-preference-value-{{ $index }}"
/>
</div>
<button class="btn btn-dangerlight" type="button" ng-click="removePlacementPreference($index)">
<pr-icon icon="'trash-2'" size="'md'"></pr-icon>

View file

@ -20,7 +20,13 @@
<div ng-repeat="secret in formValues.Secrets track by $index" style="margin-top: 4px">
<div class="input-group col-sm-4 input-group-sm">
<span class="input-group-addon">secret</span>
<select class="form-control" ng-model="secret.model" ng-change="checkIfSecretDuplicated()" ng-options="secret.Name for secret in availableSecrets | orderBy: 'Name'">
<select
class="form-control"
ng-model="secret.model"
ng-change="checkIfSecretDuplicated()"
ng-options="secret.Name for secret in availableSecrets | orderBy: 'Name'"
data-cy="docker-stack-secrets-select"
>
<option value="" selected="selected">Select a secret</option>
</select>
</div>

View file

@ -4,7 +4,7 @@
<div class="form-group">
<label for="parallelism" class="col-sm-3 col-lg-2 control-label text-left">Update parallelism</label>
<div class="col-sm-4 col-lg-3">
<input type="number" class="form-control" ng-model="formValues.Parallelism" id="parallelism" placeholder="e.g. 1" />
<input type="number" data-cy="docker-service-update-parallelism-input" class="form-control" ng-model="formValues.Parallelism" id="parallelism" placeholder="e.g. 1" />
</div>
<div class="col-sm-5">
<p class="small text-muted"> Maximum number of tasks to be updated simultaneously (0 to update all at once). </p>
@ -18,7 +18,15 @@
<portainer-tooltip message="'Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns.'"></portainer-tooltip>
</label>
<div class="col-sm-4 col-lg-3">
<input type="text" class="form-control" ng-model="formValues.UpdateDelay" id="update-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
<input
type="text"
class="form-control"
ng-model="formValues.UpdateDelay"
id="update-delay"
placeholder="e.g. 1m"
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
data-cy="docker-service-update-delay-input"
/>
</div>
<div class="col-sm-5">
<p class="small text-muted"> Amount of time between updates expressed by a number followed by unit (ns|us|ms|s|m|h). Default value is 0s, 0 seconds. </p>
@ -77,7 +85,15 @@
<portainer-tooltip message="'Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns.'"></portainer-tooltip>
</label>
<div class="col-sm-4 col-lg-3">
<input type="text" class="form-control" ng-model="formValues.RestartDelay" id="restart-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
<input
type="text"
class="form-control"
ng-model="formValues.RestartDelay"
id="restart-delay"
placeholder="e.g. 1m"
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
data-cy="docker-service-restart-delay-input"
/>
</div>
<div class="col-sm-5">
<p class="small text-muted"> Delay between restart attempts expressed by a number followed by unit (ns|us|ms|s|m|h). Default value is 5s, 5 seconds. </p>
@ -88,7 +104,14 @@
<div class="form-group">
<label for="restart-max-attempts" class="col-sm-3 col-lg-2 control-label text-left">Restart max attempts</label>
<div class="col-sm-4 col-lg-3">
<input type="number" class="form-control" ng-model="formValues.RestartMaxAttempts" id="restart-max-attempts" placeholder="e.g. 0" />
<input
type="number"
data-cy="docker-service-restart-max-attempts-input"
class="form-control"
ng-model="formValues.RestartMaxAttempts"
id="restart-max-attempts"
placeholder="e.g. 0"
/>
</div>
<div class="col-sm-5">
<p class="small text-muted"> Maximum attempts to restart a given task before giving up (default value is 0, which means unlimited). </p>
@ -102,7 +125,15 @@
<portainer-tooltip message="'Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns.'"></portainer-tooltip>
</label>
<div class="col-sm-4 col-lg-3">
<input type="text" class="form-control" ng-model="formValues.RestartWindow" id="restart-window" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
<input
type="text"
class="form-control"
ng-model="formValues.RestartWindow"
id="restart-window"
placeholder="e.g. 1m"
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
data-cy="docker-service-restart-window-input"
/>
</div>
<div class="col-sm-5">
<p class="small text-muted">