Skip to content

Commit

Permalink
feat: add sector information to project
Browse files Browse the repository at this point in the history
  • Loading branch information
dleard committed Jun 20, 2022
1 parent 294b348 commit ab2a3fe
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app/components/Form/ProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const createProjectUiSchema = (
"totalFundingRequest",
"projectStatus",
"projectStatusId",
"sectorName",
"additionalSectorInformation",
],
proposalReference: {
"bcgov:size": "small",
Expand Down Expand Up @@ -82,6 +84,17 @@ export const createProjectUiSchema = (
text: `${projectStatus}`,
},
},
sectorName: {
"ui:placeholder": "Select a Sector",
"ui:col-md": 12,
"bcgov:size": "small",
"ui:widget": "SearchWidget",
},
additionalSectorInformation: {
"ui:col-md": 12,
"ui:widget": "TextAreaWidget",
"bcgov:size": "small",
},
};
};

Expand Down Expand Up @@ -118,6 +131,13 @@ const ProjectForm: React.FC<Props> = (props) => {
}
}
}
allSectors {
edges {
node {
sectorName
}
}
}
...SelectRfpWidget_query
...SelectProjectStatusWidget_query
}
Expand Down Expand Up @@ -206,6 +226,17 @@ const ProjectForm: React.FC<Props> = (props) => {
};
}),
},
sectorName: {
...projectSchema.properties.sectorName,
anyOf: query.allSectors.edges.map(({ node }) => {
return {
type: "string",
title: node.sectorName,
enum: [node.sectorName],
value: node.sectorName,
};
}),
},
},
};
return initialSchema as JSONSchema7;
Expand Down
11 changes: 11 additions & 0 deletions app/data/jsonSchemaForm/projectSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const projectSchema = {
"fundingStreamRfpId",
"totalFundingRequest",
"projectStatusId",
"sectorName",
],
properties: {
proposalReference: {
Expand Down Expand Up @@ -38,6 +39,16 @@ const projectSchema = {
title: "Project Status",
default: undefined,
},
sectorName: {
type: "string",
title: "Sector",
default: undefined,
anyOf: undefined,
},
additionalSectorInformation: {
type: "string",
title: "Additional Sector Information",
},
},
};

Expand Down

0 comments on commit ab2a3fe

Please sign in to comment.