Skip to content

Commit

Permalink
feat: total co2 emissions on the summary page
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Apr 21, 2022
1 parent c0cc2d7 commit 7f2e005
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/containers/Applications/ApplicationDetailsCardItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import EmissionCategoryRowIdField from "containers/Forms/EmissionCategoryRowIdFi
import NaicsField from "containers/Forms/NaicsField";
import ProductField from "containers/Forms/ProductField";
import ProductRowIdField from "containers/Forms/ProductRowIdField";
import EmissionField from "containers/Forms/EmissionField";

interface Props {
// The form_result used by the fragment
Expand Down Expand Up @@ -115,6 +116,15 @@ export const ApplicationDetailsCardItemComponent: React.FunctionComponent<Props>
{...props}
/>
),
emission: (props) => (
<EmissionField
totalOnsiteEmissions={
formResult.applicationRevisionByApplicationIdAndVersionNumber
.totalCiipEmissions
}
{...props}
/>
),
fuel: (props) => <FuelField query={query} {...props} />,
fuelRowId: (props) => <FuelRowIdField query={query} {...props} />,
emissionCategoryRowId: (props) => (
Expand Down Expand Up @@ -217,6 +227,7 @@ export default createFragmentContainer(ApplicationDetailsCardItemComponent, {
formJson
}
applicationRevisionByApplicationIdAndVersionNumber {
totalCiipEmissions
naicsCode {
...ProductRowIdField_naicsCode
...ProductField_naicsCode
Expand Down
9 changes: 8 additions & 1 deletion app/containers/Forms/EmissionField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,15 @@ export const EmissionFieldComponent: React.FunctionComponent<Props> = (
.emission-form .show-zero-emissions .zero-emission {
display: block !important;
}
/* .emission class is for the summary page */
.emission .emission-row {
display: none !important;
margin-bottom: 0;
border-bottom: none;
padding-bottom: 0 !important;
}
.emission .emission-toggle {
display: none;
}
.emission-form .field-array hr {
Expand Down

0 comments on commit 7f2e005

Please sign in to comment.