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

fix(teasers): updated muted styles from qa feedback [EE-6035] (#10390)

* fix(teasers): updated muted styles from qa feedback [EE-6035]
This commit is contained in:
Ali 2023-09-28 11:32:58 +01:00 committed by GitHub
parent 99625cd35f
commit d678b155ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 290 additions and 303 deletions

View file

@ -11,6 +11,7 @@ import { Icon } from '@@/Icon';
import { confirm } from '@@/modals/confirm';
import { ModalType } from '@@/modals';
import { buildConfirmButton } from '@@/modals/utils';
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
import {
useApplicationRevisionList,
@ -60,27 +61,38 @@ export function RollbackApplicationButton({
appName
);
const isRollbackNotAvailable =
!app ||
!appRevisions ||
appRevisions?.length < 2 ||
appDeployMethod !== 'application form' ||
patchAppMutation.isLoading;
const rollbackButton = (
<Button
ng-if="!ctrl.isExternalApplication()"
type="button"
color="light"
size="small"
className="!ml-0"
disabled={isRollbackNotAvailable}
onClick={() => rollbackApplication()}
data-cy="k8sAppDetail-rollbackButton"
>
<Icon icon={RotateCcw} className="mr-1" />
Rollback to previous configuration
</Button>
);
return (
<Authorized authorizations="K8sApplicationDetailsW">
<Button
ng-if="!ctrl.isExternalApplication()"
type="button"
color="light"
size="small"
className="!ml-0"
disabled={
!app ||
!appRevisions ||
appRevisions?.length < 2 ||
appDeployMethod !== 'application form' ||
patchAppMutation.isLoading
}
onClick={() => rollbackApplication()}
data-cy="k8sAppDetail-rollbackButton"
>
<Icon icon={RotateCcw} className="mr-1" />
Rollback to previous configuration
</Button>
{isRollbackNotAvailable ? (
<TooltipWithChildren message="Cannot roll back to previous configuration as none currently exists">
<span>{rollbackButton}</span>
</TooltipWithChildren>
) : (
rollbackButton
)}
</Authorized>
);