Skip to content

Commit

Permalink
feat: add seasonal calendar to extension app
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Sep 24, 2023
1 parent 2651cb3 commit 228df75
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 3 deletions.
8 changes: 7 additions & 1 deletion apps/picsa-apps/extension-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@
"input": "apps/picsa-tools/monitoring-tool/src/assets",
"output": "assets"
},

{
"glob": "**/*",
"input": "apps/picsa-tools/option-tool/src/assets",
"output": "assets"
},
{
"glob": "**/*",
"input": "apps/picsa-tools/resources-tool/src/assets",
"output": "assets"
},
{
"glob": "**/*",
"input": "apps/picsa-tools/option-tool/src/assets",
"input": "apps/picsa-tools/seasonal-calendar-tool/src/assets",
"output": "assets"
},
{
Expand Down
7 changes: 7 additions & 0 deletions apps/picsa-apps/extension-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ManualToolModule } from '@picsa/manual/src/app/app.module-embedded';
import { MonitoringToolModule } from '@picsa/monitoring/src/app/app.module-embedded';
import { OptionsToolModule } from '@picsa/option/src/app/app.module-embedded';
import { ResourcesToolModule } from '@picsa/resources/src/app/app.module-embedded';
import { SeasonalCalendarToolModule } from '@picsa/seasonal-calendar/src/app/app.module-embedded';

const routes: Routes = [
// support embed of budget tool app
Expand Down Expand Up @@ -41,6 +42,11 @@ const routes: Routes = [
path: 'resources',
loadChildren: () => import('@picsa/resources/src/app/app.module-embedded').then((mod) => mod.ResourcesToolModule),
},
{
path: 'seasonal-calendar',
loadChildren: () =>
import('@picsa/seasonal-calendar/src/app/app.module-embedded').then((mod) => mod.SeasonalCalendarToolModule),
},
{
path: '',
loadChildren: () => import('./pages/home/home.module').then((mod) => mod.HomePageModule),
Expand Down Expand Up @@ -75,6 +81,7 @@ const routes: Routes = [
MonitoringToolModule.forRoot({ urlPrefix: 'monitoring' }),
OptionsToolModule.forRoot({ urlPrefix: 'option' }),
ResourcesToolModule.forRoot({ urlPrefix: 'resources' }),
SeasonalCalendarToolModule.forRoot({ urlPrefix: 'seasonal-calendar' }),
],
exports: [RouterModule],
})
Expand Down
1 change: 1 addition & 0 deletions apps/picsa-apps/extension-app/src/app/material.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class ExtensionToolkitMaterialModule {
play_store: 'play_store',
probability_tool: 'probability_tool',
resources_tool: 'resources_tool',
seasonal_calendar_tool: 'seasonal_calendar_tool',
tutorial: 'tutorial',
whatsapp: 'whatsapp',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<div
*ngFor="let link of links"
[attr.data-tour-id]="link.tourId"
[attr.data-dev-only]="link.devOnly"
data-cy="link"
class="grid-tile"
(click)="linkClicked(link)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
font-size: 18px;
padding: 16px 8px 8px 8px;
}
.grid-tile[data-dev-only='true'] {
background: rgba(0, 0, 0, 0.35);
}
.grid-tile:hover {
transform: scale(1.02);
transition: all 0.3s ease-out;
Expand Down
14 changes: 12 additions & 2 deletions apps/picsa-apps/extension-app/src/app/pages/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from '@ang
import { Router } from '@angular/router';
import { marker as translateMarker } from '@biesbjerg/ngx-translate-extract-marker';
import { PicsaCommonComponentsService } from '@picsa/components/src';
import { APP_VERSION } from '@picsa/environments';
import { APP_VERSION, ENVIRONMENT } from '@picsa/environments';
import { TourService } from '@picsa/shared/services/core/tour.service';
import { CommunicationService } from '@picsa/shared/services/promptToHomePageService.service';
import { Subscription } from 'rxjs';
Expand All @@ -16,6 +16,8 @@ interface IPageLink {
url: string;
/** Element ID used in tours */
tourId: string;
/** Specify if only shown in dev mode */
devOnly?: boolean;
}

const PAGE_LINKS: IPageLink[] = [
Expand Down Expand Up @@ -61,6 +63,13 @@ const PAGE_LINKS: IPageLink[] = [
url: '/option',
tourId: 'option',
},
{
name: translateMarker('Seasonal Calendar'),
icon: 'picsa_seasonal_calendar_tool',
url: '/seasonal-calendar',
tourId: 'seasonal-calendar',
devOnly: true,
},

// {
// name: translateMarker('Discussions'),
Expand All @@ -81,7 +90,8 @@ const PAGE_LINKS: IPageLink[] = [
styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnDestroy, AfterViewInit {
public links = PAGE_LINKS;
/** List of home page display links, filtered when running in production */
public links = PAGE_LINKS.filter((link) => (ENVIRONMENT.production ? !link.devOnly : link));
public version = APP_VERSION;

private userEventSubscription: Subscription;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 228df75

Please sign in to comment.