Skip to content

Commit

Permalink
Merge pull request #2514 from IDEMSInternational/feat/popup-screen-or…
Browse files Browse the repository at this point in the history
…ientation-alt

feat: full screen template screen orientation tracking
  • Loading branch information
esmeetewinkel authored Nov 8, 2024
2 parents 7d20c59 + 64cf247 commit 9814642
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class TemplateMetadataService extends SyncServiceBase {
// subscribe to template name changes and load corresponding template parameter list on change
effect(
async () => {
const templateName = this.templateName();
// use full screen popup template if exists, or current template page if not
const templateName = this.templateService.standaloneTemplateName() || this.templateName();
const parameterList = templateName
? await this.templateService.getTemplateMetadata(templateName)
: {};
Expand Down
10 changes: 9 additions & 1 deletion src/app/shared/components/template/services/template.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from "@angular/core";
import { Injectable, signal } from "@angular/core";
import { LocalStorageService } from "src/app/shared/services/local-storage/local-storage.service";
import { AppDataService } from "src/app/shared/services/data/app-data.service";
import { DbService } from "src/app/shared/services/db/db.service";
Expand All @@ -19,6 +19,9 @@ import { SyncServiceBase } from "src/app/shared/services/syncService.base";
providedIn: "root",
})
export class TemplateService extends SyncServiceBase {
/** Name of any template running in fullscreen standalone mode */
public standaloneTemplateName = signal<string | undefined>(undefined);

constructor(
private localStorageService: LocalStorageService,
private appDataService: AppDataService,
Expand Down Expand Up @@ -80,6 +83,11 @@ export class TemplateService extends SyncServiceBase {
componentProps: { props },
});
await modal.present();

// track standalone template name so that template-meta.service can update loaded template params
this.standaloneTemplateName.set(templatename);
modal.onDidDismiss().then(() => this.standaloneTemplateName.set(undefined));

let dismissData: { emit_value?: string; emit_data?: any } = {};
if (props.waitForDismiss) {
const { data } = await modal.onDidDismiss();
Expand Down

0 comments on commit 9814642

Please sign in to comment.