This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCommandMapping.tsx
More file actions
39 lines (37 loc) · 1.37 KB
/
CommandMapping.tsx
File metadata and controls
39 lines (37 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { reusable } from '@circleci/circleci-config-sdk';
import { CustomCommand } from '@circleci/circleci-config-sdk/dist/src/lib/Components/Commands/exports/Reusable';
import CommandSummary from '../components/atoms/summaries/CommandSummary';
import CommandInspector from '../components/containers/inspector/CommandInspector';
import { componentParametersSubtypes } from '../components/containers/inspector/subtypes/ParameterSubtypes';
import CommandIcon from '../icons/components/CommandIcon';
import ComponentMapping from './ComponentMapping';
const CommandMapping: ComponentMapping<CustomCommand> = {
type: 'commands',
name: {
singular: 'Command',
plural: 'Commands',
},
defaults: {
name: 'new-command',
steps: [],
},
parameters: componentParametersSubtypes.command,
transform: (values: any) =>
new reusable.CustomCommand(values.name, values.steps, values.parameters),
store: {
get: (state) => state.definitions.commands,
add: (actions) => actions.defineCommand,
update: (actions) => actions.updateCommand,
remove: (actions) => actions.undefineCommand,
},
components: {
icon: CommandIcon,
summary: CommandSummary,
inspector: CommandInspector,
},
docsInfo: {
description: 'Sequenced steps to be executed',
link: 'https://circleci.com/docs/2.0/reusing-config/#the-commands-key',
},
};
export default CommandMapping;