mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
refactor(app): migrate app summary section [EE-6239] (#10910)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (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:arm64 platform:linux]) (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
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (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:arm64 platform:linux]) (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:
parent
7a4314032a
commit
abf517de28
61 changed files with 1461 additions and 661 deletions
|
@ -1,14 +1,14 @@
|
|||
import { Box, Boxes } from 'lucide-react';
|
||||
|
||||
import { KubernetesApplicationDataAccessPolicies } from '@/kubernetes/models/application/models';
|
||||
|
||||
import { BoxSelector, BoxSelectorOption } from '@@/BoxSelector';
|
||||
|
||||
import { AppDataAccessPolicy } from '../types';
|
||||
|
||||
interface Props {
|
||||
isEdit: boolean;
|
||||
persistedFoldersUseExistingVolumes: boolean;
|
||||
value: number;
|
||||
onChange(value: number): void;
|
||||
value: AppDataAccessPolicy;
|
||||
onChange(value: AppDataAccessPolicy): void;
|
||||
}
|
||||
|
||||
export function DataAccessPolicyFormSection({
|
||||
|
@ -31,13 +31,13 @@ export function DataAccessPolicyFormSection({
|
|||
}
|
||||
|
||||
function getOptions(
|
||||
value: number,
|
||||
value: AppDataAccessPolicy,
|
||||
isEdit: boolean,
|
||||
persistedFoldersUseExistingVolumes: boolean
|
||||
): ReadonlyArray<BoxSelectorOption<number>> {
|
||||
): ReadonlyArray<BoxSelectorOption<AppDataAccessPolicy>> {
|
||||
return [
|
||||
{
|
||||
value: KubernetesApplicationDataAccessPolicies.ISOLATED,
|
||||
value: 'Isolated',
|
||||
id: 'data_access_isolated',
|
||||
icon: Boxes,
|
||||
iconType: 'badge',
|
||||
|
@ -49,12 +49,10 @@ function getOptions(
|
|||
? 'Changing the data access policy is not allowed'
|
||||
: '',
|
||||
disabled: () =>
|
||||
(isEdit &&
|
||||
value !== KubernetesApplicationDataAccessPolicies.ISOLATED) ||
|
||||
persistedFoldersUseExistingVolumes,
|
||||
(isEdit && value !== 'Isolated') || persistedFoldersUseExistingVolumes,
|
||||
},
|
||||
{
|
||||
value: KubernetesApplicationDataAccessPolicies.SHARED,
|
||||
value: 'Shared',
|
||||
id: 'data_access_shared',
|
||||
icon: Box,
|
||||
iconType: 'badge',
|
||||
|
@ -63,8 +61,7 @@ function getOptions(
|
|||
'Application will be deployed as a Deployment with a shared storage access',
|
||||
tooltip: () =>
|
||||
isEdit ? 'Changing the data access policy is not allowed' : '',
|
||||
disabled: () =>
|
||||
isEdit && value !== KubernetesApplicationDataAccessPolicies.SHARED,
|
||||
disabled: () => isEdit && value !== 'Shared',
|
||||
},
|
||||
] as const;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue