-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from e-picsa/feat/data-tool-save
Feat(monitoring) - Form save, edit, delete
- Loading branch information
Showing
229 changed files
with
2,615 additions
and
1,012 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
apps/picsa-tools/monitoring-tool/data/forms/demo-kitchen.form.ts
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
apps/picsa-tools/monitoring-tool/data/forms/ew-monitoring.form.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { IEnketoFormDefinition } from '../../src/app/schema'; | ||
|
||
const form: IEnketoFormDefinition = { | ||
form: '<form autocomplete="off" novalidate="novalidate" class="or clearfix theme-grid no-text-transform" dir="ltr" data-form-id="aQCDPoHBUkgJRWQgswksoo">\n<!--This form was created by transforming an ODK/OpenRosa-flavored (X)Form using an XSL stylesheet created by Enketo LLC.--><section class="form-logo"></section><h3 dir="auto" id="form-title">PICSA Apps - Extension Worker Monitoring</h3>\n \n \n <label class="question non-select "><span lang="" class="question-label active">Date</span><input type="date" name="/aQCDPoHBUkgJRWQgswksoo/date" data-type-xml="date"></label>\n <fieldset class="question simple-select "><fieldset><legend><span lang="" class="question-label active">District</span>\n </legend><div class="option-wrapper"><label class=""><input type="radio" name="/aQCDPoHBUkgJRWQgswksoo/district" data-name="/aQCDPoHBUkgJRWQgswksoo/district" value="chipata" data-type-xml="string"><span lang="" class="option-label active">Chipata</span></label><label class=""><input type="radio" name="/aQCDPoHBUkgJRWQgswksoo/district" data-name="/aQCDPoHBUkgJRWQgswksoo/district" value="petauke" data-type-xml="string"><span lang="" class="option-label active">Petauke</span></label><label class=""><input type="radio" name="/aQCDPoHBUkgJRWQgswksoo/district" data-name="/aQCDPoHBUkgJRWQgswksoo/district" value="kasungu" data-type-xml="string"><span lang="" class="option-label active">Kasungu</span></label><label class=""><input type="radio" name="/aQCDPoHBUkgJRWQgswksoo/district" data-name="/aQCDPoHBUkgJRWQgswksoo/district" value="nkhotakota" data-type-xml="string"><span lang="" class="option-label active">Nkhotakota</span></label></div></fieldset></fieldset>\n <label class="question non-select "><span lang="" class="question-label active">Location</span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/location" data-type-xml="string"></label>\n <label class="question non-select "><span lang="" class="question-label active">Your Name</span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/name" data-type-xml="string"></label>\n <section class="or-group-data or-appearance-w3 " name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_header"><label class="question non-select or-appearance-w1 "><span lang="" class="question-label active"><strong>Farmers Present</strong></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_header/farmers_present_header_note" data-type-xml="string" readonly></label><label class="question non-select or-appearance-w1 "><span lang="" class="question-label active"><h4>Female</h4></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_header/farmers_present_header_u35" data-type-xml="string" readonly></label><label class="question non-select or-appearance-w1 "><span lang="" class="question-label active"><h4>Male</h4></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_header/farmers_present_header_o36" data-type-xml="string" readonly></label>\n </section><!--end of group -->\n <section class="or-group-data or-appearance-w3 " name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_35"><label class="question non-select or-appearance-w1 "><span lang="" class="question-label active"><h5>Age 35 or under</h5></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_35/farmers_present_f_1_note" data-type-xml="string" readonly></label><label class="question non-select or-appearance-w1 or-appearance-no-label "><span lang="" class="question-label active"><span style="display:none">f-Age 35 or under</span></span><input type="number" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_35/farmers_female_35orunder" data-type-xml="int"></label><label class="question non-select or-appearance-w1 or-appearance-no-label "><span lang="" class="question-label active"><span style="display:none">m-Age 35 or under</span></span><input type="number" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_35/farmers_male_35orunder" data-type-xml="int"></label>\n </section><!--end of group -->\n <section class="or-group-data or-appearance-w3 " name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_36"><label class="question non-select or-appearance-w1 "><span lang="" class="question-label active"><h5>Age 36 or over</h5></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_36/farmers_present_m_1_note" data-type-xml="string" readonly></label><label class="question non-select or-appearance-w1 or-appearance-no-label "><span lang="" class="question-label active"><span style="display:none">f-Age 36 or over</span></span><input type="number" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_36/farmers_female_36orover" data-type-xml="int"></label><label class="question non-select or-appearance-w1 or-appearance-no-label "><span lang="" class="question-label active"><span style="display:none">m-Age 36 or over</span></span><input type="number" name="/aQCDPoHBUkgJRWQgswksoo/farmers_present_36/farmers_male_36orover" data-type-xml="int"></label>\n </section><!--end of group -->\n <label class="question non-select "><span lang="" class="question-label active">Total Farmers: <span class="or-output" data-value=" /aQCDPoHBUkgJRWQgswksoo/total_farmers "> </span></span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/Total_Farmers_total_farmers" data-type-xml="string" readonly></label>\n <label class="question non-select "><span lang="" class="question-label active">Describe what training and activities you conducted with the farmers today(Please give details)</span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/activities" data-type-xml="string"></label>\n <label class="question non-select "><span lang="" class="question-label active">Any comments or observations(e.g exercises/activities farmers found useful? Anything you observed that you think is interesting?</span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/observations" data-type-xml="string"></label>\n <label class="question non-select "><span lang="" class="question-label active">Did you (or anyone else) in addition to the training, share information from PICSA with others in the community(e.g extension app, using notice boards, other meetings)? if yes please give details including date, how many farmers you think may have benefited from this)</span><input type="text" name="/aQCDPoHBUkgJRWQgswksoo/share_community" data-type-xml="string"></label>\n \n<fieldset id="or-preload-items" style="display:none;"><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/start" data-preload="timestamp" data-preload-params="start" data-type-xml="dateTime"></label><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/end" data-preload="timestamp" data-preload-params="end" data-type-xml="dateTime"></label><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/meta/instanceID" data-preload="uid" data-preload-params="" data-type-xml="string"></label></fieldset><fieldset id="or-calculated-items" style="display:none;"><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/total_farmers" data-calculate=" /aQCDPoHBUkgJRWQgswksoo/farmers_present_35/farmers_female_35orunder + /aQCDPoHBUkgJRWQgswksoo/farmers_present_35/farmers_male_35orunder + /aQCDPoHBUkgJRWQgswksoo/farmers_present_36/farmers_female_36orover + /aQCDPoHBUkgJRWQgswksoo/farmers_present_36/farmers_male_36orover " data-type-xml="string"></label><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/__version__" data-calculate="\'v6evZtYBCbVVMTbao7Wed8\'" data-type-xml="string"></label><label class="calculation non-select "><input type="hidden" name="/aQCDPoHBUkgJRWQgswksoo/formhub/uuid" data-calculate="\'6047e7f1180a493eb78272460fd38317\'" data-type-xml="string"></label></fieldset></form>', | ||
media: {}, | ||
model: | ||
'<model xmlns:odk="http://www.opendatakit.org/xforms" odk:xforms-version="1.0.0"><instance>\n <aQCDPoHBUkgJRWQgswksoo xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" id="aQCDPoHBUkgJRWQgswksoo" version="10 (2023-07-15 20:26:29)">\n <formhub>\n <uuid/>\n </formhub>\n <start/>\n <end/>\n <date/>\n <district/>\n <location/>\n <name/>\n <farmers_present_header>\n <farmers_present_header_note/>\n <farmers_present_header_u35/>\n <farmers_present_header_o36/>\n </farmers_present_header>\n <farmers_present_35>\n <farmers_present_f_1_note/>\n <farmers_female_35orunder/>\n <farmers_male_35orunder/>\n </farmers_present_35>\n <farmers_present_36>\n <farmers_present_m_1_note/>\n <farmers_female_36orover/>\n <farmers_male_36orover/>\n </farmers_present_36>\n <total_farmers/>\n <Total_Farmers_total_farmers/>\n <activities/>\n <observations/>\n <share_community/>\n <__version__/>\n <meta>\n <instanceID/>\n </meta>\n </aQCDPoHBUkgJRWQgswksoo>\n </instance></model>', | ||
theme: 'grid', | ||
hash: 'md5:3df1198edf03fd9417bee87faf933310--d97bac4e49bda9c52dee96737583f620---1', | ||
languageMap: {}, | ||
enketoId: 'PGpldp9m', | ||
externalData: [], | ||
maxSize: 10000000, | ||
}; | ||
export default form; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { IMonitoringForm } from '../../src/app/schema/forms'; | ||
|
||
import ewMonitoringForm from './ew-monitoring.form'; | ||
import demoKitchenForm from './demo-kitchen.form'; | ||
|
||
export const HARDCODED_FORMS: IMonitoringForm[] = [ | ||
{ | ||
_id: 'ew_monitoring', | ||
title: 'Extension Worker Monitoring', | ||
description: '', | ||
enketoDefinition: ewMonitoringForm, | ||
summaryFields: [ | ||
{ field: 'date', label: 'Date' }, | ||
{ field: 'district', label: 'District' }, | ||
{ field: 'location', label: 'Location' }, | ||
{ field: 'total_farmers', label: 'Total Farmers' }, | ||
], | ||
}, | ||
|
||
{ | ||
_id: 'demo_kitchen', | ||
title: 'Complex Demo Form', | ||
description: '', | ||
appCountries: ['global'], | ||
enketoDefinition: demoKitchenForm, | ||
summaryFields: [{ field: '_id', label: 'ID' }], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/picsa-tools/monitoring-tool/src/app/components/form-item/form-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
apps/picsa-tools/monitoring-tool/src/app/components/form-item/form-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { IPicsaForm } from '../../models'; | ||
import { IMonitoringForm } from '../../schema/forms'; | ||
|
||
@Component({ | ||
selector: 'monitoring-form-item', | ||
templateUrl: './form-item.component.html', | ||
styleUrls: ['./form-item.component.scss'], | ||
}) | ||
export class FormItemComponent { | ||
@Input() form: IPicsaForm; | ||
@Input() form: IMonitoringForm; | ||
} |
4 changes: 3 additions & 1 deletion
4
apps/picsa-tools/monitoring-tool/src/app/components/material.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
apps/picsa-tools/monitoring-tool/src/app/pages/form-view/form-view.component.html
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
apps/picsa-tools/monitoring-tool/src/app/pages/form-view/form-view.component.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
apps/picsa-tools/monitoring-tool/src/app/pages/form-view/form-view.module.ts
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
apps/picsa-tools/monitoring-tool/src/app/pages/form/form-view/form-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="page-content"> | ||
<ng-container *ngIf="formInitial"> | ||
<enketo-webform | ||
[form]="formInitial.form" | ||
[model]="formInitial.model" | ||
(dataUpdated)="handleAutosave($event)" | ||
(formSaved)="handleSave($event)" | ||
[showButtons]="false" | ||
></enketo-webform> | ||
<div style="display: flex"> | ||
<button mat-button style="margin-right: 1rem" (click)="promptDelete()"> | ||
<mat-icon>delete</mat-icon>{{ 'Delete' | translate }} | ||
</button> | ||
<button mat-raised-button color="primary" style="flex: 1" [disabled]="!formEntry" (click)="handleCustomSave()"> | ||
{{ 'Submit' | translate }} | ||
</button> | ||
</div> | ||
</ng-container> | ||
</div> |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.