Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Case-Summary and Case reference issues #42

Merged
merged 1 commit into from
Aug 18, 2023
Merged
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
Expand Up @@ -39,15 +39,24 @@ export class DeferLoadComponent implements OnInit {
CASE: any;
PAGE: any;
DATA: any;
constructor(private angularPConnect: AngularPConnectService) {}
constructor(private angularPConnect: AngularPConnectService) {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}
this.constants = this.PCore$.getConstants();
}

ngOnInit(): void {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

this.getData();
const { CASE, PAGE, DATA } = this.constants.RESOURCE_TYPES;
this.CASE = CASE;
this.PAGE = PAGE;
this.DATA = DATA;

this.loadActiveTab();
}

Expand All @@ -67,36 +76,22 @@ export class DeferLoadComponent implements OnInit {
}
}

getData() {
const theRequestedAssignment = this.pConn$.getValue(this.PCore$.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
if (theRequestedAssignment !== this.currentLoadedAssignment) {
// console.log(`DeferLoad: currentLoadedAssignment about to change from ${currentLoadedAssignment} to ${theRequestedAssignment}`);
this.currentLoadedAssignment = theRequestedAssignment;
}
this.constants = this.PCore$.getConstants();
const { CASE, PAGE, DATA } = this.constants.RESOURCE_TYPES;
this.CASE = CASE;
this.PAGE = PAGE;
this.DATA = DATA;
ngOnChanges() {

this.loadViewCaseID = this.pConn$.getValue(this.constants.PZINSKEY) || this.pConn$.getValue(this.constants.CASE_INFO.CASE_INFO_ID);
let containerItemData;
const targetName = this.pConn$.getTarget();
if (targetName) {
this.containerName = this.PCore$.getContainerUtils().getActiveContainerItemName(targetName);
containerItemData = this.PCore$.getContainerUtils().getContainerItemData(targetName, this.containerName);
}
const { resourceType = CASE } = containerItemData || { resourceType: this.loadViewCaseID ? CASE : PAGE };
const { resourceType = this.CASE } = containerItemData || { resourceType: this.loadViewCaseID ? this.CASE : this.PAGE };
this.resourceType = resourceType;
this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName());

const theConfigProps = this.pConn$.getConfigProps();
this.deferLoadId = theConfigProps.deferLoadId;
this.name = this.name || theConfigProps.name;
}

ngOnChanges() {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}

this.loadActiveTab();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class DataReferenceComponent implements OnInit {
}

// AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value
const propValue = event?.id || event?.target.value;
const propValue = event?.id || event?.target?.value;
if (propValue && this.canBeChangedInReviewMode && this.isDisplayModeEnabled) {
this.PCore$.getDataApiUtils()
.getCaseEditLock(caseKey)
Expand Down Expand Up @@ -221,7 +221,7 @@ export class DataReferenceComponent implements OnInit {
dataRelationshipContext:
this.rawViewMetadata.config.contextClass && this.rawViewMetadata.config.name ? this.rawViewMetadata.config.name : null,
hideLabel: this.hideLabel,
onRecordChange: this.handleSelection
onRecordChange: this.handleSelection.bind(this)
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ComponentMapperComponent } from '../../../_bridge/component-mapper/comp
export class WideNarrowPageComponent implements OnInit {
@Input() pConn$: any;
@Input() formGroup$: FormGroup;
@Input() displayOnlyFA$;

thePConnType: string = '';

Expand Down
Loading