Skip to content

Commit ec015d4

Browse files
callmevladikSergK
authored andcommitted
feat: Hide manual qg name field (#496)
1 parent bbec1f7 commit ec015d4

File tree

2 files changed

+24
-20
lines changed
  • src/widgets/dialogs/ManageStage/components/fields/QualityGates

2 files changed

+24
-20
lines changed

src/widgets/dialogs/ManageStage/components/fields/QualityGates/components/QualityGateRow/index.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,29 @@ export const QualityGateRow = ({
275275
options={availableQualityGateTypeSelectOptions}
276276
/>
277277
</Grid>
278-
<Grid item xs={3}>
279-
<FormTextField
280-
{...register(
281-
// @ts-ignore
282-
createQualityGateStepNameFieldName(currentQualityGate.id),
283-
{
284-
required: 'Enter step name.',
285-
onChange: handleChangeQualityGateStepName,
286-
}
287-
)}
288-
label={'Step name'}
289-
title={
290-
'Name the deployment step within the stage to distinguish different phases of the deployment process.'
291-
}
292-
placeholder={'Enter step name'}
293-
control={control}
294-
errors={errors}
295-
/>
296-
</Grid>
278+
{currentQualityGateTypeFieldValue &&
279+
currentQualityGateTypeFieldValue !== QUALITY_GATE_TYPES.MANUAL && (
280+
<Grid item xs={3}>
281+
<FormTextField
282+
{...register(
283+
// @ts-ignore
284+
createQualityGateStepNameFieldName(currentQualityGate.id),
285+
{
286+
required: 'Enter step name.',
287+
onChange: handleChangeQualityGateStepName,
288+
}
289+
)}
290+
label={'Step name'}
291+
title={
292+
'Name the deployment step within the stage to distinguish different phases of the deployment process.'
293+
}
294+
placeholder={'Enter step name'}
295+
control={control}
296+
errors={errors}
297+
/>
298+
</Grid>
299+
)}
300+
297301
{!!autotestsWithBranchesOptions.length &&
298302
currentQualityGateTypeFieldValue === QUALITY_GATE_TYPES.AUTOTESTS ? (
299303
<>

src/widgets/dialogs/ManageStage/components/fields/QualityGates/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
33
export const DEFAULT_QUALITY_GATE = {
44
id: uuidv4(),
55
qualityGateType: 'manual',
6-
stepName: '',
6+
stepName: 'approve',
77
autotestName: null,
88
branchName: null,
99
};

0 commit comments

Comments
 (0)