mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 15:55:23 +02:00
refactor(ui/button): remove duplicate data-cy
This commit is contained in:
parent
76e49ed9a8
commit
b95bb06535
12 changed files with 4 additions and 14 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<TasProps>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ButtonWithRef = forwardRef<HTMLButtonElement, Omit<Props, 'mRef'>>(
|
export const ButtonWithRef = forwardRef<HTMLButtonElement, Omit<Props, 'mRef'>>(
|
||||||
|
|
|
@ -173,7 +173,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}`}
|
||||||
|
|
|
@ -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}`}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue