mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(ui/button): remove duplicate data-cy [EE-7242] (#11934)
Some checks failed
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
Some checks failed
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
This commit is contained in:
parent
9994ed157a
commit
607feb183e
15 changed files with 9 additions and 21 deletions
|
@ -25,9 +25,8 @@ export function LinkButton({
|
||||||
props={{
|
props={{
|
||||||
to,
|
to,
|
||||||
params,
|
params,
|
||||||
'data-cy': `${dataCy}-link`,
|
|
||||||
}}
|
}}
|
||||||
data-cy={`${dataCy}-button`}
|
data-cy={dataCy}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -25,10 +25,10 @@ export function AddButton({
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
as={Link}
|
as={Link}
|
||||||
props={{ to, params, 'data-cy': `${dataCy}-link` }}
|
props={{ to, params }}
|
||||||
icon={Plus}
|
icon={Plus}
|
||||||
className="!m-0"
|
className="!m-0"
|
||||||
data-cy={`${dataCy}-button`}
|
data-cy={dataCy}
|
||||||
color={color}
|
color={color}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
|
|
|
@ -41,7 +41,7 @@ export interface Props<TasProps = unknown>
|
||||||
as?: ComponentType<TasProps> | string;
|
as?: ComponentType<TasProps> | string;
|
||||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||||
mRef?: React.ForwardedRef<HTMLButtonElement>;
|
mRef?: React.ForwardedRef<HTMLButtonElement>;
|
||||||
props?: TasProps;
|
props?: Omit<TasProps, keyof Props>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ButtonWithRef = forwardRef<HTMLButtonElement, Omit<Props, 'mRef'>>(
|
export const ButtonWithRef = forwardRef<HTMLButtonElement, Omit<Props, 'mRef'>>(
|
||||||
|
|
|
@ -13,7 +13,6 @@ export function ClusterVisualizerLink() {
|
||||||
icon={TrelloIcon}
|
icon={TrelloIcon}
|
||||||
props={{
|
props={{
|
||||||
to: 'docker.swarm.visualizer',
|
to: 'docker.swarm.visualizer',
|
||||||
'data-cy': 'cluster-visualizer',
|
|
||||||
}}
|
}}
|
||||||
data-cy="cluster-visualizer"
|
data-cy="cluster-visualizer"
|
||||||
>
|
>
|
||||||
|
|
|
@ -181,7 +181,6 @@ function ImportExportButtons({
|
||||||
disabled={isExportInProgress}
|
disabled={isExportInProgress}
|
||||||
props={{
|
props={{
|
||||||
to: 'docker.images.import',
|
to: 'docker.images.import',
|
||||||
'data-cy': 'image-importImageLink',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Import
|
Import
|
||||||
|
|
|
@ -103,7 +103,6 @@ function Cell({
|
||||||
id: item.Id,
|
id: item.Id,
|
||||||
nodeName: item.NodeName,
|
nodeName: item.NodeName,
|
||||||
},
|
},
|
||||||
'data-cy': `volume-browse-link-${name}`,
|
|
||||||
}}
|
}}
|
||||||
data-cy={`volume-browse-button-${name}`}
|
data-cy={`volume-browse-button-${name}`}
|
||||||
>
|
>
|
||||||
|
|
|
@ -37,7 +37,6 @@ function Cell({
|
||||||
props={{
|
props={{
|
||||||
to: 'kubernetes.resourcePools.resourcePool.access',
|
to: 'kubernetes.resourcePools.resourcePool.access',
|
||||||
params: { id: item.Namespace.Name },
|
params: { id: item.Namespace.Name },
|
||||||
'data-cy': `manage-access-link-${item.Namespace.Name}`,
|
|
||||||
}}
|
}}
|
||||||
icon={Users}
|
icon={Users}
|
||||||
data-cy={`manage-access-button-${item.Namespace.Name}`}
|
data-cy={`manage-access-button-${item.Namespace.Name}`}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import { useRouter } from '@uirouter/react';
|
|
||||||
|
|
||||||
import { Button, CopyButton } from '@@/buttons';
|
import { Button, CopyButton } from '@@/buttons';
|
||||||
import { FormSectionTitle } from '@@/form-components/FormSectionTitle';
|
import { FormSectionTitle } from '@@/form-components/FormSectionTitle';
|
||||||
import { TextTip } from '@@/Tip/TextTip';
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
import { Link } from '@@/Link';
|
||||||
|
|
||||||
export function DisplayUserAccessToken({ apikey }: { apikey: string }) {
|
export function DisplayUserAccessToken({ apikey }: { apikey: string }) {
|
||||||
const router = useRouter();
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FormSectionTitle>New access token</FormSectionTitle>
|
<FormSectionTitle>New access token</FormSectionTitle>
|
||||||
|
@ -27,9 +25,11 @@ export function DisplayUserAccessToken({ apikey }: { apikey: string }) {
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
as={Link}
|
||||||
|
props={{
|
||||||
|
to: 'portainer.account',
|
||||||
|
}}
|
||||||
data-cy="create-access-token-done-button"
|
data-cy="create-access-token-done-button"
|
||||||
onClick={() => router.stateService.go('portainer.account')}
|
|
||||||
>
|
>
|
||||||
Done
|
Done
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -31,7 +31,6 @@ function Cell({
|
||||||
props={{
|
props={{
|
||||||
to: 'portainer.endpoints.endpoint.access',
|
to: 'portainer.endpoints.endpoint.access',
|
||||||
params: { id: environment.Id },
|
params: { id: environment.Id },
|
||||||
'data-cy': `environment-manage-access-${environment.Name}`,
|
|
||||||
}}
|
}}
|
||||||
color="link"
|
color="link"
|
||||||
icon={Users}
|
icon={Users}
|
||||||
|
|
|
@ -26,7 +26,6 @@ function ActionsCell({
|
||||||
props={{
|
props={{
|
||||||
to: '.group.access',
|
to: '.group.access',
|
||||||
params: { id: item.Id },
|
params: { id: item.Id },
|
||||||
'data-cy': `manage-access-link_${item.Name}`,
|
|
||||||
}}
|
}}
|
||||||
color="link"
|
color="link"
|
||||||
icon={Users}
|
icon={Users}
|
||||||
|
|
|
@ -57,7 +57,6 @@ export function BrowseButton({
|
||||||
props={{
|
props={{
|
||||||
to: 'portainer.registries.registry.repositories',
|
to: 'portainer.registries.registry.repositories',
|
||||||
params: { id: registry.Id, endpointId: environmentId },
|
params: { id: registry.Id, endpointId: environmentId },
|
||||||
'data-cy': `browse-registry-link-${registry.Name}`,
|
|
||||||
}}
|
}}
|
||||||
disabled={isLimited}
|
disabled={isLimited}
|
||||||
icon={Search}
|
icon={Search}
|
||||||
|
|
|
@ -43,7 +43,6 @@ function Cell({
|
||||||
props={{
|
props={{
|
||||||
to: '.access',
|
to: '.access',
|
||||||
params: { id: item.Id },
|
params: { id: item.Id },
|
||||||
'data-cy': `manage-access-link-${item.Name}`,
|
|
||||||
}}
|
}}
|
||||||
data-cy={`registry-manage-access-button-${item.Name}`}
|
data-cy={`registry-manage-access-button-${item.Name}`}
|
||||||
>
|
>
|
||||||
|
|
|
@ -46,7 +46,6 @@ export function AppTemplatesListItem({
|
||||||
appTemplateId: template.Id,
|
appTemplateId: template.Id,
|
||||||
type: duplicateCustomTemplateType,
|
type: duplicateCustomTemplateType,
|
||||||
},
|
},
|
||||||
'data-cy': `app-templates-duplicate-${template.Name}`,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Copy as Custom
|
Copy as Custom
|
||||||
|
|
|
@ -54,7 +54,6 @@ export function CustomTemplatesListItem({
|
||||||
params: {
|
params: {
|
||||||
id: template.Id,
|
id: template.Id,
|
||||||
},
|
},
|
||||||
'data-cy': `custom-templates-edit-link-${template.Id}`,
|
|
||||||
}}
|
}}
|
||||||
icon={Edit}
|
icon={Edit}
|
||||||
data-cy={`custom-templates-edit-button-${template.Id}`}
|
data-cy={`custom-templates-edit-button-${template.Id}`}
|
||||||
|
|
|
@ -159,7 +159,6 @@ export function DeployForm({
|
||||||
as={Link}
|
as={Link}
|
||||||
props={{
|
props={{
|
||||||
to: '.',
|
to: '.',
|
||||||
'data-cy': 'cancel-stack-creation',
|
|
||||||
params: { template: null },
|
params: { template: null },
|
||||||
}}
|
}}
|
||||||
color="default"
|
color="default"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue