Skip to content

Commit f220ad6

Browse files
authored
Merge pull request #15 from Ratio1/secondary-plugins
Add multiple secondary plugins to a native job
2 parents eb17e5b + 4f80d24 commit f220ad6

File tree

17 files changed

+480
-219
lines changed

17 files changed

+480
-219
lines changed

src/components/create-job/cards/SecondaryPluginsCard.tsx

Lines changed: 0 additions & 148 deletions
This file was deleted.

src/components/create-job/cards/CARInputsSection.tsx renamed to src/components/create-job/secondary-plugins/CARInputsSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import ContainerSection from '@shared/jobs/deployment-type/ContainerSection';
2-
import SecondaryPluginSection from './SecondaryPluginSection';
2+
import GenericSecondaryPluginSections from './GenericSecondaryPluginSections';
33

44
export default function CARInputsSection({ index }: { index: number }) {
55
const name = `deployment.secondaryPlugins.${index}`;
66

77
return (
88
<div className="col gap-4">
99
<ContainerSection baseName={name} />
10-
<SecondaryPluginSection name={name} />
10+
<GenericSecondaryPluginSections name={name} />
1111
</div>
1212
);
1313
}

src/components/create-job/cards/SecondaryPluginSection.tsx renamed to src/components/create-job/secondary-plugins/GenericSecondaryPluginSections.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import AppParametersSection from '../sections/AppParametersSection';
66
import PluginEnvVariablesSection from '../sections/PluginEnvVariablesSection';
77
import PoliciesSection from '../sections/PoliciesSection';
88

9-
export default function SecondaryPluginSection({ name }: { name: string }) {
9+
export default function GenericSecondaryPluginSections({ name }: { name: string }) {
1010
return (
1111
<>
1212
<ConfigSectionTitle title="App Parameters" />
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import ConfigSectionTitle from '@components/job/config/ConfigSectionTitle';
2+
import { pluginSignaturesCustomParams } from '@data/default-values/customParams';
3+
import { PLUGIN_SIGNATURE_TYPES } from '@data/pluginSignatureTypes';
4+
import KeyValueEntriesSection from '@shared/jobs/KeyValueEntriesSection';
5+
import NativeAppIdentitySection from '@shared/jobs/native/NativeAppIdentitySection';
6+
import { useFormContext } from 'react-hook-form';
7+
import AppParametersSection from '../sections/AppParametersSection';
8+
9+
export default function NativeInputsSection({ index }: { index: number }) {
10+
const name = `deployment.secondaryPlugins.${index}`;
11+
12+
const { watch } = useFormContext();
13+
14+
const pluginSignature: (typeof PLUGIN_SIGNATURE_TYPES)[number] = watch(`${name}.pluginSignature`);
15+
16+
return (
17+
<div className="col gap-4">
18+
<NativeAppIdentitySection pluginSignature={pluginSignature} baseName={name} />
19+
20+
<ConfigSectionTitle title="App Parameters" />
21+
<AppParametersSection baseName={name} />
22+
23+
<ConfigSectionTitle title="Custom Parameters" />
24+
<KeyValueEntriesSection
25+
name={`${name}.customParams`}
26+
displayLabel="custom parameters"
27+
maxEntries={50}
28+
predefinedEntries={pluginSignaturesCustomParams[pluginSignature] ?? []}
29+
/>
30+
</div>
31+
);
32+
}

0 commit comments

Comments
 (0)