Skip to content

Commit

Permalink
feat(linting-1): rebase against dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcrawleyy committed Aug 14, 2024
2 parents c21e385 + f7c58f9 commit 4b828cc
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,40 @@ export const ContingencyTestSectionGroup5And13: FormNode = {
asyncValidators: [{ name: AsyncValidatorNames.ResultDependantOnCustomDefects }],
validators: [
{ name: ValidatorNames.HideIfNotEqual, args: { sibling: 'certificateNumber', value: 'pass' } },
{ name: ValidatorNames.HideIfNotEqual, args: { sibling: 'centralDocs', value: 'pass' } },
],
type: FormNodeTypes.CONTROL,
},
{
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: 'testTypeName',
label: 'Description',
Expand Down Expand Up @@ -95,10 +126,8 @@ export const ContingencyTestSectionGroup5And13: FormNode = {
type: FormNodeTypes.CONTROL,
validators: [
{ name: ValidatorNames.Alphanumeric },
{
name: ValidatorNames.RequiredIfEquals,
args: { sibling: 'testResult', value: ['pass'] },
},
// Make required if test result is pass/prs, but issue documents centrally is false
{ name: ValidatorNames.IssueRequired },
],
required: true,
value: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,41 @@ export const TestSectionGroup5And13: FormNode = {
name: ValidatorNames.HideIfNotEqual,
args: { sibling: 'certificateNumber', value: ['pass', 'prs', 'abandoned'] },
},
{ name: ValidatorNames.HideIfNotEqual, args: { sibling: 'centralDocs', value: ['pass', 'prs'] } },
],
asyncValidators: [{ name: AsyncValidatorNames.ResultDependantOnCustomDefects }],
type: FormNodeTypes.CONTROL,
},
{
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: 'testTypeName',
label: 'Description',
Expand All @@ -88,7 +119,10 @@ export const TestSectionGroup5And13: FormNode = {
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.HIDDEN,
editType: FormNodeEditTypes.HIDDEN,
required: true,
validators: [
// Make required if test result is pass/prs, but issue documents centrally is false
{ name: ValidatorNames.IssueRequired },
],
value: null,
},
{
Expand Down

0 comments on commit 4b828cc

Please sign in to comment.