-
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.
feat: add support for shared data with icon packs
- Loading branch information
1 parent
2418e9a
commit 8ba33eb
Showing
30 changed files
with
195 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ footer { | |
} | ||
|
||
.nav-icon { | ||
width: 70px; | ||
width: auto; | ||
height: 70px; | ||
} | ||
.nav-text { | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion
6
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
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,3 +1,13 @@ | ||
# PICSA Data | ||
|
||
Hardcoded data shared across tools | ||
|
||
## Importing Icons | ||
|
||
Corresponding icons for any data collection need to be imported into the app `project.json` file | ||
Only import icon sets for the data used to save disk space | ||
|
||
```json | ||
{ "glob": "*.svg", "input": "libs/data/weather/svgs", "output": "assets/svgs/weather" }, | ||
{"glob": "*.svg", "input": "libs/data/crop_activity/svgs","output": "assets/svgs/crop_activity"}, | ||
``` |
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,60 @@ | ||
import { marker as translateMarker } from '@biesbjerg/ngx-translate-extract-marker'; | ||
import { IPicsaDataWithIcons } from '../models'; | ||
|
||
export const CROP_ACTIVITY_HASHMAP = { | ||
fertiliser_apply: { label: translateMarker('Apply Fertiliser') }, | ||
land_preparation: { label: translateMarker('Land Preparation') }, | ||
sowing: { label: translateMarker('Sowing') }, | ||
watering: { label: translateMarker('Watering') }, | ||
weeding: { label: translateMarker('Weeding') }, | ||
} as const; | ||
|
||
// Extract list of available weather names | ||
type CropActivityName = keyof typeof CROP_ACTIVITY_HASHMAP; | ||
|
||
// TODO - migrate budget tool to use | ||
// TODO - organise all data in similar format and add documentation about storing/using images | ||
|
||
export const CROP_ACTIVITY_DATA = Object.entries(CROP_ACTIVITY_HASHMAP).map(([id, { label }]) => { | ||
const data: IPicsaDataWithIcons = { | ||
assetIconPath: `assets/svgs/crop_activity/${id}.svg`, | ||
label: label as string, | ||
svgIcon: `picsa_crop_activity_${id}`, | ||
}; | ||
return { | ||
id: id as CropActivityName, | ||
...data, | ||
}; | ||
}); | ||
|
||
// TODO - should ideally migrate budget and include mapped options | ||
/** | ||
[ 'build-housing', | ||
'dipping', | ||
'feeding-livestock', | ||
'provide-supplements', | ||
'provide-water', | ||
'relocation', | ||
'transport-livestock', | ||
'vaccinate', | ||
'apply-fertiliser', | ||
'apply-pesticide', | ||
'bagging', | ||
'banding', | ||
'compost-manure-making', | ||
'harvesting', | ||
'land-clearing', | ||
'mulching', | ||
'ploughing', | ||
'post-harvest-handling', | ||
'shelling', | ||
'sowing', | ||
'storage', | ||
'threshing', | ||
'transport', | ||
'watering', | ||
'weeding', | ||
'marketing-and-selling', | ||
'value-addition', | ||
'purchase' ] | ||
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.