Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<h3 style="font-weight: bold; margin: 0">{{ label }}</h3>
<component-mapper name="SimpleTable" [props]="{ pConn$ }"></component-mapper>
<component-mapper name="SimpleTable" [props]="{ pConn$: newPConn.getPConnect() }"></component-mapper>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { AngularPConnectData, AngularPConnectService } from '../../../_bridge/an
import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component';

interface MultiReferenceReadOnlyProps {
readonlyContextList: string;
referenceList: string;
label: string;
hideLabel: boolean;
}
Expand All @@ -21,6 +23,7 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
angularPConnectData: AngularPConnectData = {};
configProps$: MultiReferenceReadOnlyProps;
label: string;
newPConn: any;

constructor(private angularPConnect: AngularPConnectService) {}

Expand Down Expand Up @@ -49,5 +52,29 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
updateSelf() {
this.configProps$ = this.pConn$.getConfigProps() as MultiReferenceReadOnlyProps;
this.label = this.configProps$.label;

const config = (this.pConn$.getMetadata() as any)?.config;
const { referenceList, readonlyContextList } = config;
let readonlyContextObject;
if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
readonlyContextObject = {
referenceList: readonlyContextList
};
}
const hideLabel = this.configProps$.hideLabel ?? false;
this.newPConn = this.pConn$.createComponent(
{
type: 'SimpleTable',
config: {
...config,
...readonlyContextObject,
label: this.label,
hideLabel
}
},
'',
0,
{}
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const getContext = thePConn => {
const pageReference = thePConn.getPageReference();
const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps();

const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;
const pageReferenceForRows = referenceList?.startsWith('.') ? `${pageReference}.${referenceList?.substring(1)}` : referenceList;
const viewName = thePConn.viewName;

// removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
Expand Down