Skip to content

Commit db49cea

Browse files
authored
Merge branch 'master' into checkbox-update
2 parents 4fb3c4c + 0a2d982 commit db49cea

27 files changed

+2776
-2952
lines changed

package-lock.json

Lines changed: 1934 additions & 2529 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"prebuild-overrides": "shx rm -rf ./packages/angular-sdk-overrides/lib && shx cp -r ./packages/angular-sdk-components/src/lib/_components ./packages/angular-sdk-overrides/lib",
3333
"build-overrides": "node scripts/build-overrides",
3434
"postbuild-overrides": "node ./scripts/copy-npm-assets-to-overrides.js && echo build-overrides completed",
35-
"compile-ts": "ngc -b tsconfig.build.json",
35+
"compile-ts": "ngc -p tsconfig.build.json",
3636
"delete-tsbuildinfo": "rm -f projects/angular-test-app/*.*.tsbuildinfo",
3737
"ci": "npm run clean && npm install",
3838
"clean": "npx shx --yes rm -rf ./node_modules ./.angular/cache && npm run clear-dist && npm run clear-lib",
@@ -124,7 +124,7 @@
124124
"shx": "^0.4.0",
125125
"tinymce": "^6.8.6",
126126
"ts-node": "~10.9.2",
127-
"typescript": "^5.5.4",
127+
"typescript": "^5.8.3",
128128
"typescript-eslint": "^8.45.0",
129129
"webpack": "^5.101.2"
130130
},

packages/angular-sdk-components/src/lib/_components/field/cancel-alert/cancel-alert.component.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<div *ngIf="bShowAlert$" class="psdk-cancel-alert-background">
22
<div class="psdk-cancel-alert-top">
3-
<h3 *ngIf="heading$ != ''">{{ heading$ }}</h3>
3+
<h3>{{ localizedVal('Discard unsaved changes?', localeCategory) }}</h3>
44
<div>
5-
<p>{{ body1$ }}</p>
6-
<p>{{ body2$ }}</p>
5+
<p>{{ localizedVal('You have unsaved changes. You can discard them or go back to keep working.', localeCategory) }}</p>
76
</div>
87
<mat-grid-list cols="2" rowHeight="6.25rem">
98
<mat-grid-tile>
10-
<button mat-raised-button color="secondary" (click)="buttonClick('save')">{{ localizedVal('Save for later', localeCategory) }}</button>
9+
<button mat-raised-button color="secondary" (click)="buttonClick('continue')">{{ localizedVal('Go back', localeCategory) }}</button>
1110
</mat-grid-tile>
1211
<mat-grid-tile>
13-
<button mat-raised-button color="secondary" (click)="buttonClick('continue')">{{ localizedVal('Continue Working', localeCategory) }}</button>
14-
<button mat-raised-button color="primary" (click)="buttonClick('delete')">{{ localizedVal('Delete', localeCategory) }}</button>
12+
<button mat-raised-button color="primary" (click)="buttonClick('discard')">{{ localizedVal('Discard', localeCategory) }}</button>
1513
</mat-grid-tile>
1614
</mat-grid-list>
1715
</div>

packages/angular-sdk-components/src/lib/_components/field/cancel-alert/cancel-alert.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
z-index: 9999;
1010
top: 0px;
1111
left: 0px;
12+
background: rgba(0, 0, 0, 0.5);
1213
}
1314

1415
.psdk-cancel-alert-top {
@@ -19,4 +20,5 @@
1920
border-radius: 10px;
2021
padding: 20px;
2122
box-shadow: 0 0 10px 3px var(--app-box-shadow-color);
23+
background-color: var(--mat-sys-surface-container);
2224
}

packages/angular-sdk-components/src/lib/_components/field/cancel-alert/cancel-alert.component.ts

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export class CancelAlertComponent implements OnChanges {
1515
@Input() bShowAlert$: boolean;
1616
@Output() onAlertState$: EventEmitter<boolean> = new EventEmitter<boolean>();
1717

18-
heading$: string;
19-
body1$: string;
20-
body2$: string;
2118
itemKey: string;
2219
localizedVal: Function;
2320
localeCategory = 'ModalContainer';
@@ -26,28 +23,18 @@ export class CancelAlertComponent implements OnChanges {
2623
ngOnChanges() {
2724
if (this.bShowAlert$) {
2825
this.psService.sendMessage(false);
29-
3026
const contextName = this.pConn$.getContextName();
31-
const caseInfo = this.pConn$.getCaseInfo();
32-
const caseName = caseInfo.getName();
33-
const ID = caseInfo.getID();
3427
this.localizedVal = PCore.getLocaleUtils().getLocaleValue;
35-
3628
this.itemKey = contextName;
37-
this.heading$ = `Delete ${caseName} (${ID})`;
38-
this.body1$ = `${this.localizedVal('Are you sure you want to delete ', this.localeCategory) + caseName} (${ID})?`;
39-
this.body2$ = this.localizedVal('Alternatively, you can continue working or save your work for later.', this.localeCategory);
40-
41-
// this.onAlertState$.emit(true);
4229
}
4330
}
4431

45-
dismissAlert() {
32+
dismissAlertOnly() {
4633
this.bShowAlert$ = false;
4734
this.onAlertState$.emit(false);
4835
}
4936

50-
dismissAlertOnly() {
37+
dismissAlert() {
5138
this.bShowAlert$ = false;
5239
this.onAlertState$.emit(true);
5340
}
@@ -61,26 +48,10 @@ export class CancelAlertComponent implements OnChanges {
6148
this.localizedVal = PCore.getLocaleUtils().getLocaleValue;
6249

6350
switch (sAction) {
64-
case 'save':
65-
this.psService.sendMessage(true);
66-
// eslint-disable-next-line no-case-declarations
67-
const savePromise = actionsAPI.saveAndClose(this.itemKey);
68-
savePromise
69-
.then(() => {
70-
this.psService.sendMessage(false);
71-
this.dismissAlert();
72-
73-
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
74-
})
75-
.catch(() => {
76-
this.psService.sendMessage(false);
77-
this.sendMessage(this.localizedVal('Save failed', this.localeCategory));
78-
});
79-
break;
8051
case 'continue':
8152
this.dismissAlertOnly();
8253
break;
83-
case 'delete':
54+
case 'discard':
8455
this.psService.sendMessage(true);
8556

8657
// eslint-disable-next-line no-case-declarations
Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 40ch), 1fr)); grid-auto-rows: 1fr; gap: 0.5rem">
1+
<div
2+
*ngIf="type === 'checkbox'"
3+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 0.5rem"
4+
>
25
<div *ngFor="let cardContent of contentList">
36
<mat-card [ngStyle]="cardStyle" appearance="outlined" (click)="cardSelect($event, cardContent.commonCardProps)">
47
<img
@@ -9,35 +12,59 @@
912
[ngStyle]="cardContent.cardImage.style"
1013
/>
1114
<mat-card-content>
12-
<div *ngIf="type === 'radio'">
13-
<mat-radio-button
14-
[checked]="radioBtnValue === cardContent?.commonCardProps?.key"
15-
[disabled]="disabled"
16-
[value]="cardContent.commonCardProps.key"
17-
(change)="fieldOnChange(cardContent.commonCardProps.key)"
18-
>
19-
{{ cardContent.commonCardProps.label }}
20-
</mat-radio-button>
21-
</div>
22-
<div *ngIf="type === 'checkbox'">
23-
<mat-checkbox
24-
[labelPosition]="'after'"
25-
[checked]="cardContent.commonCardProps.selected"
26-
[disabled]="disabled || readOnly"
27-
[attr.data-test-id]="testId + ':' + cardContent.commonCardProps.label"
28-
(change)="handleChangeMultiMode($event, cardContent.commonCardProps)"
29-
(blur)="fieldOnBlur()"
30-
>{{ cardContent.commonCardProps.label }}</mat-checkbox
31-
>
32-
</div>
15+
<mat-checkbox
16+
[labelPosition]="'after'"
17+
[checked]="cardContent.commonCardProps.selected"
18+
[disabled]="disabled || readOnly"
19+
[attr.data-test-id]="testId + ':' + cardContent.commonCardProps.label"
20+
(change)="handleChangeMultiMode($event, cardContent.commonCardProps)"
21+
(blur)="fieldOnBlur()"
22+
>{{ cardContent.commonCardProps.label }}</mat-checkbox
23+
>
3324
<div
3425
*ngFor="let field of cardContent.commonCardProps.fields"
3526
[ngStyle]="field.type !== 'TextArea' ? (field.name ? defaultStyle : noLabelStyle) : specialStyle"
3627
>
37-
<div style="color: rgba(0, 0, 0, 0.6)">{{ field.name }}</div>
28+
<div>{{ field.name }}</div>
3829
<div>{{ field?.value?.getPConnect().getConfigProps().value ?? '--' }}</div>
3930
</div>
4031
</mat-card-content>
4132
</mat-card>
4233
</div>
4334
</div>
35+
36+
<mat-radio-group
37+
*ngIf="type === 'radio'"
38+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 0.5rem"
39+
[name]="propName"
40+
[value]="radioBtnValue"
41+
(change)="fieldOnChange($event.value)"
42+
>
43+
<div *ngFor="let cardContent of contentList">
44+
<mat-card [ngStyle]="cardStyle" appearance="outlined" (click)="cardSelect($event, cardContent.commonCardProps)">
45+
<img
46+
*ngIf="cardContent.cardImage"
47+
mat-card-image
48+
src="{{ cardContent.cardImage.src }}"
49+
alt="{{ cardContent.cardImage.alt }}"
50+
[ngStyle]="cardContent.cardImage.style"
51+
/>
52+
<mat-card-content>
53+
<mat-radio-button
54+
[checked]="radioBtnValue === cardContent?.commonCardProps?.key"
55+
[disabled]="disabled"
56+
[value]="cardContent.commonCardProps.key"
57+
>
58+
{{ cardContent.commonCardProps.label }}
59+
</mat-radio-button>
60+
<div
61+
*ngFor="let field of cardContent.commonCardProps.fields"
62+
[ngStyle]="field.type !== 'TextArea' ? (field.name ? defaultStyle : noLabelStyle) : specialStyle"
63+
>
64+
<div>{{ field.name }}</div>
65+
<div>{{ field?.value?.getPConnect().getConfigProps().value ?? '--' }}</div>
66+
</div>
67+
</mat-card-content>
68+
</mat-card>
69+
</div>
70+
</mat-radio-group>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
::ng-deep .mdc-label {
22
font-size: large;
33
}
4+
5+
.mat-mdc-card-content:last-child {
6+
padding-bottom: 0;
7+
}
8+
9+
.mat-mdc-card-content:first-child {
10+
padding-top: 0;
11+
}

packages/angular-sdk-components/src/lib/_components/field/selectable-card/selectable-card.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class SelectableCardComponent extends FieldBase implements OnInit {
168168
alt: this.commonProps.image.showImageDescription && imageDescriptionKey ? item[imageDescriptionKey] : '',
169169
style: {
170170
width: imageWidth,
171-
backgroundColor: 'rgb(233, 238, 243)',
171+
backgroundColor: 'transparent',
172172
aspectRatio: '16/9',
173173
maxHeight: '100%',
174174
objectFit: 'contain',
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<mat-grid-list *ngIf="arMainButtons$ && arSecondaryButtons$" cols="2" rowHeight="6.25rem">
2-
<mat-grid-tile>
1+
<div class="button-bar" *ngIf="arMainButtons$ && arSecondaryButtons$">
2+
<div class="left-group">
33
<button
44
*ngFor="let aButton of arSecondaryButtons$"
55
mat-stroked-button
@@ -8,10 +8,10 @@
88
>
99
{{ localizedVal(aButton.name, localeCategory) }}
1010
</button>
11-
</mat-grid-tile>
12-
<mat-grid-tile>
11+
</div>
12+
<div class="right-group">
1313
<button *ngFor="let aButton of arMainButtons$" mat-flat-button (click)="buttonClick(aButton.jsAction, 'primary')">
1414
{{ localizedVal(aButton.name, localeCategory) }}
1515
</button>
16-
</mat-grid-tile>
17-
</mat-grid-list>
16+
</div>
17+
</div>
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
.button-bar {
2+
box-sizing: border-box;
3+
display: flex;
4+
flex-direction: row;
5+
align-items: center;
6+
width: 100%;
7+
padding: 1rem;
8+
}
9+
10+
.left-group,
11+
.right-group {
12+
display: flex;
13+
gap: 1rem;
14+
}
15+
16+
.right-group {
17+
margin-left: auto;
18+
}
19+
120
.secondary-button {
221
background-color: var(--app-sys-secondary-button-background);
322
border-color: var(--app-sys-secondary-button-border);
4-
margin: 0 5px;
523
}

0 commit comments

Comments
 (0)