-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cb2-13455): VTM - Pass and issue Documents Centrally (additional…
… test type ids) (#1530) * feat(cb2-13455): add issue docs centrally for first test and first test prohibition clearance * feat(cb2-13455): linting * feat(cb2-13455): fix linting * feat(cb2-13455): fix template * feat(cb2-13455): show issue docs for prs --------- Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>
- Loading branch information
1 parent
ab634e7
commit e78d142
Showing
5 changed files
with
388 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
...on-templates/test/contingency/contingency-test-section-group9And10CentralDocs.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
import { ValidatorNames } from '@forms/models/validators.enum'; | ||
import { | ||
FormNode, FormNodeEditTypes, FormNodeTypes, FormNodeViewTypes, FormNodeWidth, | ||
} from '@forms/services/dynamic-form.types'; | ||
|
||
export const ContingencyTestSectionGroup9And10CentralDocs: FormNode = { | ||
name: 'testSection', | ||
label: 'Test', | ||
type: FormNodeTypes.GROUP, | ||
children: [ | ||
{ | ||
name: 'contingencyTestNumber', | ||
label: 'Contingency Test Number', | ||
type: FormNodeTypes.CONTROL, | ||
editType: FormNodeEditTypes.NUMERICSTRING, | ||
validators: [{ name: ValidatorNames.MaxLength, args: 8 }, { name: ValidatorNames.MinLength, args: 6 }, { name: ValidatorNames.Required }], | ||
width: FormNodeWidth.L, | ||
}, | ||
{ | ||
name: 'testStartTimestamp', | ||
label: 'Test start date', | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
validators: [{ name: ValidatorNames.PastDate }], | ||
}, | ||
{ | ||
name: 'testEndTimestamp', | ||
type: FormNodeTypes.CONTROL, | ||
label: 'Test end date', | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], | ||
}, | ||
{ | ||
name: 'testTypes', | ||
label: 'Test Types', | ||
type: FormNodeTypes.ARRAY, | ||
children: [ | ||
{ | ||
name: '0', // it is important here that the name of the node for an ARRAY type should be an index value | ||
type: FormNodeTypes.GROUP, | ||
children: [ | ||
{ | ||
name: 'testResult', | ||
label: 'Result', | ||
editType: FormNodeEditTypes.HIDDEN, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
value: null, | ||
type: FormNodeTypes.CONTROL, | ||
validators: [{ name: ValidatorNames.HideIfNotEqual, args: { sibling: 'centralDocs', value: ['pass', 'prs'] } }], | ||
}, | ||
{ | ||
name: 'centralDocs', | ||
type: FormNodeTypes.GROUP, | ||
children: [ | ||
{ | ||
name: 'issueRequired', | ||
type: FormNodeTypes.CONTROL, | ||
label: 'Issue documents centrally', | ||
editType: FormNodeEditTypes.RADIO, | ||
value: false, | ||
options: [ | ||
{ value: true, label: 'Yes' }, | ||
{ value: false, label: 'No' }, | ||
], | ||
validators: [{ name: ValidatorNames.HideIfParentSiblingEqual, args: { sibling: 'certificateNumber', value: true } }], | ||
}, | ||
{ | ||
name: 'reasonsForIssue', | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
value: [], | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'reasonForAbandoning', | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
value: null, | ||
required: true, | ||
}, | ||
{ | ||
name: 'additionalCommentsForAbandon', | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
value: null, | ||
required: true, | ||
}, | ||
{ | ||
name: 'certificateNumber', | ||
label: 'Certificate number', | ||
value: '', | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
}, | ||
{ | ||
name: 'testExpiryDate', | ||
label: 'Expiry Date', | ||
disabled: true, | ||
type: FormNodeTypes.CONTROL, | ||
viewType: FormNodeViewTypes.HIDDEN, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
}, | ||
{ | ||
name: 'testTypeStartTimestamp', | ||
type: FormNodeTypes.CONTROL, | ||
value: '', | ||
label: 'Test start date and time', | ||
viewType: FormNodeViewTypes.TIME, | ||
editType: FormNodeEditTypes.DATETIME, | ||
validators: [ | ||
{ name: ValidatorNames.Required }, | ||
{ name: ValidatorNames.PastDate }, | ||
{ name: ValidatorNames.CopyValueToRootControl, args: 'testStartTimestamp' }, | ||
], | ||
}, | ||
{ | ||
name: 'testTypeEndTimestamp', | ||
type: FormNodeTypes.CONTROL, | ||
value: '', | ||
label: 'Test end date and time', | ||
viewType: FormNodeViewTypes.TIME, | ||
editType: FormNodeEditTypes.DATETIME, | ||
validators: [ | ||
{ name: ValidatorNames.Required }, | ||
{ name: ValidatorNames.PastDate }, | ||
{ name: ValidatorNames.AheadOfDate, args: 'testTypeStartTimestamp' }, | ||
{ name: ValidatorNames.CopyValueToRootControl, args: 'testEndTimestamp' }, | ||
], | ||
}, | ||
{ | ||
name: 'prohibitionIssued', | ||
label: 'Prohibition issued', | ||
type: FormNodeTypes.CONTROL, | ||
value: null, | ||
editType: FormNodeEditTypes.HIDDEN, | ||
required: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
}; |
Oops, something went wrong.