Skip to content

Commit

Permalink
Merge pull request #75 from pegasystems/mod/tor/US-552127
Browse files Browse the repository at this point in the history
Add link a Case not working
  • Loading branch information
vishalshrm539 authored Oct 31, 2023
2 parents cc29010 + 6f20de8 commit 6c469e9
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const endpoints = require('../../../../../sdk-config.json');

test.beforeEach(async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto('http://localhost:3500/portal', { waitUntil: 'networkidle' });
await page.goto(config.config.baseUrl, { waitUntil: 'networkidle' });
});
let caseID;
test.describe('E2E test', () => {
Expand Down Expand Up @@ -146,7 +146,7 @@ test.describe('E2E test', () => {
const worklist = page.locator('div[id="worklist"]:has-text("My Worklist")');
await expect(worklist).toBeVisible();

const caseButton = page.locator(`span:has-text('${caseID}')`);
const caseButton = page.locator(`button:has-text('${caseID}')`);
await caseButton.click();

const mgrDiscountInput = page.locator('input[data-test-id="D69ECA63310344EDB0D0F9881CF9B662"]');
Expand All @@ -167,7 +167,7 @@ test.describe('E2E test', () => {
const worklist = page.locator('div[id="worklist"]:has-text("My Worklist")');
await expect(worklist).toBeVisible();

const caseButton = page.locator(`span:has-text('${caseID}')`);
const caseButton = page.locator(`button:has-text('${caseID}')`);
await caseButton.click();

const tvConnected = page.locator('mat-checkbox[data-test-id="EEF2AA5E42FD9F0FB0A44EA0B2D52921"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class DeferLoadComponent implements OnInit {

angularPConnectData: any = {};
constants: any;
currentLoadedAssignment = "";
currentLoadedAssignment = '';
isContainerPreview: boolean;
loadViewCaseID: any;
resourceType: any;
Expand All @@ -53,12 +53,6 @@ export class DeferLoadComponent implements OnInit {
this.PCore$ = window.PCore;
}
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

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

this.loadActiveTab();
}

Expand All @@ -79,14 +73,18 @@ export class DeferLoadComponent implements OnInit {
}

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 { CASE, PAGE, DATA } = this.constants.RESOURCE_TYPES;
this.CASE = CASE;
this.PAGE = PAGE;
this.DATA = DATA;

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());
Expand Down Expand Up @@ -126,34 +124,30 @@ export class DeferLoadComponent implements OnInit {
}
};
const configObject = this.PCore$.createPConnect(config);
configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT')
configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
this.componentName$ = this.loadedPConn$.getComponentName();
if (this.deferLoadId) {
this.PCore$.getDeferLoadManager().stop(this.deferLoadId, this.pConn$.getContextName());
}
}
// this.cdRef.detectChanges();
};
}

loadActiveTab() {
if (this.resourceType === this.DATA) {
// Rendering defer loaded tabs in data context
if (this.containerName) {
const dataContext = this.PCore$.getStoreValue('.dataContext', 'dataInfo', this.containerName);
const dataContextParameters = this.PCore$.getStoreValue(
'.dataContextParameters',
'dataInfo',
this.containerName
);
const dataContextParameters = this.PCore$.getStoreValue('.dataContextParameters', 'dataInfo', this.containerName);

this.pConn$
.getActionsApi()
.showData(this.name, dataContext, dataContextParameters, {
skipSemanticUrl: true,
isDeferLoaded: true
})
.then(data => {
.then((data) => {
this.onResponse(data);
});
} else {
Expand All @@ -164,12 +158,14 @@ export class DeferLoadComponent implements OnInit {
this.pConn$
.getActionsApi()
.loadView(encodeURI(this.loadViewCaseID), this.name, this.getViewOptions())
.then(data => {
.then((data) => {
this.onResponse(data);
});
} else {
this.pConn$.getActionsApi().refreshCaseView(encodeURI(this.loadViewCaseID), this.name)
.then(data => {
this.pConn$
.getActionsApi()
.refreshCaseView(encodeURI(this.loadViewCaseID), this.name)
.then((data) => {
this.onResponse(data.root);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<component-mapper name="ListView" [props]="{ pConn$ }"></component-mapper>
<component-mapper name="ListView" [props]="{ pConn$, bInForm$: false }"></component-mapper>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="psdk-list-header">
<div>
<mat-form-field class="psdk-search" *ngIf="bShowSearch$">
<mat-label><img class="psdk-icon-search" src="{{ searchIcon$ }}" /> Search</mat-label>
<mat-label><img class="psdk-icon-search" src="{{ searchIcon$ }}" /> <span class="psdk-search-label">Search</span> </mat-label>
<input matInput (keyup)="applySearch($event)" placeholder="" />
</mat-form-field>

<div *ngIf="bInForm$" class="psdk-outer-div-in-form">
<div *ngIf="!bInForm$" class="psdk-outer-div-in-form">
<div class="psdk-inner-div-in-form" *ngIf="bColumnReorder$">
<div>
<table mat-table [dataSource]="repeatList$" matSort cdkDropList cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)">
Expand Down Expand Up @@ -40,12 +40,12 @@
*ngIf="_showButton(dCol.config.name, dCol); else regular"
mat-button
color="primary"
(click)="_listViewClick(dCol.config.name, element[dCol.config.name], i)"
(click)="_listViewClick(dCol.config, element)"
>
{{ element[dCol.config.name] }}
</button>
<ng-template #regular>
{{ element[dCol.config.name] }}
{{ element[dCol.config.name] || "---" }}
</ng-template>
</td>
</ng-container>
Expand Down Expand Up @@ -104,7 +104,7 @@
*ngIf="_showButton(dCol.config.name, dCol); else regular"
mat-button
color="primary"
(click)="_listViewClick(dCol.config.name, element[dCol.config.name], i)"
(click)="_listViewClick(dCol.config, element)"
>
{{ element[dCol.config.name] }}
</button>
Expand Down Expand Up @@ -135,7 +135,7 @@
</div>
</div>
</div>
<div *ngIf="!bInForm$">
<div *ngIf="bInForm$">
<div>
<div>
<table *ngIf="repeatListData?.length > 0" mat-table [dataSource]="repeatList$" matSort>
Expand All @@ -159,7 +159,7 @@
</ng-container>

<tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns$" (click)="rowClick(row)"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns$"></tr>
</table>
<div *ngIf="repeatListData?.length === 0">
<table *ngIf="repeatListData?.length === 0" mat-table [dataSource]="repeatList$">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ td.mat-mdc-footer-cell {

.psdk-search {
padding-left: 0.625rem;
padding-right: 0.625rem;
}

.psdk-icon-search {
vertical-align: sub;
padding: 0rem 0.125rem;
padding: 0.125rem 0.125rem;
min-width: unset;
width: 1.1rem;
}

.psdk-outer-div-in-form {
display: inline-grid;
padding: 1rem;
overflow: hidden;
}

.psdk-inner-div-in-form {
Expand Down Expand Up @@ -145,7 +147,7 @@ td.mat-mdc-footer-cell {
}

tr.mat-mdc-row {
cursor: pointer;
// cursor: pointer;
}

.psdk-no-records {
Expand All @@ -156,3 +158,12 @@ tr.mat-mdc-row {
border: 1px solid lightgray;
border-top: none;
}

.psdk-table-field-link{
color: $app-primary-color;
padding: 0;
cursor: pointer;
border: 0;
background-color: transparent;
align-items: center;
}
Loading

0 comments on commit 6c469e9

Please sign in to comment.