Skip to content

Commit e36d84e

Browse files
committed
feat: add configProps input to BannerComponent and update QuickCreate component for image path handling
1 parent 1858700 commit e36d84e

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

src/app/_samples/mediaco/components/app-shell/app-shell.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface AppShellProps {
3232
selector: 'app-app-shell',
3333
templateUrl: './app-shell.component.html',
3434
styleUrls: ['./app-shell.component.scss'],
35-
imports: [CommonModule, MatSnackBarModule, FooterComponent, forwardRef(() => ComponentMapperComponent)]
35+
imports: [CommonModule, MatSnackBarModule, forwardRef(() => ComponentMapperComponent)]
3636
})
3737
export class AppShellComponent implements OnInit, OnDestroy {
3838
@Input() pConn$: typeof PConnect;

src/app/_samples/mediaco/components/banner/banner.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class BannerComponent {
1414
@Input() formGroup$: FormGroup;
1515

1616
@Input() arChildren$: any[];
17+
@Input() configProps$: any;
1718
@Input() title: string;
1819
@Input() message: any;
1920
@Input() backgroundImage: string;

src/app/_samples/mediaco/components/quick-create/quick-create.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ <h3>Get started</h3>
3232
<div class="card">
3333
<div class="card-header" [ngClass]="card.bgClass">
3434
<div class="watermark">
35-
<img class="material-icons" *ngIf="card.icon" [src]="card.icon" />
35+
<img class="material-icons" *ngIf="card.icon" [src]="getImagePath(card.icon)" />
3636
</div>
3737
<div class="icon-box" [ngStyle]="{ 'background-image': card.gradient }">
38-
<img *ngIf="card.icon" class="quick-link-icon" [src]="card.icon" />
38+
<img *ngIf="card.icon" class="quick-link-icon" [src]="getImagePath(card.icon)" />
3939
</div>
4040
</div>
4141

src/app/_samples/mediaco/components/quick-create/quick-create.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { Utils } from '@pega/angular-sdk-components';
4-
import { getQuicklinksData } from './quick-create.utils';
4+
import { QUICK_LINKS_DATA } from './quick-create.utils';
55

66
interface QuickCreateProps {
77
// If any, enter additional props that only exist on this component
@@ -100,8 +100,8 @@ export class QuickCreateComponent implements OnInit, OnChanges {
100100
} else {
101101
this.cases$ = defaultCases;
102102
}
103-
const cardsData = getQuicklinksData(this.utils);
104-
const cardMap = new Map(cardsData.map(card => [card.title, card]));
103+
104+
const cardMap = new Map(QUICK_LINKS_DATA.map(card => [card.title, card]));
105105

106106
const mergedCases = this.cases$.map(caseItem => {
107107
const matchingCard = cardMap.get(caseItem.label);
@@ -117,4 +117,8 @@ export class QuickCreateComponent implements OnInit, OnChanges {
117117
updateSelf() {
118118
this.initComponent();
119119
}
120+
121+
getImagePath(iconName: string): string {
122+
return this.utils.getImageSrc(iconName, this.utils.getSDKStaticContentUrl());
123+
}
120124
}

src/app/_samples/mediaco/components/quick-create/quick-create.utils.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { Utils } from '@pega/angular-sdk-components';
2-
3-
export const getQuicklinksData = (utils: Utils) => [
1+
export const QUICK_LINKS_DATA = [
42
{
53
title: 'Plan Upgrade',
64
description:
75
'Take your experience to the next level by upgrading your current plan. This portal allows you to easily compare different subscription tiers, review the additional benefits and features of each, and select the upgrade that best suits your needs. The process is quick, and your new features will be available almost instantly.',
8-
icon: utils.getImageSrc('trending-up', utils.getSDKStaticContentUrl()),
6+
icon: 'trending-up',
97
bgClass: 'bg-purple',
108
iconBgClass: 'icon-purple',
119
gradient: 'linear-gradient(135deg, #6750A4 0%, #8A7CC7 100%)',
@@ -14,7 +12,7 @@ export const getQuicklinksData = (utils: Utils) => [
1412
{
1513
title: 'Purchase Phone',
1614
description: 'Browse and purchase the latest mobile phones. This feature allows you to select a new device and complete your order online.',
17-
icon: utils.getImageSrc('smartphone', utils.getSDKStaticContentUrl()),
15+
icon: 'smartphone',
1816
bgClass: 'bg-pink',
1917
iconBgClass: 'icon-pink',
2018
gradient: 'linear-gradient(135deg, #F814E3 0%, #FF6B9D 100%)',
@@ -24,7 +22,7 @@ export const getQuicklinksData = (utils: Utils) => [
2422
title: 'New Service',
2523
description:
2624
'Discover and initiate new services tailored to your needs. This portal provides a streamlined process to browse our service catalog, select the service you require, and submit a request. You will be guided through the necessary steps to provide details and complete your application efficiently.',
27-
icon: utils.getImageSrc('shopping-cart', utils.getSDKStaticContentUrl()),
25+
icon: 'shopping-cart',
2826
bgClass: 'bg-cyan',
2927
iconBgClass: 'icon-cyan',
3028
gradient: 'linear-gradient(135deg, #00C9FF 0%, #92FE9D 100%)',
@@ -34,7 +32,7 @@ export const getQuicklinksData = (utils: Utils) => [
3432
title: 'Add-on Services',
3533
description:
3634
'Enhance your current plan by adding optional services and features. This portal allows you to browse a catalog of available add-ons—from extra storage to premium content—and activate them instantly on your account to tailor your experience to your specific needs.',
37-
icon: utils.getImageSrc('monitor', utils.getSDKStaticContentUrl()),
35+
icon: 'monitor',
3836
bgClass: 'bg-orange',
3937
iconBgClass: 'icon-orange',
4038
gradient: 'linear-gradient(135deg, #FF6B35 0%, #F7931E 100%)',
@@ -44,7 +42,7 @@ export const getQuicklinksData = (utils: Utils) => [
4442
title: 'Make Payment',
4543
description:
4644
'Conveniently manage and pay your bills online at any time. Our secure portal allows you to make one-time payments, schedule future payments, or enroll in AutoPay for automatic deductions. You can view your current balance and payment history, and choose to go paperless with electronic billing. Supported payment methods include credit/debit cards and eChecks',
47-
icon: utils.getImageSrc('wallet', utils.getSDKStaticContentUrl()),
45+
icon: 'wallet',
4846
bgClass: 'bg-magenta',
4947
iconBgClass: 'icon-magenta',
5048
gradient: 'linear-gradient(135deg, #8A0786 0%, #C70BB5 100%)',
@@ -53,7 +51,7 @@ export const getQuicklinksData = (utils: Utils) => [
5351
{
5452
title: 'Get Help',
5553
description: "Find answers quickly or connect with our support team for assistance. We're here to help you resolve any issue.",
56-
icon: utils.getImageSrc('headphones', utils.getSDKStaticContentUrl()),
54+
icon: 'headphones',
5755
bgClass: 'bg-magenta',
5856
iconBgClass: 'icon-magenta',
5957
gradient: 'linear-gradient(135deg, #D0BCFF 0%, #EFB8C8 100%)',

src/app/_samples/mediaco/components/wss-nav-bar/wss-nav-bar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
3838
@Input() pConn$: typeof PConnect;
3939
@Input() appName$: string;
4040
@Input() pages$: any[];
41-
// @Input() caseTypes$: any[];
41+
@Input() caseTypes$: any[];
4242
@Input() homePage: any;
4343
@Input() arChildren$: any[];
4444
@Input() portalLogoImage$: string;

0 commit comments

Comments
 (0)