Skip to content

Commit

Permalink
Merge pull request #335 from e-picsa/feat/seasonal-forecasts
Browse files Browse the repository at this point in the history
Feat: seasonal and downscaled forecasts
  • Loading branch information
chrismclarke authored Oct 15, 2024
2 parents 283911e + 9ac23d2 commit c6e71e9
Show file tree
Hide file tree
Showing 18 changed files with 1,034 additions and 254 deletions.
4 changes: 2 additions & 2 deletions apps/picsa-apps/extension-app-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "io.picsa.extension"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3047001
versionName "3.47.1"
versionCode 3048000
versionName "3.48.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class ExtensionToolkitMaterialModule {
'climate_tool',
'data_collection',
'discussions',
'farmer_activity',
'forecasts_tool',
'manual_tool',
'option_tool',
'play_store',
Expand All @@ -33,7 +35,6 @@ export class ExtensionToolkitMaterialModule {
'seasonal_calendar_tool',
'tutorial',
'whatsapp',
'farmer_activity',
];

for (const icon of icons) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,65 @@
<div #headerContent style="margin-right: 8px; display: flex; justify-content: flex-end">
<picsa-profile-select></picsa-profile-select>
<!-- TODO - decide if still useful to have multiple profiles now direct-to-farmer exists -->
<!-- <picsa-profile-select></picsa-profile-select> -->
</div>

<div class="page-content background-image">
<div class="link-grid">
@for (link of links; track $index) {
<div
[attr.data-tour-id]="link.tourId"
[attr.data-dev-only]="link.devOnly"
data-cy="link"
class="grid-tile"
(click)="linkClicked(link)"
>
<div style="text-align: center">
<mat-icon [svgIcon]="link.svgIcon" class="nav-icon"></mat-icon>
<div class="nav-text">{{ link.name | translate }}</div>
<div class="link-container">
<h2 class="section-header">
<div class="max-w-screen-lg m-auto">{{ 'Training' | translate }}</div>
</h2>
<div class="link-grid">
<!-- PICSA Links -->
@for (link of picsaLinks; track $index) {
<div
[attr.data-tour-id]="link.tourId"
[attr.data-dev-only]="link.devOnly"
data-cy="link"
class="grid-tile"
(click)="linkClicked(link)"
>
<div style="text-align: center">
<mat-icon [svgIcon]="link.svgIcon" class="nav-icon"></mat-icon>
<div class="nav-text">{{ link.name | translate }}</div>
</div>
@if (link.tourId==='monitoring' && monitoringService.pendingSyncCount>0) {
<div class="tile-badge mat-elevation-z8">{{ monitoringService.pendingSyncCount }}</div>
}
</div>
@if (link.tourId==='monitoring' && monitoringService.pendingSyncCount>0) {
<div class="tile-badge mat-elevation-z8">{{ monitoringService.pendingSyncCount }}</div>
}
</div>
}
<div class="grid-tile" (click)="startTour()" style="position: relative">
<div style="text-align: center">
<mat-icon svgIcon="extension_app:tutorial" class="nav-icon"></mat-icon>
<div class="nav-text">{{ 'Take App Tour' | translate }}</div>
<!-- Additional Links -->
<h2 class="section-header">
<div class="max-w-screen-lg m-auto">{{ 'Additional' | translate }}</div>
</h2>
<div class="link-grid">
@for (link of additionalLinks; track $index) {
<div
[attr.data-tour-id]="link.tourId"
[attr.data-dev-only]="link.devOnly"
data-cy="link"
class="grid-tile"
(click)="linkClicked(link)"
>
<div style="text-align: center">
<mat-icon [svgIcon]="link.svgIcon" class="nav-icon"></mat-icon>
<div class="nav-text">{{ link.name | translate }}</div>
</div>
@if (link.tourId==='monitoring' && monitoringService.pendingSyncCount>0) {
<div class="tile-badge mat-elevation-z8">{{ monitoringService.pendingSyncCount }}</div>
}
</div>
}
<!-- Dev Links -->

<!-- Tour -->

<!-- <div class="grid-tile" (click)="startTour()" style="position: relative">
<div style="text-align: center">
<mat-icon svgIcon="extension_app:tutorial" class="nav-icon"></mat-icon>
<div class="nav-text">{{ 'Take App Tour' | translate }}</div>
</div>
</div> -->
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,24 @@
z-index: -1;
opacity: 0.4;
}
.link-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
grid-auto-rows: max-content;
gap: 8px;
h2.section-header {
background: rgba(255, 255, 255, 0.8);
margin: 0;
padding: 8px 16px;
font-weight: 500;
border-top: 2px solid white;
border-bottom: 2px solid white;
color: black;
text-align: left;
}
.link-container {
flex: 1;
padding: 1rem;
margin-bottom: 3rem;
overflow-y: auto;
overflow-x: hidden;
max-height: calc(100vh - 136px);
max-height: calc(100vh - 102px);
overflow: auto;
}
.link-grid {
@apply grid gap-2 grid-cols-2 max-w-screen-lg m-auto;
@apply sm:grid-cols-4 sm:gap-4 sm:p-4 lg:grid-cols-6;
}

.grid-tile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,7 @@ const PAGE_LINKS: IPageLink[] = [
url: '/manual',
tourId: 'manual',
},
{
name: translateMarker('Farmer Activities'),
svgIcon: 'extension_app:farmer_activity',
url: '/farmer',
tourId: 'farmer',
},
{
name: translateMarker('Resources'),
svgIcon: 'extension_app:resources_tool',
url: '/resources',
tourId: 'resources',
},
{
name: translateMarker('Monitoring'),
svgIcon: 'extension_app:data_collection',
url: '/monitoring',
tourId: 'monitoring',
},

{
name: translateMarker('Climate'),
svgIcon: 'extension_app:climate_tool',
Expand Down Expand Up @@ -94,6 +77,47 @@ const PAGE_LINKS: IPageLink[] = [
// }
];

const ADDITIONAL_LINKS: IPageLink[] = [
{
name: translateMarker('Resources'),
svgIcon: 'extension_app:resources_tool',
url: '/resources',
tourId: 'resources',
},
{
name: translateMarker('Forecasts'),
svgIcon: 'extension_app:forecasts_tool',
// HACK - forecasts currently child resource collection
// TODO - move to standalone tool
url: '/resources/collection/weatherResources',
tourId: 'forecasts',
},
{
name: translateMarker('Farmer Activities'),
svgIcon: 'extension_app:farmer_activity',
url: '/farmer',
tourId: 'farmer',
},
{
name: translateMarker('Monitoring'),
svgIcon: 'extension_app:data_collection',
url: '/monitoring',
tourId: 'monitoring',
},

// {
// name: translateMarker('Discussions'),
// svgIcon: 'picsa_discussions',
// url: '/discussions',
// },

// {
// name: 'Settings',
// svgIcon: 'picsa_settings',
// url: '/settings'
// }
];

/** Additional links only available when running in non-production */
const DEV_PAGE_LINKS: IPageLink[] = [];
if (!ENVIRONMENT.production) {
Expand All @@ -119,7 +143,8 @@ if (!ENVIRONMENT.production) {
})
export class ExtensionHomeComponent implements AfterViewInit, OnDestroy {
/** List of home page display links, filtered when running in production */
public links = PAGE_LINKS;
public picsaLinks = PAGE_LINKS;
public additionalLinks = ADDITIONAL_LINKS;
public version = APP_VERSION;

@ViewChild('headerContent')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- TODO - should remove overlay and css from component to use in parent instead -->

<!-- TODO - should be able to refactor video item to be included here -->
<div style="position: relative; max-width: 854px; margin: auto">
<div style="position: relative; max-width: 854px; margin: auto; width: 100%">
@if(fileURI){
<resource-share class="share-link" [link]="dbDoc.url" [uri]="fileURI"></resource-share>
}
Expand Down
Loading

0 comments on commit c6e71e9

Please sign in to comment.