Skip to content

Commit 7be89a3

Browse files
committed
fix: readOnly displays, duplicate titles, UI styles
1 parent d180aeb commit 7be89a3

File tree

9 files changed

+11
-30
lines changed

9 files changed

+11
-30
lines changed

packages/angular-sdk-components/src/lib/_components/designSystemExtension/material-case-summary/material-case-summary.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
}
5050

5151
.psdk-case-summary-fields {
52-
padding: calc(2 * 0.5rem);
52+
// padding: calc(2 * 0.5rem);
5353
display: grid;
5454
grid-row-gap: calc(2 * 0.5rem);
5555
}
@@ -90,6 +90,7 @@
9090
grid-template-columns: 1fr;
9191
grid-column-gap: calc(2 * 0.5rem);
9292
grid-row-gap: calc(1 * 0.5rem);
93+
margin: 0;
9394
}
9495

9596
.psdk-csf-secondary-field {

packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
7676
) {}
7777

7878
ngOnInit(): void {
79-
this.placeholder = `${this.theDateFormat.dateFormatStringLC}, hh:mm a`;
79+
this.placeholder = `${this.theDateFormat.dateFormatStringLC}, hh:mm A`;
8080
// First thing in initialization is registering and subscribing to the AngularPConnect service
8181
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
8282
this.controlName$ = this.angularPConnect.getComponentID(this);
@@ -143,7 +143,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
143143

144144
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
145145
this.formattedValue$ = format(this.value$, 'datetime', {
146-
format: `${this.theDateFormat.dateFormatString} hh:mm a`
146+
format: `${this.theDateFormat.dateFormatString} hh:mm A`
147147
});
148148
}
149149

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class PercentageComponent implements OnInit, OnDestroy {
134134
this.propName = this.pConn$.getStateProps().value;
135135

136136
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
137-
this.formattedValue = format(nValue, 'percentage');
137+
this.formattedValue = nValue ? format(nValue, 'percentage') : '';
138138
}
139139

140140
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class TimeComponent implements OnInit, OnDestroy {
129129

130130
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
131131
this.formattedValue$ = format(this.value$, 'timeonly', {
132-
format: 'hh:mm a'
132+
format: 'hh:mm A'
133133
});
134134
}
135135

packages/angular-sdk-components/src/lib/_components/infra/view/view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div *ngIf="visibility$ !== false" class="ng-view-top">
2-
<div *ngIf="showLabel$ && label$ && templateName$ !== 'SimpleTable' && templateName$ !== 'DefaultForm'" class="template-title-container">
2+
<div *ngIf="showLabel$ && label$ && !noHeaderTemplates.includes(templateName$)" class="template-title-container">
33
<span>{{ label$ }}</span>
44
</div>
55

packages/angular-sdk-components/src/lib/_components/infra/view/view.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { getAllFields } from '../../template/utils';
77
import { ReferenceComponent } from '../reference/reference.component';
88
import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component';
99

10+
const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
11+
1012
/**
1113
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
1214
* Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
@@ -77,6 +79,8 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
7779

7880
angularPConnectData: AngularPConnectData = {};
7981

82+
noHeaderTemplates = NO_HEADER_TEMPLATES;
83+
8084
configProps$: ViewProps;
8185
inheritedProps$: any;
8286
arChildren$: any[];

packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<!-- When adding a component here, add the same component in 'region' template as well -->
2-
<div *ngIf="!NO_HEADER_TEMPLATES.includes(template) && showLabel">
3-
<div class="template-title-container">{{ label }}</div>
4-
</div>
51
<div *ngIf="instructions" class="psdk-default-form-instruction-text">
62
<div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
73
</div>

packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { FormTemplateBaseComponent } from '../form-template-base/form-template-b
99
interface DefaultFormProps {
1010
// If any, enter additional props that only exist on this component
1111
NumCols: string;
12-
template: string;
1312
instructions: string;
1413
}
1514

@@ -26,32 +25,14 @@ export class DefaultFormComponent extends FormTemplateBaseComponent implements O
2625

2726
arChildren$: any[];
2827
divClass$: string;
29-
template: any;
30-
showLabel: any;
31-
label: any;
3228
instructions: string;
3329

34-
NO_HEADER_TEMPLATES = [
35-
'SubTabs',
36-
'SimpleTable',
37-
'Details',
38-
'DetailsTwoColumn',
39-
'DetailsThreeColumn',
40-
'NarrowWideDetails',
41-
'WideNarrowDetails',
42-
'Confirmation'
43-
];
44-
4530
constructor(private templateUtils: TemplateUtils) {
4631
super();
4732
}
4833

4934
ngOnInit(): void {
5035
const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
51-
this.template = configProps?.template;
52-
const propToUse: any = { ...this.pConn$.getInheritedProps() };
53-
this.showLabel = propToUse?.showLabel;
54-
this.label = propToUse?.label;
5536
const kids = this.pConn$.getChildren();
5637
this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
5738

projects/angular-test-app/src/styles.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ a.mat-mdc-menu-item > mat-icon {
7070

7171
.psdk-grid-label {
7272
color: rgba(0, 0, 0, 0.54);
73-
margin: 8px 0px;
7473
}
7574
.psdk-value {
7675
margin: 8px 0px;

0 commit comments

Comments
 (0)