Skip to content

Commit

Permalink
chore: update activity to put carbonates at base
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgamache committed Sep 18, 2024
1 parent 21847b8 commit dee7f7b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 93 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{
"name": "Pulp and paper production",
"type": "object",
"properties": {}
"properties": {
"carbonates": {
"type": "array",
"title": "Carbonates",
"items": {
"title": "Carbonates",
"type": "object",
"properties": {
"carbonateName": {
"type": "string",
"title": "Carbonate Name"
},
"annualAmount": {
"type": "number",
"title": "Annual Amount (t)"
},
"purityOfCarbonate": {
"type": "number",
"title": "Purity Of Carbonate (Weight Fraction)"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
{
"type": "object",
"title": "Pulping and chemical recovery",
"title": "Emissions",
"properties": {
"emissions": {
"type": "array",
"title": "Emissions",
"items": {
"title": "Pulping and chemical recovery",
"title": "Emission",
"type": "object",
"properties": {
"carbonateName": {
"type": "string",
"title": "Carbonate Name"
},
"annualAmount": {
"type": "number",
"title": "Annual Amount (t)"
},
"purityOfCarbonate": {
"type": "number",
"title": "Purity Of Carbonate (Weight Fraction)"
},
"methodology": {
"title": "Methodology",
"type": "string",
"enum": [
"Solids-HHV",
"Solids-CC",
"Make-up Chemical Use Methodology",
"Alternative Parameter Methodology",
"Replacement Methodology"
]
},
"gasType": {
"type": "string",
"title": "Gas Type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function PulpAndPaperProduction({
reportDate,
}: Readonly<Props>) {
const defaultEmptySourceTypeState = {
emissions: [],
emissions: [{}],
};

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import FieldTemplate from "@bciers/components/form/fields/FieldTemplate";
import CheckboxWidgetLeft from "@bciers/components/form/widgets/CheckboxWidgetLeft";
import SourceTypeBoxTemplate from "@bciers/components/form/fields/SourceTypeBoxTemplate";
import NestedArrayFieldTemplate from "@bciers/components/form/fields/NestedArrayFieldTemplate";
import { InlineFieldTemplate } from "@bciers/components/form/fields";

const uiSchema = {
"ui:FieldTemplate": FieldTemplate,
"ui:classNames": "form-heading-label",
pulpingAndChemicalRecovery: {
"ui:FieldTemplate": FieldTemplate,
"ui:widget": CheckboxWidgetLeft,
carbonates: {
"ui:ArrayFieldTemplate": NestedArrayFieldTemplate,
"ui:FieldTemplate": SourceTypeBoxTemplate,
"ui:options": {
label: false,
arrayAddLabel: "Add Carbonate",
label: true,
title: "Carbonate",
padding: "p-2",
},
items: {
"ui:order": ["carbonateName", "annualAmount", "purityOfCarbonate"],
},
},
sourceTypes: {
Expand All @@ -26,74 +31,15 @@ const uiSchema = {
"ui:ArrayFieldTemplate": NestedArrayFieldTemplate,
"ui:FieldTemplate": FieldTemplate,
"ui:options": {
arrayAddLabel: "Add Pulping and Chemical Recovery",
arrayAddLabel: "Add Emission",
label: false,
title: "Pulping and Chemical Recovery",
title: "Emission",
padding: "p-2",
},
items: {
"ui:order": [
"gasType",
"methodology",
"emission",
"equivalentEmission",
"carbonateName",
"purityOfCarbonate",
"annualAmount",
"purityOfCarbonateWeightFraction",
"massOfSpentLiquorCombustedTonnesYear",
"solidsPercentageByWeight",
"annualHighHeatValueOfSpentLiquorSolidsGjKg",
"annualCarbonContentOfSpentLiquorSolidsByWeight",
"makeUpQuantityOfCaco3UsedTonnesYear",
"makeUpQuantityOfNa2Co3UsedTonnesYear",
"description",
],
gasType: {
"ui:FieldTemplate": InlineFieldTemplate,
},
methodology: {
"ui:FieldTemplate": InlineFieldTemplate,
},
emission: {
"ui:FieldTemplate": InlineFieldTemplate,
},
equivalentEmission: {
"ui:FieldTemplate": InlineFieldTemplate,
},
carbonateName: {
"ui:FieldTemplate": InlineFieldTemplate,
},
purityOfCarbonate: {
"ui:FieldTemplate": InlineFieldTemplate,
},
annualAmount: {
"ui:FieldTemplate": InlineFieldTemplate,
},
purityOfCarbonateWeightFraction: {
"ui:FieldTemplate": InlineFieldTemplate,
},
massOfSpentLiquorCombustedTonnesYear: {
"ui:FieldTemplate": InlineFieldTemplate,
},
solidsPercentageByWeight: {
"ui:FieldTemplate": InlineFieldTemplate,
},
annualHighHeatValueOfSpentLiquorSolidsGjKg: {
"ui:FieldTemplate": InlineFieldTemplate,
},
annualCarbonContentOfSpentLiquorSolidsByWeight: {
"ui:FieldTemplate": InlineFieldTemplate,
},
makeUpQuantityOfCaco3UsedTonnesYear: {
"ui:FieldTemplate": InlineFieldTemplate,
},
makeUpQuantityOfNa2Co3UsedTonnesYear: {
"ui:FieldTemplate": InlineFieldTemplate,
},
description: {
"ui:FieldTemplate": InlineFieldTemplate,
},
},
},
},
Expand Down

0 comments on commit dee7f7b

Please sign in to comment.