Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…pp-builder into feat/bottom-nav
  • Loading branch information
FaithDaka committed Nov 12, 2024
2 parents 939f6d9 + e08b52c commit 7914421
Show file tree
Hide file tree
Showing 45 changed files with 292 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs pre-push "$@"
4 changes: 2 additions & 2 deletions .idems_app/deployments/local/sheets/demo.xlsx
Git LFS file not shown
2 changes: 1 addition & 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
1 change: 0 additions & 1 deletion 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
3 changes: 3 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ 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 @@ -90,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 Down Expand Up @@ -251,6 +253,7 @@ export class AppComponent {
this.feedbackService,
this.shareService,
this.fileManagerService,
this.templateMetadataService,
this.screenOrientationService,
],
deferred: [this.analyticsService],
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $control-background: var(--audio-control-background, var(--ion-color-primary-500

.container-player[data-variant~="compact"] {
background: white;
border: var(--ion-border-standard);
border: var(--border-standard);
box-sizing: border-box;
box-shadow: var(--ion-default-box-shadow);
border-radius: var(--ion-border-radius-standard);
Expand Down Expand Up @@ -87,7 +87,7 @@ $control-background: var(--audio-control-background, var(--ion-color-primary-500

.container-player[data-variant~="large"] {
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
box-sizing: border-box;
box-shadow: var(--ion-default-box-shadow);
border-radius: var(--ion-border-radius-standard);
Expand Down Expand Up @@ -134,7 +134,7 @@ $control-background: var(--audio-control-background, var(--ion-color-primary-500
}

ion-range::part(bar) {
border: var(--ion-border-thin-standard);
border: var(--border-thin-standard);
height: var(--audio-bar-height);
}

Expand Down Expand Up @@ -187,4 +187,4 @@ $control-background: var(--audio-control-background, var(--ion-color-primary-500
}
.disabled {
pointer-events: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $background-with-value: var(
padding: 0;
.text-box-input {
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
border-radius: var(--ion-border-radius-secondary);
width: 100%;
min-height: 55px;
Expand Down Expand Up @@ -55,7 +55,7 @@ $background-with-value: var(
min-height: 55px;
width: 100%;
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
border-radius: var(--ion-border-radius-secondary);
box-shadow: var(--ion-default-box-shadow);
@include mixins.flex-centered;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $background-with-value: var(
.open-combobox {
outline: none;
width: 100%;
border: var(--ion-border-standard);
border: var(--border-standard);
box-sizing: border-box;
filter: drop-shadow(var(--ion-default-box-shadow));
border-radius: var(--ion-border-radius-secondary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $background-highlight: var(
.accordion-status {
@include mixins.medium-square;
border-radius: var(--ion-border-radius-rounded);
border: var(--ion-border-thin-standard);
border: var(--border-thin-standard);
padding: var(--tiny-padding);
background: var(--ion-color-primary-contrast);
display: flex;
Expand Down Expand Up @@ -43,7 +43,7 @@ $background-highlight: var(
border-radius: var(--ion-border-radius-standard);
overflow: hidden;
padding: var(--small-padding);
border: var(--ion-border-thin-standard);
border: var(--border-thin-standard);
transition: max-height 0.4s;
overflow-y: hidden;
&.completed {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$border: var(--ion-border-standard);
$border: var(--border-standard);
$border-radius: var(--ion-border-radius-standard, 15px);

.display-grid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
.display-group-wrapper {
&[data-variant~="box_gray"],
&[data-variant~="box_primary"],
&[data-variant~="box_secondary"] {
&[data-variant~="box_secondary"],
&[data-variant~="box_white"] {
margin-top: var(--regular-margin);
padding: var(--regular-padding);
border-radius: var(--ion-border-radius-secondary);
flex: 1;
background-color: var(--background-color, transparent);
border: 2px solid var(--border-color, transparent);
border: var(--border-standard);
border-color: var(--border-color);
}

&[data-variant~="box_gray"] {
Expand All @@ -68,4 +70,9 @@
--background-color: var(--ion-color-secondary-200);
--border-color: var(--ion-color-secondary-500);
}

&[data-variant~="box_white"] {
--background-color: white;
--border-color: var(--border-color-default, var(--ion-color-primary));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNumberParamFromTemplateRow, getStringParamFromTemplateRow } from "..

interface IDisplayGroupParams {
/** TEMPLATE PARAMETER: "variant" */
variant: "box_gray" | "box_primary" | "box_secondary" | "dashed_box";
variant: "box_gray" | "box_primary" | "box_secondary" | "box_white" | "dashed_box";
/** TEMPLATE PARAMETER: "style". TODO: Various additional legacy styles, review and convert some to variants */
style: "form" | "default" | string | null;
/** TEMPLATE PARAMETER: "offset". Add a custom bottom margin */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.container {
width: calc(100% - 10px);
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
box-shadow: var(--ion-default-box-shadow);
border-radius: var(--ion-border-radius-secondary);
@include mixins.flex-space-between;
Expand All @@ -24,7 +24,7 @@
--background: transparent;
--box-shadow: none;
border-radius: var(--ion-border-radius-rounded);
border: var(--ion-border-standard);
border: var(--border-standard);
@include mixins.tiny-square;
@include mixins.flex-centered;
.line {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $background-selected: var(
--radio-group-background-selected,
var(--gradient-primary-light-vertical)
);
$border: var(--ion-border-standard);
$border: var(--border-standard);
$border-radius: var(--ion-border-radius-standard);
$text-size: var(--radio-button-font-size, 1.25rem);
$text-color: var(--radio-button-font-color, var(--ion-color-primary));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ img {
}
.checked {
transition: 0.3s linear;
border: var(--ion-border-standard);
border: var(--border-standard);
box-shadow: var(--ion-default-box-shadow);
}
}
Expand All @@ -110,7 +110,7 @@ img {
max-width: fit-content;
min-width: 100%;
box-shadow: var(--ion-default-box-shadow);
border: var(--ion-border-standard);
border: var(--border-standard);
color: var(--ion-color-primary);
background: var(--ion-color-primary-contrast);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ui-color: var(--slider-ui-color, var(--ion-color-primary-700));
min-width: 100%;
padding: var(--regular-padding) 0 var(--regular-padding) var(--regular-padding);
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
box-sizing: border-box;
box-shadow: var(--ion-default-box-shadow);
border-radius: var(--ion-border-radius-secondary);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.wrapper {
.text_area {
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
font-size: var(--text-box-font-size);
color: var(--ion-color-primary);
font-weight: var(--font-weight-bold);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.wrapper {
.text-box-input {
background: var(--ion-color-primary-contrast);
border: var(--ion-border-standard);
border: var(--border-standard);
width: 100%;
height: var(--text-box-height);
font-size: var(--text-box-font-size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
>
<div class="text-bubble" [attr.data-position]="params.speakerPosition">
@if (_row.value) {
<p class="text">
{{ _row.value }}
</p>
<plh-tmpl-text
[row]="{ _nested_name: '', name: '', type: 'text', value: value() }"
></plh-tmpl-text>
}
@for (childRow of _row.rows | filterDisplayComponent; track trackByRow($index, childRow)) {
<plh-template-component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ $imageSize: 64px;

.text-bubble {
padding: var(--large-padding);
p {
line-height: inherit;
margin: 0;
font-size: var(--font-size-text-large);
color: var(--ion-color-primary);

// Override default margins of child text component:
// handle with padding on this parent element instead
plh-tmpl-text {
--margin-text: 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if (this._row.value) {
<div
class="large standard normal margin-t-large"
class="large standard normal"
[class]="params.style"
[ngStyle]="!hasTextValue ? { display: 'none' } : { display: 'block' }"
[innerHTML]="
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host {
// Default value for top and bottom margins. Can be overridden in parent component
// styles if calling the text component as a child of another component
--margin-text: 0.75em;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ITextParams {
@Component({
selector: "plh-tmpl-text",
templateUrl: "./text.component.html",
styleUrls: ["../tmpl-components-common.scss"],
styleUrls: ["../tmpl-components-common.scss", "./text.component.scss"],
})
export class TmplTextComponent extends TemplateBaseComponent implements OnInit {
params: Partial<ITextParams> = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $background-secondary-light: var(
// Note - CC 2021-12-21 - Currently not in use in any templates, but keeping in case we want
// to expose as a parameter option in the future
.circle-border {
border: var(--ion-border-light-thicker);
border: var(--border-standard);
--border-radius: var(--ion-border-radius-rounded);
border-radius: var(--ion-border-radius-rounded);
}
Expand All @@ -75,7 +75,7 @@ $background-secondary-light: var(
width: 8rem;
min-height: 7rem;
border-radius: var(--ion-border-radius-standard);
border: var(--ion-border-thin-standard);
border: var(--border-thin-standard);
background: var(--ion-color-primary-contrast);
text-align: center;
padding: var(--tiny-padding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $button-background: var(--timer-button-background, var(--ion-color-primary-500))
width: 100%;
background-color: var(--ion-color-primary-contrast);
box-sizing: border-box;
border: var(--ion-border-standard);
border: var(--border-standard);
box-shadow: var(--ion-default-box-shadow);
border-radius: var(--ion-border-radius-secondary);

Expand Down
Loading

0 comments on commit 7914421

Please sign in to comment.