Skip to content

Commit

Permalink
feat: Add deployment script select (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmevladik committed Sep 5, 2024
1 parent 416556c commit 23e0d7c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/deploymentScripts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export enum DEPLOYMENT_SCRIPTS {
HELM_CHART = 'helm-chart',
RPM_PACKAGE = 'rpm-package',
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
CodebaseVersioning,
CommitMessagePattern,
DefaultBranch,
DeploymentScript,
JiraServer,
JiraServerIntegration,
TicketNamePattern,
Expand All @@ -27,6 +28,9 @@ export const Advanced = () => {
<Grid item xs={12}>
<DefaultBranch />
</Grid>
<Grid item xs={12}>
<DeploymentScript />
</Grid>
<Grid item xs={12}>
<CodebaseVersioning />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { DEPLOYMENT_SCRIPTS } from '../../../../../../constants/deploymentScripts';
import { FormSelect } from '../../../../../../providers/Form/components/FormSelect';
import { useTypedFormContext } from '../../../hooks/useFormContext';
import { CODEBASE_FORM_NAMES } from '../../../names';

export const DeploymentScript = () => {
const {
register,
control,
formState: { errors },
} = useTypedFormContext();

const options = Object.values(DEPLOYMENT_SCRIPTS).map((script) => ({
label: script,
value: script,
}));

return (
<FormSelect
{...register(CODEBASE_FORM_NAMES.deploymentScript.name, {
required: 'Select the deployment script',
})}
label={'Deployment Options'}
title={'Choose the deployment script'}
control={control}
errors={errors}
options={options}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export * from './RepositoryPasswordOrApiToken';
export * from './RepositoryUrl';
export * from './TestReportFramework';
export * from './TicketNamePattern';
export * from './DeploymentScript';

0 comments on commit 23e0d7c

Please sign in to comment.