Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: merge changes from master #2526

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
24c4caa
feat(wip): youtube component
jfmcquade Oct 28, 2024
e389537
chore: add custom query params to youtube embed url
jfmcquade Oct 28, 2024
18ce79d
Merge branch 'master' into feat/youtube-component
jfmcquade Oct 28, 2024
383e70c
Merge branch 'master' into feat/youtube-component
esmeetewinkel Oct 28, 2024
00a5304
chore: youtube component now takes full youtube URL rather than video ID
jfmcquade Oct 29, 2024
c8c5ba8
chore: youtube component extracts lan
jfmcquade Oct 29, 2024
599d1ca
chore: fix comment
jfmcquade Oct 29, 2024
1dce670
feat: add screen_orientation action
jfmcquade Oct 29, 2024
6498b46
chore(screen_orienation): update native build files
jfmcquade Oct 29, 2024
c5a6fe1
Merge branch 'master' into feat/youtube-component
chrismclarke Oct 29, 2024
b37ca0d
refactor: youtube component
chrismclarke Oct 29, 2024
df9a9d1
chore: add type-checking to youtube query params setting
jfmcquade Oct 30, 2024
c9ec120
chore: tidy up dynamic prefix types
chrismclarke Oct 30, 2024
9d1ae49
chore: items code tidying
chrismclarke Oct 30, 2024
93f3269
Merge pull request #2493 from IDEMSInternational/review/2490
chrismclarke Oct 30, 2024
e152dac
Merge branch 'master' into feat/youtube-component
chrismclarke Oct 30, 2024
5ea35ef
chore: code tidying
chrismclarke Oct 30, 2024
6761ce1
Merge pull request #2490 from IDEMSInternational/feat/youtube-component
jfmcquade Oct 30, 2024
9be0cfa
Merge branch 'master' into feat/screen-orientation
jfmcquade Oct 30, 2024
af59326
chore: code tidy
jfmcquade Oct 30, 2024
10e15a2
chore(screen-orientation): remove unused methods
jfmcquade Oct 31, 2024
0b958d3
Merge branch 'master' into feat/screen-orientation
jfmcquade Oct 31, 2024
504106a
fix: text bubble component handles markdown
jfmcquade Oct 31, 2024
2fae4b4
chore: tidy template page code
jfmcquade Oct 31, 2024
dd4f459
Merge pull request #2495 from IDEMSInternational/feat/screen-orientation
esmeetewinkel Oct 31, 2024
cf82542
Merge branch 'master' into fix/text-bubble-markdown
esmeetewinkel Oct 31, 2024
861a1fe
feat(wip): add landscape query param to track template metadata property
jfmcquade Oct 31, 2024
b8f4fc0
refactor: move template metadata logic to dedicated service
jfmcquade Oct 31, 2024
0e71f21
Merge branch 'master' into chore/items-code-tidying
jfmcquade Oct 31, 2024
8937378
feat: set screen orientation based on 'landscape' queryParam
jfmcquade Nov 1, 2024
a0391ea
fix(screen-orientation): fix service init; finish refactoring to asyn…
jfmcquade Nov 2, 2024
a54a15b
Merge branch 'master' into feat/landscape-mode
jfmcquade Nov 2, 2024
baca954
style: new display group variant, 'box_white'
jfmcquade Nov 4, 2024
6827cdc
style: make border default gray for professional and plh_kids_kw themes
jfmcquade Nov 4, 2024
6d00e30
chore: expose 'border-color-default' theme variable
jfmcquade Nov 4, 2024
85f06f6
style: tweak display group white variatn border colour
jfmcquade Nov 4, 2024
a486514
chore: deployment clone progress
chrismclarke Nov 4, 2024
9025a25
chore: code tidying
chrismclarke Nov 4, 2024
de1d276
chore: fix linebreaks
chrismclarke Nov 4, 2024
569234b
chore: code tidying
chrismclarke Nov 4, 2024
b1ff746
Merge pull request #2494 from IDEMSInternational/chore/items-code-tid…
chrismclarke Nov 4, 2024
1b94343
Merge branch 'master' into feat/deployment-import-progress
esmeetewinkel Nov 5, 2024
0ea2a93
Merge branch 'master' into fix/text-bubble-markdown
jfmcquade Nov 5, 2024
a2686a8
Merge branch 'master' into fix/linebreaks
esmeetewinkel Nov 5, 2024
32c5dde
refactor(text-bubble): better handling of padding around child text c…
jfmcquade Nov 5, 2024
72d51eb
chore: code tidy
jfmcquade Nov 5, 2024
213a88a
chore: rename theme css variable '--ion-border-*' -> '--border-*'
jfmcquade Nov 5, 2024
40791dd
chore: expose '--border-width-default' theme variable; make border-wi…
jfmcquade Nov 5, 2024
f0087ad
chore: fix typo
jfmcquade Nov 5, 2024
44492af
Merge pull request #2505 from IDEMSInternational/feat/deployment-impo…
esmeetewinkel Nov 5, 2024
b3d961f
Merge branch 'master' into feat/landscape-mode
jfmcquade Nov 5, 2024
e47f9c4
refactor: screen orientation logic
jfmcquade Nov 5, 2024
2ad3817
refactor: screen orientation logic
jfmcquade Nov 5, 2024
0b385dd
Merge branch 'master' into fix/linebreaks
chrismclarke Nov 5, 2024
44e92bd
Merge pull request #2506 from IDEMSInternational/fix/linebreaks
chrismclarke Nov 5, 2024
178d670
Merge branch 'master' into style/professional-theme-border-colour
esmeetewinkel Nov 6, 2024
4fa9754
chore: code tidy
jfmcquade Nov 6, 2024
8363708
Merge branch 'master' into feat/landscape-mode
jfmcquade Nov 6, 2024
e26f0c9
Merge branch 'master' into fix/text-bubble-markdown
chrismclarke Nov 6, 2024
0aa5474
Merge pull request #2498 from IDEMSInternational/fix/text-bubble-mark…
chrismclarke Nov 6, 2024
a94528d
Merge branch 'master' into style/professional-theme-border-colour
chrismclarke Nov 6, 2024
565edcc
Merge pull request #2503 from IDEMSInternational/style/professional-t…
chrismclarke Nov 6, 2024
7938002
chore: code tidying
chrismclarke Nov 7, 2024
5eefc8c
refactor: orientation service
chrismclarke Nov 7, 2024
9dcba43
refactor: template metadata service
chrismclarke Nov 7, 2024
68e3e2f
Merge branch 'master' into feat/landscape-mode
chrismclarke Nov 7, 2024
8b18b2b
Merge pull request #2509 from IDEMSInternational/review/2501
jfmcquade Nov 7, 2024
72e5314
feat: add 'screen_orientation: unlock' action
jfmcquade Nov 7, 2024
480cb61
Merge branch 'master' into feat/display-group-variant-box-white
jfmcquade Nov 7, 2024
b2d3105
style: use theme variables for styling display group box variants' bo…
jfmcquade Nov 7, 2024
a01830c
Merge pull request #2504 from IDEMSInternational/feat/display-group-v…
esmeetewinkel Nov 7, 2024
28188cc
Merge branch 'master' into feat/landscape-mode
esmeetewinkel Nov 7, 2024
cdff496
Merge pull request #2501 from IDEMSInternational/feat/landscape-mode
chrismclarke Nov 7, 2024
d597e3e
ci: bump version to 0.16.38
jfmcquade Nov 7, 2024
840da1c
feat: full screen template screen orientation tracking
chrismclarke Nov 8, 2024
7d20c59
Merge pull request #2512 from IDEMSInternational/ci/v01638
esmeetewinkel Nov 8, 2024
64cf247
Merge branch 'master' into feat/popup-screen-orientation-alt
esmeetewinkel Nov 8, 2024
9814642
Merge pull request #2514 from IDEMSInternational/feat/popup-screen-or…
esmeetewinkel Nov 8, 2024
d19042c
fix: seo service config
chrismclarke Nov 9, 2024
b2dbc94
chore: update local demo sheet
chrismclarke Nov 9, 2024
3ce4cd1
Merge pull request #2518 from IDEMSInternational/chore/demo-sheet-update
esmeetewinkel Nov 11, 2024
f604ed0
Merge branch 'master' into fix/seo-service-config
chrismclarke Nov 11, 2024
e08b52c
Merge pull request #2517 from IDEMSInternational/fix/seo-service-config
chrismclarke Nov 11, 2024
79c9298
Merge branch 'master' into deployment_dev/conflict_forecast
jfmcquade Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .idems_app/deployments/local/sheets/demo.xlsx
Git LFS file not shown
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
implementation project(':capacitor-filesystem')
implementation project(':capacitor-local-notifications')
implementation project(':capacitor-push-notifications')
implementation project(':capacitor-screen-orientation')
implementation project(':capacitor-share')
implementation project(':capacitor-splash-screen')
implementation project(':capawesome-capacitor-app-update')
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"pkg": "@capacitor/push-notifications",
"classpath": "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin"
},
{
"pkg": "@capacitor/screen-orientation",
"classpath": "com.capacitorjs.plugins.screenorientation.ScreenOrientationPlugin"
},
{
"pkg": "@capacitor/share",
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ project(':capacitor-local-notifications').projectDir = new File('../node_modules
include ':capacitor-push-notifications'
project(':capacitor-push-notifications').projectDir = new File('../node_modules/@capacitor/push-notifications/android')

include ':capacitor-screen-orientation'
project(':capacitor-screen-orientation').projectDir = new File('../node_modules/@capacitor/screen-orientation/android')

include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')

Expand Down
1 change: 1 addition & 0 deletions cspell.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"tmpl",
"venv",
"viewbox",
"youtube",
]
# flagWords - list of words to be always considered incorrect
# This is useful for offensive words and common spelling errors.
Expand Down
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def capacitor_pods
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications'
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
pod 'CapacitorScreenOrientation', :path => '../../node_modules/@capacitor/screen-orientation'
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapawesomeCapacitorAppUpdate', :path => '../../node_modules/@capawesome/capacitor-app-update'
Expand Down
8 changes: 7 additions & 1 deletion ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ PODS:
- Capacitor
- CapacitorPushNotifications (6.0.2):
- Capacitor
- CapacitorScreenOrientation (6.0.2):
- Capacitor
- CapacitorShare (6.0.2):
- Capacitor
- CapacitorSplashScreen (6.0.2):
Expand Down Expand Up @@ -162,6 +164,7 @@ DEPENDENCIES:
- "CapacitorFirebasePerformance (from `../../node_modules/@capacitor-firebase/performance`)"
- "CapacitorLocalNotifications (from `../../node_modules/@capacitor/local-notifications`)"
- "CapacitorPushNotifications (from `../../node_modules/@capacitor/push-notifications`)"
- "CapacitorScreenOrientation (from `../../node_modules/@capacitor/screen-orientation`)"
- "CapacitorShare (from `../../node_modules/@capacitor/share`)"
- "CapacitorSplashScreen (from `../../node_modules/@capacitor/splash-screen`)"
- "CapawesomeCapacitorAppUpdate (from `../../node_modules/@capawesome/capacitor-app-update`)"
Expand Down Expand Up @@ -218,6 +221,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@capacitor/local-notifications"
CapacitorPushNotifications:
:path: "../../node_modules/@capacitor/push-notifications"
CapacitorScreenOrientation:
:path: "../../node_modules/@capacitor/screen-orientation"
CapacitorShare:
:path: "../../node_modules/@capacitor/share"
CapacitorSplashScreen:
Expand All @@ -239,6 +244,7 @@ SPEC CHECKSUMS:
CapacitorFirebasePerformance: c806ce7f8270295465c050210d8e8a4ae2dc282e
CapacitorLocalNotifications: 6bac9e948b2b8852506c6d74abb2cde140250f86
CapacitorPushNotifications: ccd797926c030acad3d5498ef452c735c90a2c89
CapacitorScreenOrientation: 6039dc2ea4a8596b79316709d5727e8bb7e32845
CapacitorShare: 591ae4693d85686ceb590db8e8b44aa014ec6490
CapacitorSplashScreen: 250df9ef8014fac5c7c1fd231f0f8b1d8f0b5624
CapawesomeCapacitorAppUpdate: 3c05b5c8e42f9c6a88d666093406e9336d9bfdb1
Expand All @@ -264,6 +270,6 @@ SPEC CHECKSUMS:
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21

PODFILE CHECKSUM: a6362e50008bd5aea904cdd9ec858da94a7f155c
PODFILE CHECKSUM: 131ec70809fe3dec63113a003a42e6009560dcef

COCOAPODS: 1.15.2
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.16.37",
"version": "0.16.38",
"author": "IDEMS International",
"license": "See LICENSE",
"homepage": "https://idems.international/",
Expand Down Expand Up @@ -54,6 +54,7 @@
"@capacitor/ios": "^6.0.0",
"@capacitor/local-notifications": "^6.0.0",
"@capacitor/push-notifications": "^6.0.0",
"@capacitor/screen-orientation": "^6.0.2",
"@capacitor/share": "^6.0.0",
"@capacitor/splash-screen": "^6.0.0",
"@capawesome/capacitor-app-update": "^6.0.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/data-models/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ import { IAppSkin } from "./skin.model";
* special use case for relative paths
********************************************************************************************/

const DYNAMIC_PREFIXES = [
"local",
"field",
"fields",
"global",
"data",
"campaign",
"calc",
"item",
"raw",
] as const;

const APP_LANGUAGES = {
/** Language used during first load. If translations do not exist will default to source strings (gb_en) */
default: "gb_en",
Expand Down Expand Up @@ -216,7 +204,6 @@ const APP_CONFIG = {
APP_THEMES,
APP_UPDATES,
ASSET_PACKS,
DYNAMIC_PREFIXES,
FEEDBACK_MODULE_DEFAULTS,
NOTIFICATIONS_SYNC_FREQUENCY_MS,
NOTIFICATION_DEFAULTS,
Expand Down
31 changes: 27 additions & 4 deletions packages/data-models/flowTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint @typescript-eslint/sort-type-constituents: "warn" */

import type { IDataPipeOperation } from "shared";
import type { IAppConfig } from "./appConfig";
import type { IAssetEntry } from "./assets.model";

/*********************************************************************************************
Expand Down Expand Up @@ -315,7 +314,8 @@ export namespace FlowTypes {
| "toggle_bar"
| "update_action_list"
| "video"
| "workshops_accordion";
| "workshops_accordion"
| "youtube";

export interface TemplateRow extends Row_with_translations {
type: TemplateRowType;
Expand All @@ -340,7 +340,7 @@ export namespace FlowTypes {
/** Keep a list of dynamic dependencies used within a template, by reference (e.g. {@local.var1 : ["text_1"]}) */
_dynamicDependencies?: { [reference: string]: string[] };
_translatedFields?: { [field: string]: any };
_evalContext?: { itemContext: TemplateRowItemEvalContext }; // force specific context variables when calculating eval statements (such as loop items)
_evalContext?: any; // force specific context variables when calculating eval statements (such as loop items)
__EMPTY?: any; // empty cells (can be removed after pr 679 merged)
}

Expand All @@ -362,7 +362,26 @@ export namespace FlowTypes {
[key: string]: any;
};

type IDynamicPrefix = IAppConfig["DYNAMIC_PREFIXES"][number];
const DYNAMIC_PREFIXES_COMPILER = ["gen", "row", "default"] as const;

const DYNAMIC_PREFIXES_RUNTIME = [
"local",
"field",
"fields",
"global",
"data",
"campaign",
"calc",
"item",
"raw",
] as const;

export const DYNAMIC_PREFIXES = [
...DYNAMIC_PREFIXES_COMPILER,
...DYNAMIC_PREFIXES_RUNTIME,
] as const;

export type IDynamicPrefix = (typeof DYNAMIC_PREFIXES)[number];

/** Data passed back from regex match, e.g. expression @local.someField => type:local, fieldName: someField */
export interface TemplateRowDynamicEvaluator {
Expand Down Expand Up @@ -415,9 +434,13 @@ export namespace FlowTypes {
"process_template",
"reset_app",
"save_to_device",
"screen_orientation",
"set_field",
/** NOTE - only available from with data_items loop */
"set_item",
/** NOTE - only available from with data_items loop */
"set_items",
"set_data",
"set_local",
"share",
"style",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-models/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function extractDynamicEvaluators(
type = "raw";
}
// cross-check to ensure lookup matches one of the pre-defined dynamic field types (e.g. not [email protected])
if (!appConfigDefault.DYNAMIC_PREFIXES.includes(type)) {
if (!FlowTypes.DYNAMIC_PREFIXES.includes(type)) {
return undefined;
}
return { fullExpression, matchedExpression, type, fieldName };
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/commands/app-data/convert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default program
*/
export class AppDataConverter {
/** Change version to invalidate all underlying caches */
public version = 20231002.0;
public version = 20241104.0;

public activeDeployment = ActiveDeployment.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function extractDynamicDependencies(dynamicFields: FlowTypes.TemplateRow[
}

// Standardise newline characters within a string (i.e. replace "\r\n" (CRLF) with "\n" (LF))
// also replace any remaining \r with \n (https://github.com/IDEMSInternational/open-app-builder/issues/2499)
export function standardiseNewlines(str: string) {
return str.replace(/\\r\\n/g, "\\n");
return str.replace(/\\r\\n/g, "\\n").replace(/\\r/g, "\\n");
}
12 changes: 10 additions & 2 deletions packages/scripts/src/tasks/providers/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import chalk from "chalk";
import fs from "fs-extra";
import path from "path";
import semver from "semver";
import logUpdate from "log-update";
import simpleGit, { ResetMode } from "simple-git";
import type { SimpleGit, FileStatusResult } from "simple-git";
import { Project, SyntaxKind } from "ts-morph";
import { ActiveDeployment } from "../../commands/deployment/get";
import { Logger, logOutput, openUrl, promptOptions } from "../../utils";
import type { IDeploymentConfigJson } from "../../commands/deployment/common";
import { pad, PATHS } from "shared";

class GitProvider {
private git: SimpleGit;
Expand All @@ -20,8 +22,14 @@ class GitProvider {

/** Access git clone methods directly independent of deployment */
public async cloneRepo(repoPath: string, localPath: string) {
const git = simpleGit();
return git.clone(repoPath, localPath);
console.log("\n");
const git = simpleGit(PATHS.DEPLOYMENTS_PATH, {
progress: ({ stage, progress, processed, total }) =>
logUpdate(chalk.gray(`${stage} | ${pad(progress, 2)}% | ${processed}/${total}`)),
});
const res = await git.clone(repoPath, localPath);
logUpdate.done();
return res;
}

/** Pull latest content from remote repo into local branch. Attempt to resolve any conflicts */
Expand Down
8 changes: 7 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import { FeedbackService } from "./feature/feedback/feedback.service";
import { ShareService } from "./shared/services/share/share.service";
import { LocalStorageService } from "./shared/services/local-storage/local-storage.service";
import { DeploymentService } from "./shared/services/deployment/deployment.service";
import { ScreenOrientationService } from "./shared/services/screen-orientation/screen-orientation.service";
import { TemplateMetadataService } from "./shared/components/template/services/template-metadata.service";

@Component({
selector: "app-root",
Expand Down Expand Up @@ -89,6 +91,7 @@ export class AppComponent {
private tourService: TourService,
private templateService: TemplateService,
private templateFieldService: TemplateFieldService,
private templateMetadataService: TemplateMetadataService,
private templateProcessService: TemplateProcessService,
private appEventService: AppEventService,
private campaignService: CampaignService,
Expand All @@ -111,7 +114,8 @@ export class AppComponent {
private appUpdateService: AppUpdateService,
private remoteAssetService: RemoteAssetService,
private shareService: ShareService,
private fileManagerService: FileManagerService
private fileManagerService: FileManagerService,
private screenOrientationService: ScreenOrientationService
) {
this.initializeApp();
}
Expand Down Expand Up @@ -249,6 +253,8 @@ export class AppComponent {
this.feedbackService,
this.shareService,
this.fileManagerService,
this.templateMetadataService,
this.screenOrientationService,
],
deferred: [this.analyticsService],
implicit: [
Expand Down
18 changes: 8 additions & 10 deletions src/app/feature/template/template.page.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<ion-content [scrollEvents]="shouldEmitScrollEvents">
<plh-template-container
*ngIf="templateName"
[templatename]="templateName"
></plh-template-container>
<div *ngIf="!templateName" class="ion-padding">
@if (templateName) {
<plh-template-container [templatename]="templateName"></plh-template-container>
} @else {
<div class="ion-padding">
<h3>Select a Template</h3>
<ion-searchbar [(ngModel)]="filterTerm" (ionInput)="search()"></ion-searchbar>
<ion-list>
<ion-item
*ngFor="let template of filteredTemplates; trackBy: trackByFn"
[routerLink]="template.flow_name"
>{{template.flow_name}}</ion-item
>
@for(template of filteredTemplates; track $index) {
<ion-item [routerLink]="template.flow_name">{{template.flow_name}}</ion-item>
}
</ion-list>
</div>
}
</ion-content>
17 changes: 10 additions & 7 deletions src/app/feature/template/template.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class TemplatePage implements OnInit, OnDestroy {
filteredTemplates: FlowTypes.FlowTypeBase[] = [];
appConfigChanges$: Subscription;
shouldEmitScrollEvents: boolean = false;

constructor(
private route: ActivatedRoute,
private appDataService: AppDataService,
Expand All @@ -26,21 +27,23 @@ export class TemplatePage implements OnInit, OnDestroy {

ngOnInit() {
this.templateName = this.route.snapshot.params.templateName;
const allTemplates = this.appDataService.listSheetsByType("template");
this.allTemplates = allTemplates.sort((a, b) => (a.flow_name > b.flow_name ? 1 : -1));
this.filteredTemplates = allTemplates;
if (!this.templateName) {
this.listTemplates();
}
this.subscribeToAppConfigChanges();
}

search() {
this.allTemplates = this.allTemplates;
public search() {
this.filteredTemplates = this.allTemplates.filter(
(i) => i.flow_name.toLocaleLowerCase().indexOf(this.filterTerm.toLowerCase()) > -1
);
}

trackByFn(index) {
return index;
/** Create a list of all templates to display when no specific template loaded */
private listTemplates() {
const allTemplates = this.appDataService.listSheetsByType("template");
this.allTemplates = allTemplates.sort((a, b) => (a.flow_name > b.flow_name ? 1 : -1));
this.filteredTemplates = allTemplates;
}

private subscribeToAppConfigChanges() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Create overlapping effect
ion-accordion {
background: white;
border: 1px solid var(--ion-color-primary);
border: var(--border-standard);
border-radius: 10px;
margin-top: -12px;
padding-top: 8px;
Expand Down
Loading
Loading