+
@@ -38,7 +37,6 @@
diff --git a/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.scss b/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.scss
index 975adb154..aadc5c457 100644
--- a/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.scss
+++ b/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.scss
@@ -68,4 +68,8 @@
grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
gap: 16px;
}
+ &[data-type='produceConsumed'] {
+ grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
+ gap: 16px;
+ }
}
diff --git a/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.ts b/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.ts
index 908350dd3..f0a4b10fb 100644
--- a/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.ts
+++ b/apps/picsa-tools/budget-tool/src/app/components/editor/editor.component.ts
@@ -1,5 +1,8 @@
import { Component, ElementRef, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
-import { FadeInOut, ANIMATION_DELAYED } from '@picsa/shared/animations';
+import { MatDialog } from '@angular/material/dialog';
+import { ANIMATION_DELAYED, FadeInOut } from '@picsa/shared/animations';
+import { _wait } from '@picsa/utils';
+
import {
IBudgetCard,
IBudgetCardWithValues,
@@ -7,8 +10,6 @@ import {
IBudgetPeriodType,
} from '../../models/budget-tool.models';
import { BudgetStore } from '../../store/budget.store';
-import { MatDialog } from '@angular/material/dialog';
-import { _wait } from '@picsa/utils';
const EDITOR_STEPS: { type: IBudgetPeriodType; label: string }[] = [
{ type: 'activities', label: 'Activities' },
@@ -110,9 +111,12 @@ export class BudgetEditorComponent {
this.loadEditorData();
}
- // the store already knows what period and type it is, so just pass the updated values
- // back up to save
+ // the store already knows what period and type it is, so just pass the updated values to save
onEditorChange(values: IBudgetCardWithValues[], type: IBudgetPeriodType) {
this.store.saveEditor(values, type);
+ // HACK - fix change detection issue for produceConsumed cards
+ if (type === 'produceConsumed') {
+ this.data.produceConsumed = values;
+ }
}
}
diff --git a/apps/picsa-tools/budget-tool/src/app/models/budget-tool.models.ts b/apps/picsa-tools/budget-tool/src/app/models/budget-tool.models.ts
index 68f4c854d..ae8ba1a37 100644
--- a/apps/picsa-tools/budget-tool/src/app/models/budget-tool.models.ts
+++ b/apps/picsa-tools/budget-tool/src/app/models/budget-tool.models.ts
@@ -69,7 +69,6 @@ export type IBudgetCardType = IBudgetPeriodType | 'enterprise' | 'other';
export interface IBudgetCardWithValues extends IBudgetCard {
values: IBudgetCardValues;
- quantity?: number; // possible legacy use? (e.g. produce-consumed)
}
interface IBudgetCardCustomMeta {
diff --git a/apps/picsa-tools/budget-tool/src/app/store/budget.store.ts b/apps/picsa-tools/budget-tool/src/app/store/budget.store.ts
index cd8db737f..ea33140c3 100644
--- a/apps/picsa-tools/budget-tool/src/app/store/budget.store.ts
+++ b/apps/picsa-tools/budget-tool/src/app/store/budget.store.ts
@@ -70,7 +70,6 @@ export class BudgetStore implements OnDestroy {
@observable balance: IBudgetBalance = [];
// get unique list of types in enterprise cards
@computed get enterpriseTypeCards(): IBudgetCardDB[] {
- console.log('get enterprisetype cards');
const enterpriseCards = this.budgetCards.filter((c) => c.type === 'enterprise');
return this._createCardGroupCards(enterpriseCards);
}
diff --git a/libs/i18n/assets/en.json b/libs/i18n/assets/en.json
index 5cc4293ea..077e0f8f0 100644
--- a/libs/i18n/assets/en.json
+++ b/libs/i18n/assets/en.json
@@ -98,6 +98,7 @@
"Length": "Length",
"Male Member": "Male Member",
"Next": "Next",
+ "No outputs produce for consumption": "No outputs produce for consumption",
"Outputs": "Outputs",
"Produce Consumed": "Produce Consumed",
"Quantity": "Quantity",
@@ -112,6 +113,8 @@
"Summary": "Summary",
"Title": "Title",
"Total": "Total",
+ "Total Consumed": "Total Consumed",
+ "Total Produced": "Total Produced",
"Values": "Values",
"What is your type of enterprise?": "What is your type of enterprise?",
"description": "description",
diff --git a/libs/i18n/assets/ny.json b/libs/i18n/assets/ny.json
index 98c3aadfe..0152cf86a 100644
--- a/libs/i18n/assets/ny.json
+++ b/libs/i18n/assets/ny.json
@@ -4,8 +4,11 @@
"Family Labour": "",
"Female Member": "",
"Male Member": "",
+ "No outputs produce for consumption": "",
"Produce Consumed": "",
"Select Country": "",
+ "Total Consumed": "",
+ "Total Produced": "",
"Activities": "zochitika",
"add custom": "onjezani mwambo",
"afforestation": "kugogoda",
diff --git a/libs/i18n/assets/sw.json b/libs/i18n/assets/sw.json
index 98978f677..c6e37047b 100644
--- a/libs/i18n/assets/sw.json
+++ b/libs/i18n/assets/sw.json
@@ -19,6 +19,7 @@
"Line": "",
"Male Member": "",
"Monitoring": "",
+ "No outputs produce for consumption": "",
"On average": "",
"onions": "",
"out of": "",
@@ -43,6 +44,8 @@
"Terciles": "",
"title": "",
"Total": "",
+ "Total Consumed": "",
+ "Total Produced": "",
"Values": "",
"Year": "",
"years out of every 10": "",
diff --git a/libs/i18n/assets/tg.json b/libs/i18n/assets/tg.json
index 200becb20..a9255d0ad 100644
--- a/libs/i18n/assets/tg.json
+++ b/libs/i18n/assets/tg.json
@@ -19,6 +19,7 @@
"Line": "",
"Male Member": "",
"Monitoring": "",
+ "No outputs produce for consumption": "",
"On average": "",
"onions": "",
"out of": "",
@@ -43,6 +44,8 @@
"Terciles": "",
"title": "",
"Total": "",
+ "Total Consumed": "",
+ "Total Produced": "",
"Values": "",
"Year": "",
"years out of every 10": "",
diff --git a/libs/i18n/templates/_template.csv b/libs/i18n/templates/_template.csv
index 135220467..75bd22200 100644
--- a/libs/i18n/templates/_template.csv
+++ b/libs/i18n/templates/_template.csv
@@ -98,6 +98,7 @@ tool,context,text
"budget",,"Length"
"budget",,"Male Member"
"budget",,"Next"
+"budget",,"No outputs produce for consumption"
"budget",,"Outputs"
"budget",,"Produce Consumed"
"budget",,"Quantity"
@@ -112,6 +113,8 @@ tool,context,text
"budget",,"Summary"
"budget",,"Title"
"budget",,"Total"
+"budget",,"Total Consumed"
+"budget",,"Total Produced"
"budget",,"Values"
"budget",,"What is your type of enterprise?"
"budget",,"description"
diff --git a/libs/i18n/templates/_template.json b/libs/i18n/templates/_template.json
index a232cc744..42ccbce42 100644
--- a/libs/i18n/templates/_template.json
+++ b/libs/i18n/templates/_template.json
@@ -473,6 +473,10 @@
"text": "Next",
"tool": "budget"
},
+ {
+ "text": "No outputs produce for consumption",
+ "tool": "budget"
+ },
{
"text": "Outputs",
"tool": "budget"
@@ -529,6 +533,14 @@
"text": "Total",
"tool": "budget"
},
+ {
+ "text": "Total Consumed",
+ "tool": "budget"
+ },
+ {
+ "text": "Total Produced",
+ "tool": "budget"
+ },
{
"text": "Values",
"tool": "budget"