Skip to content

Commit

Permalink
replaced LABELS_LEFT with DISPLAY_ONLY (#238)
Browse files Browse the repository at this point in the history
Co-authored-by: mohas22 <[email protected]>
  • Loading branch information
samhere06 and mohas22 authored Dec 3, 2024
1 parent 4d46a4f commit 0d0559c
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ export class GroupComponent implements OnInit {
this.visibility$ = this.pConn$.getComputedVisibility();
}

if (this.configProps$.displayMode === 'LABELS_LEFT') {
if (this.configProps$.displayMode === 'DISPLAY_ONLY') {
if (this.configProps$.visibility === undefined) this.visibility$ = true;

this.arChildren$.forEach(child => {
const pConn = child.getPConnect();
pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
pConn.setInheritedProp('readOnly', true);

return child;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class ScalarListComponent implements OnInit, OnDestroy {
type: componentType,
config: {
value: scalarValue,
displayMode: 'LABELS_LEFT',
displayMode: 'DISPLAY_ONLY',
label: this.label$,
...restProps,
readOnly: true
Expand All @@ -113,7 +113,7 @@ export class ScalarListComponent implements OnInit, OnDestroy {
{}
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
});
this.isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(this.displayMode$ as string);
this.isDisplayModeEnabled = ['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(this.displayMode$ as string);
this.value$ = this.items;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
}
};
const configObject = PCore.createPConnect(config);
configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
this.componentName$ = this.loadedPConn$.getComponentName();
if (this.deferLoadId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
this.refList = this.rawViewMetadata.config.referenceList;
this.canBeChangedInReviewMode = theConfigProps.allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
// this.childrenToRender = this.children;
this.isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);
this.isDisplayModeEnabled = ['DISPLAY_ONLY', 'STACKED_LARGE_VAL'].includes(displayMode);

if (this.firstChildMeta?.type !== 'Region') {
this.firstChildPConnect = this.pConn$.getChildren()[0].getPConnect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class DetailsOneColumnComponent implements OnInit, OnDestroy {
});
}

this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.pConn$.setInheritedProp('readOnly', true);

const kids = this.pConn$.getChildren() as any[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class DetailsThreeColumnComponent implements OnInit, OnDestroy {
});
}

this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.pConn$.setInheritedProp('readOnly', true);

const kids = this.pConn$.getChildren() as any[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
});
}

this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.pConn$.setInheritedProp('readOnly', true);

const kids = this.pConn$.getChildren() as any[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
});
}

this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.pConn$.setInheritedProp('readOnly', true);

const kids = this.pConn$.getChildren() as any[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class DetailsComponent implements OnInit, OnDestroy {
if (theCompType === 'reference' || theCompType === 'group') {
const configProps = thePConn.getConfigProps();
configProps.readOnly = true;
configProps.displayMode = 'LABELS_LEFT';
configProps.displayMode = 'DISPLAY_ONLY';
const propToUse = { ...thePConn.getInheritedProps() };
configProps.label = propToUse?.label;
const options = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
const { tablabel } = this.pConn$.getComponentConfig();
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);

this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
this.pConn$.setInheritedProp('readOnly', true);

const referenceListData = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges

const renderMode = this.configProps$.renderMode;
const displayMode = this.configProps$.displayMode;
this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
this.contextClass = this.configProps$.contextClass;
const lookForChildInConfig = this.configProps$.lookForChildInConfig;
this.heading = this.configProps$.heading ?? 'Row';
Expand All @@ -114,7 +114,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
this.pConn$.setReferenceList(resolvedList);
if (this.readonlyMode) {
this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
}
this.referenceList = this.configProps$.referenceList;
if (this.prevRefLength != this.referenceList.length) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div *ngIf="displayMode$ === 'LABELS_LEFT'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
<div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
<div class="psdk-grid-label">{{ label$ }}</div>
<div class="psdk-val-labels-left">
<ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const buildView = (pConn, index, viewConfigPath) => {
};

const view = PCore.createPConnect(config);
if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {
view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');
if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {
view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');
}

return view;
Expand Down

0 comments on commit 0d0559c

Please sign in to comment.