Skip to content

Commit

Permalink
chore: move parent_point_box component to plh components folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmcquade committed Oct 25, 2024
1 parent db6b6e9 commit 8f13343
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 30 deletions.
9 changes: 6 additions & 3 deletions packages/components/plh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import type { ITemplateRowProps } from "src/app/shared/components/template/model
import { CommonModule } from "@angular/common";
import { IonicModule } from "@ionic/angular";
import { TemplatePipesModule } from "src/app/shared/components/template/pipes/template-pipes.module";
import { LottieModule } from "ngx-lottie";
import { PlhParentPointCounterComponent } from "./parent-point-counter/parent-point-counter.component";
import { PlhParentPointBoxComponent } from "./parent-point-box/parent-point-box.component";

@NgModule({
imports: [CommonModule, IonicModule, TemplatePipesModule],
exports: [PlhParentPointCounterComponent],
declarations: [PlhParentPointCounterComponent],
imports: [CommonModule, IonicModule, TemplatePipesModule, LottieModule],
exports: [PlhParentPointCounterComponent, PlhParentPointBoxComponent],
declarations: [PlhParentPointCounterComponent, PlhParentPointBoxComponent],
providers: [],
})
export class PlhComponentsModule {}

export const PLH_COMPONENT_MAPPING: Record<string, Type<ITemplateRowProps>> = {
parent_point_counter: PlhParentPointCounterComponent,
parent_point_box: PlhParentPointBoxComponent,
};
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { IonicModule } from "@ionic/angular";

import { TmplParentPointBoxComponent } from "./points-item.component";
import { PlhParentPointBoxComponent } from "./parent-point-box.component";

describe("TmplParentPointBoxComponent", () => {
let component: TmplParentPointBoxComponent;
let fixture: ComponentFixture<TmplParentPointBoxComponent>;
let component: PlhParentPointBoxComponent;
let fixture: ComponentFixture<PlhParentPointBoxComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [TmplParentPointBoxComponent],
declarations: [PlhParentPointBoxComponent],
imports: [IonicModule.forRoot()],
}).compileComponents();

fixture = TestBed.createComponent(TmplParentPointBoxComponent);
fixture = TestBed.createComponent(PlhParentPointBoxComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import { Component, ElementRef, HostListener, Input, OnInit, ViewChild } from "@angular/core";
import { TemplateBaseComponent } from "src/app/shared/components/template/components/base";
import { FlowTypes, ITemplateRowProps } from "src/app/shared/components/template/models";
import {
Component,
ElementRef,
HostBinding,
HostListener,
Input,
OnInit,
ViewChild,
} from "@angular/core";
import { TemplateBaseComponent } from "../base";
import { FlowTypes, ITemplateRowProps } from "../../models";
import { getBooleanParamFromTemplateRow, getStringParamFromTemplateRow } from "../../../../utils";
getBooleanParamFromTemplateRow,
getStringParamFromTemplateRow,
} from "src/app/shared/utils";
import { AnimationOptions } from "ngx-lottie";
import { TemplateAssetService } from "../../services/template-asset.service";
import { TemplateAssetService } from "src/app/shared/components/template/services/template-asset.service";

@Component({
selector: "plh-points-item",
templateUrl: "./points-item.component.html",
styleUrls: ["./points-item.component.scss"],
selector: "plh-parent-point-box",
templateUrl: "./parent-point-box.component.html",
styleUrls: ["./parent-point-box.component.scss"],
})
// TODO - why does the class name not match the file name??
export class TmplParentPointBoxComponent
export class PlhParentPointBoxComponent
extends TemplateBaseComponent
implements ITemplateRowProps, OnInit
{
Expand Down
1 change: 0 additions & 1 deletion packages/data-models/flowTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ export namespace FlowTypes {
| "nested_properties"
| "number_selector"
| "odk_form"
| "parent_point_box"
| "pdf"
| "progress_path"
| "qr_code"
Expand Down
3 changes: 0 additions & 3 deletions src/app/shared/components/template/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import { TmplLottieAnimation } from "./lottie-animation";
import { TmplNavigationBarComponent } from "./navigation-bar/navigation-bar.component";
import { TmplNumberComponent } from "./number-selector/number-selector.component";
import { TmplOdkFormComponent } from "./odk-form/odk-form.component";
import { TmplParentPointBoxComponent } from "./points-item/points-item.component";
import { TmplPdfComponent } from "./pdf/pdf.component";
import { TmplProgressPathComponent } from "./progress-path/progress-path.component";
import { TmplQRCodeComponent } from "./qr-code/qr-code.component";
Expand Down Expand Up @@ -103,7 +102,6 @@ export const TEMPLATE_COMPONENTS = [
TmplNavigationBarComponent,
TmplNumberComponent,
TmplOdkFormComponent,
TmplParentPointBoxComponent,
TmplPdfComponent,
TmplProgressPathComponent,
TmplQRCodeComponent,
Expand Down Expand Up @@ -162,7 +160,6 @@ const CORE_COMPONENT_MAPPING: Record<FlowTypes.TemplateRowType, Type<ITemplateRo
nested_properties: null as any,
number_selector: TmplNumberComponent,
odk_form: TmplOdkFormComponent,
parent_point_box: TmplParentPointBoxComponent,
pdf: TmplPdfComponent,
progress_path: TmplProgressPathComponent,
qr_code: TmplQRCodeComponent,
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/components/template/template.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { SharedPipesModule } from "../../pipes";
import { TooltipDirective } from "../common/directives/tooltip.directive";
import { TemplateContainerComponent } from "./template-container.component";
import { TEMPLATE_COMPONENTS } from "./components";
import { TEMPLATE_PIPES } from "./pipes";
import { TmplCompHostDirective, TemplateComponent } from "./template-component";

import { appendStyleSvgDirective } from "./directives/shadowStyleSvg.directive";
Expand Down

0 comments on commit 8f13343

Please sign in to comment.