1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +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

This commit is contained in:
Ali 2024-01-05 15:42:36 +13:00 committed by GitHub
parent 7a4314032a
commit abf517de28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 1461 additions and 661 deletions

View file

@ -5,15 +5,15 @@ import { TextTip } from '@@/Tip/TextTip';
import { Button } from '@@/buttons';
import { convertToArrayOfStrings, parseDotEnvFile } from './utils';
import { type Value } from './types';
import { type Values } from './types';
export function AdvancedMode({
value,
onChange,
onSimpleModeClick,
}: {
value: Value;
onChange: (value: Value) => void;
value: Values;
onChange: (value: Values) => void;
onSimpleModeClick: () => void;
}) {
const editorValue = convertToArrayOfStrings(value).join('\n');

View file

@ -6,7 +6,7 @@ import { buildUniquenessTest } from '../validate-unique';
import { AdvancedMode } from './AdvancedMode';
import { SimpleMode } from './SimpleMode';
import { Value } from './types';
import { Values } from './types';
export function EnvironmentVariablesFieldset({
onChange,
@ -14,9 +14,9 @@ export function EnvironmentVariablesFieldset({
errors,
canUndoDelete,
}: {
values: Value;
onChange(value: Value): void;
errors?: ArrayError<Value>;
values: Values;
onChange(value: Values): void;
errors?: ArrayError<Values>;
canUndoDelete?: boolean;
}) {
const [simpleMode, setSimpleMode] = useState(true);
@ -42,7 +42,7 @@ export function EnvironmentVariablesFieldset({
);
}
export function envVarValidation(): SchemaOf<Value> {
export function envVarValidation(): SchemaOf<Values> {
return array(
object({
name: string().required('Name is required'),

View file

@ -3,7 +3,7 @@ import { TextTip } from '@@/Tip/TextTip';
import { ArrayError } from '../InputList/InputList';
import { Value } from './types';
import { Values } from './types';
import { EnvironmentVariablesFieldset } from './EnvironmentVariablesFieldset';
export function EnvironmentVariablesPanel({
@ -15,10 +15,10 @@ export function EnvironmentVariablesPanel({
isFoldable = false,
}: {
explanation?: string;
values: Value;
onChange(value: Value): void;
values: Values;
onChange(value: Values): void;
showHelpMessage?: boolean;
errors?: ArrayError<Value>;
errors?: ArrayError<Values>;
isFoldable?: boolean;
}) {
return (

View file

@ -9,7 +9,7 @@ import { FileUploadField } from '@@/form-components/FileUpload';
import { InputList } from '@@/form-components/InputList';
import { ArrayError } from '@@/form-components/InputList/InputList';
import type { Value } from './types';
import type { Values } from './types';
import { parseDotEnvFile } from './utils';
import { EnvironmentVariableItem } from './EnvironmentVariableItem';
@ -20,10 +20,10 @@ export function SimpleMode({
errors,
canUndoDelete,
}: {
value: Value;
onChange: (value: Value) => void;
value: Values;
onChange: (value: Values) => void;
onAdvancedModeClick: () => void;
errors?: ArrayError<Value>;
errors?: ArrayError<Values>;
canUndoDelete?: boolean;
}) {
return (
@ -70,7 +70,7 @@ export function SimpleMode({
);
}
function FileEnv({ onChooseFile }: { onChooseFile: (file: Value) => void }) {
function FileEnv({ onChooseFile }: { onChooseFile: (file: Values) => void }) {
const [file, setFile] = useState<File | null>(null);
const fileTooBig = file && file.size > 1024 * 1024;

View file

@ -5,4 +5,4 @@ export {
export { EnvironmentVariablesPanel } from './EnvironmentVariablesPanel';
export { type Value as EnvVarValues } from './types';
export { type Values as EnvVarValues } from './types';

View file

@ -4,4 +4,4 @@ export interface EnvVar {
needsDeletion?: boolean;
}
export type Value = Array<EnvVar>;
export type Values = Array<EnvVar>;