-
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 branch 'main' into feat-seasonal-calender
- Loading branch information
Showing
114 changed files
with
2,660 additions
and
443 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
apps/picsa-apps/extension-app/src/assets/svgs/farmer_activity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
...bility-tool/src/app/components/crop-probability-table/crop-probability-table.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
2 changes: 1 addition & 1 deletion
2
...csa-tools/crop-probability-tool/src/app/components/crop-select/crop-select.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
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: 4 additions & 2 deletions
6
...ols/crop-probability-tool/src/app/components/station-select/station-select.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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<!-- Station Filter --> | ||
<mat-form-field style="width: 250px" class="no-hint"> | ||
<mat-form-field style="width: 250px" class="no-hint" data-tour-id="station"> | ||
<mat-label>{{ 'Station' | translate }}</mat-label> | ||
<mat-select [value]="selectedStationId" (selectionChange)="handleStationChange($event.value)" #stationSelect> | ||
<mat-option *ngFor="let station of stations" [value]="station.id">{{ station.station_name }}</mat-option> | ||
<mat-option *ngFor="let station of stations" [value]="station.id" [attr.data-tour-id]="station.id">{{ | ||
station.station_name | ||
}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> |
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
108 changes: 108 additions & 0 deletions
108
apps/picsa-tools/crop-probability-tool/src/app/data/tour.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,108 @@ | ||
import { marker as translateMarker } from '@biesbjerg/ngx-translate-extract-marker'; | ||
import type { ITourStep } from '@picsa/shared/services/core/tour.service'; | ||
import { _wait } from '@picsa/utils'; | ||
|
||
/** | ||
* Example tour to select a site from list | ||
* Includes route listeners to automatically trigger table tour once table loaded | ||
*/ | ||
export const CROP_PROBABILITY_SELECT_TOUR: ITourStep[] = [ | ||
{ | ||
id: 'station', | ||
text: 'Tap here to choose a station', | ||
|
||
tourOptions: { | ||
showBullets: false, | ||
showButtons: false, | ||
}, | ||
// When user clicks on the station select suspend the tour so that the user can | ||
// interact with the select popup | ||
clickEvents: { | ||
handler: (service) => { | ||
service.pauseTour(); | ||
}, | ||
}, | ||
// Resume the tour once the user has navigated to a station | ||
routeEvents: { | ||
handler: ({ queryParams }, service) => { | ||
if (queryParams.stationId) { | ||
_wait(500).then(() => { | ||
service.startTour(CROP_PROBABILITY_TABLE_TOUR); | ||
}); | ||
return true; | ||
} | ||
return false; | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
/** | ||
* Example tour to interact with crop probability table | ||
* Steps are independent of station select tour to make it easier to handle tables that | ||
* will be loaded dynamically | ||
*/ | ||
export const CROP_PROBABILITY_TABLE_TOUR: ITourStep[] = [ | ||
{ | ||
customElement: { | ||
selector: 'section.table-container', | ||
}, | ||
text: translateMarker( | ||
'In the crop information table, you will be able to see the probabilities for different crops through the different seasons.' | ||
), | ||
}, | ||
|
||
{ | ||
id: 'season-start', | ||
text: translateMarker( | ||
'Crop probabilities depend on when the season starts.\nHere you can see the probabilities of the season starting at different dates' | ||
), | ||
}, | ||
{ | ||
customElement: { | ||
selector: 'tr[mat-header-row]:last-of-type', | ||
}, | ||
text: translateMarker( | ||
'Each row contains information about crop, variety, days to maturity and water requirement. Probabilities of receiving requirements are shown for different planting dates' | ||
), | ||
}, | ||
{ | ||
customElement: { | ||
autoScroll: false, | ||
selector: 'tbody>tr>td:nth-of-type(2)', | ||
}, | ||
text: translateMarker('Here we can see information for a specific crop variety'), | ||
}, | ||
{ | ||
customElement: { | ||
autoScroll: false, | ||
selector: 'tbody>tr>td:nth-of-type(3)', | ||
}, | ||
text: translateMarker('This is the number of days to maturity for the variety'), | ||
}, | ||
{ | ||
customElement: { | ||
autoScroll: false, | ||
selector: 'tbody>tr>td:nth-of-type(4)', | ||
}, | ||
text: translateMarker('This is water requirement for the variety'), | ||
}, | ||
{ | ||
customElement: { | ||
autoScroll: false, | ||
selector: 'tbody>tr>td:nth-of-type(5)', | ||
}, | ||
text: translateMarker( | ||
'The maturity and water requirements can be used to calculate the chance of satisfying these conditions for a specific planting date' | ||
), | ||
}, | ||
{ | ||
customElement: { | ||
selector: 'crop-probability-crop-select', | ||
}, | ||
text: translateMarker('The crop filter shows more information for specific crops'), | ||
}, | ||
{ | ||
text: translateMarker('Now you are ready to explore the crop information tool'), | ||
}, | ||
]; |
15 changes: 11 additions & 4 deletions
15
apps/picsa-tools/crop-probability-tool/src/app/pages/home/home.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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
<crop-probability-station-select | ||
[selectedStationId]="activeStation?.id" | ||
style="padding: 1em" | ||
></crop-probability-station-select> | ||
<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start"> | ||
<crop-probability-station-select | ||
[selectedStationId]="activeStation?.id" | ||
style="padding: 1em; margin-top: 1em" | ||
data-tour-id="station-select" | ||
></crop-probability-station-select> | ||
<button mat-button class="tour-button" color="primary" (click)="startTour()"> | ||
<mat-icon class="tour-icon mat-elevation-z4">question_mark</mat-icon> | ||
<span>{{ 'Demo' | translate }}</span> | ||
</button> | ||
</div> | ||
<crop-probability-table [activeStation]="activeStation" *ngIf="activeStation"></crop-probability-table> |
Oops, something went wrong.