-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2601 from IDEMSInternational/feature-kw-completio…
…n-modal Kuwait Theme: Completion modal
- Loading branch information
Showing
7 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
import { PlhParentPointCounterComponent } from "./parent-point-counter/parent-point-counter.component"; | ||
import { PlhParentPointBoxComponent } from "./parent-point-box/parent-point-box.component"; | ||
import { PlhModuleListItemComponent } from "./plh-kids-kw/components/module-list-item/module-list-item.component"; | ||
import { PlhCompletionModalComponent } from "./plh-kids-kw/components/completion-modal/completion-modal.component"; | ||
|
||
export { PlhParentPointCounterComponent, PlhParentPointBoxComponent, PlhModuleListItemComponent }; | ||
export { | ||
PlhParentPointCounterComponent, | ||
PlhParentPointBoxComponent, | ||
PlhModuleListItemComponent, | ||
PlhCompletionModalComponent, | ||
}; | ||
|
||
export const PLH_COMPONENTS = [ | ||
PlhParentPointCounterComponent, | ||
PlhParentPointBoxComponent, | ||
PlhModuleListItemComponent, | ||
PlhCompletionModalComponent, | ||
]; | ||
|
||
export const PLH_COMPONENT_MAPPING = { | ||
parent_point_counter: PlhParentPointCounterComponent, | ||
parent_point_box: PlhParentPointBoxComponent, | ||
plh_module_list_item: PlhModuleListItemComponent, | ||
plh_completion_modal: PlhCompletionModalComponent, | ||
}; | ||
|
||
export type PLHComponentName = keyof typeof PLH_COMPONENT_MAPPING; |
16 changes: 16 additions & 0 deletions
16
...es/components/plh/plh-kids-kw/components/completion-modal/completion-modal.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="completion-modal"> | ||
<div class="wrapper"> | ||
<div class="confetti-image"> | ||
<img [src]="params.backgroundImageAsset | plhAsset" /> | ||
</div> | ||
<span *ngIf="_row.rows" class="children"> | ||
<plh-template-component | ||
*ngFor="let childRow of _row.rows | filterDisplayComponent; trackBy: trackByRow" | ||
class="child" | ||
[row]="childRow" | ||
[parent]="parent" | ||
[attr.data-rowname]="_row.name" | ||
></plh-template-component> | ||
</span> | ||
</div> | ||
</div> |
Empty file.
24 changes: 24 additions & 0 deletions
24
...components/plh/plh-kids-kw/components/completion-modal/completion-modal.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; | ||
import { IonicModule } from "@ionic/angular"; | ||
|
||
import { PlhCompletionModalComponent } from "./completion-modal.component"; | ||
|
||
describe("CompletionModalComponent", () => { | ||
let component: PlhCompletionModalComponent; | ||
let fixture: ComponentFixture<PlhCompletionModalComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [PlhCompletionModalComponent], | ||
imports: [IonicModule.forRoot()], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PlhCompletionModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
...ages/components/plh/plh-kids-kw/components/completion-modal/completion-modal.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { TemplateBaseComponent } from "src/app/shared/components/template/components/base"; | ||
import { getStringParamFromTemplateRow } from "src/app/shared/utils"; | ||
|
||
interface IModalParams { | ||
/* TEMPLATE PARAMETER: "background_image_asset". The background image of the modal */ | ||
backgroundImageAsset: string; | ||
} | ||
|
||
@Component({ | ||
selector: "plh-completion-modal", | ||
templateUrl: "./completion-modal.component.html", | ||
styleUrls: ["./completion-modal.component.scss"], | ||
}) | ||
export class PlhCompletionModalComponent extends TemplateBaseComponent implements OnInit { | ||
params: Partial<IModalParams> = {}; | ||
|
||
ngOnInit() { | ||
this.getParams(); | ||
} | ||
|
||
private getParams() { | ||
this.params.backgroundImageAsset = getStringParamFromTemplateRow( | ||
this._row, | ||
"background_image_asset", | ||
"" | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters