Skip to content

Commit

Permalink
feat: add swrs_report_id column to org/facility display
Browse files Browse the repository at this point in the history
  • Loading branch information
dleard committed Jun 24, 2020
1 parent 7d3e3ad commit 89f0c31
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
20 changes: 18 additions & 2 deletions app/containers/Facilities/AddFacility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,24 @@ export const AddFacilityComponent: React.FunctionComponent<Props> = (props) => {
props.handleInputChange(event.target.value);
};

const selectFacility = (name, id, operatorName, facilityType, bcghgid) => {
const selectFacility = (
name,
id,
operatorName,
facilityType,
bcghgid,
swrsReportId
) => {
props.handleFacilityChange(id);
props.handleInputChange('');
setSelectedFacilityDetails({name, id, operatorName, facilityType, bcghgid});
setSelectedFacilityDetails({
name,
id,
operatorName,
facilityType,
bcghgid,
swrsReportId
});
};

const handleAddFacility = async (variables) => {
Expand Down Expand Up @@ -76,6 +90,7 @@ export const AddFacilityComponent: React.FunctionComponent<Props> = (props) => {
<th>Facility Name</th>
<th>Facility Type</th>
<th>BCGHGID</th>
<th>SWRS Report ID</th>
</tr>
</thead>
<tbody>
Expand All @@ -84,6 +99,7 @@ export const AddFacilityComponent: React.FunctionComponent<Props> = (props) => {
<td>{selectedFacilityDetails?.name}</td>
<td>{selectedFacilityDetails?.facilityType}</td>
<td>{selectedFacilityDetails?.bcghgid}</td>
<td>{selectedFacilityDetails?.swrsReportId}</td>
</tr>
</tbody>
</Table>
Expand Down
4 changes: 3 additions & 1 deletion app/containers/Facilities/Facility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const FacilityComponent = (props) => {
facility.rowId,
facility.organisationByOrganisationId.operatorName,
facility.facilityType,
facility.bcghgid
facility.bcghgid,
facility.swrsReportId
)
}
>
Expand All @@ -42,6 +43,7 @@ export default createFragmentContainer(FacilityComponent, {
}
facilityType
bcghgid
swrsReportId
}
`
});
10 changes: 4 additions & 6 deletions app/containers/Organisations/AddOrganisation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const AddOrganisationComponent: React.FunctionComponent<Props> = (
props.handleInputChange(event.target.value);
};

const selectOrg = (name, id, tradeName, cra) => {
const selectOrg = (name, id, tradeName, cra, swrsReportId) => {
props.handleOrgChange(id);
props.handleInputChange('');
setSelectedOrgDetails({name, id, tradeName, cra});
setSelectedOrgDetails({name, id, tradeName, cra, swrsReportId});
};

const handleAddOrganisation = async (variables) => {
Expand Down Expand Up @@ -76,13 +76,15 @@ export const AddOrganisationComponent: React.FunctionComponent<Props> = (
<th>Operator Name</th>
<th>Trade Name</th>
<th>CRA Business Number</th>
<th>SWRS Report Id</th>
</tr>
</thead>
<tbody>
<tr>
<td>{selectedOrgDetails?.name}</td>
<td>{selectedOrgDetails?.tradeName}</td>
<td>{selectedOrgDetails?.cra}</td>
<td>{selectedOrgDetails?.swrsReportId}</td>
</tr>
</tbody>
</Table>
Expand Down Expand Up @@ -111,10 +113,6 @@ export default createFragmentContainer(AddOrganisationComponent, {
edges {
node {
id
rowId
operatorName
operatorTradeName
craBusinessNumber
...Organisation_organisation
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/containers/Organisations/Organisation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const OrganisationComponent = (props) => {
organisation.operatorName,
organisation.rowId,
organisation.operatorTradeName,
organisation.craBusinessNumber
organisation.craBusinessNumber,
organisation.swrsReportId
)
}
>
Expand All @@ -38,6 +39,7 @@ export default createFragmentContainer(OrganisationComponent, {
operatorName
operatorTradeName
craBusinessNumber
swrsReportId
}
`
});

0 comments on commit 89f0c31

Please sign in to comment.