Skip to content

Commit d0c3eac

Browse files
add status to todo cancel, add narrowWide and wideNarrow forms support (#2)
1 parent 66b4944 commit d0c3eac

13 files changed

+205
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<div class="psdk-narrow-wide-column">
2+
<div *ngFor="let kid of arChildren$">
3+
<div class="psdk-narrow-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='left' ">
4+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
5+
</div>
6+
<div class="psdk-wide-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='right' ">
7+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
8+
</div>
9+
<div class="psdk-narrow-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='a' ">
10+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
11+
</div>
12+
<div class="psdk-wide-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='b' ">
13+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
14+
</div>
15+
</div>
16+
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
5+
6+
7+
.psdk-narrow-wide-column {
8+
display: flow-root;
9+
height: 100%;
10+
}
11+
12+
13+
14+
.psdk-narrow-column {
15+
float: left;
16+
min-width: 30%;
17+
padding: 0rem 0.3125rem;
18+
}
19+
20+
.psdk-wide-column {
21+
float: left;
22+
width: 70%;
23+
padding: 0rem 0.3125rem;
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { NarrowWideFormComponent } from './narrow-wide-form.component';
4+
5+
describe('NarrowWideFormComponent', () => {
6+
let component: NarrowWideFormComponent;
7+
let fixture: ComponentFixture<NarrowWideFormComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ NarrowWideFormComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(NarrowWideFormComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Component, OnInit, Input } from '@angular/core';
2+
import { FormGroup, Form } from '@angular/forms';
3+
4+
@Component({
5+
selector: 'app-narrow-wide-form',
6+
templateUrl: './narrow-wide-form.component.html',
7+
styleUrls: ['./narrow-wide-form.component.scss']
8+
})
9+
export class NarrowWideFormComponent implements OnInit {
10+
11+
@Input() pConn$: any;
12+
@Input() formGroup$: FormGroup;
13+
14+
15+
configProps$ : Object;
16+
arChildren$: Array<any>;
17+
18+
19+
constructor() { }
20+
21+
ngOnInit() {
22+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
23+
this.arChildren$ = this.pConn$.getChildren();
24+
25+
26+
}
27+
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<div class="psdk-narrow-wide-column">
2+
<div *ngFor="let kid of arChildren$">
3+
<div class="psdk-wide-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='left' ">
4+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
5+
</div>
6+
<div class="psdk-narrow-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='right' ">
7+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
8+
</div>
9+
<div class="psdk-wide-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='a' ">
10+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
11+
</div>
12+
<div class="psdk-narrow-column" *ngIf="kid.getPConnect().getRawMetadata()['name'].toLowerCase() ==='b' ">
13+
<app-region [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-region>
14+
</div>
15+
</div>
16+
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
5+
6+
7+
.psdk-narrow-wide-column {
8+
display: flow-root;
9+
height: 100%;
10+
}
11+
12+
13+
14+
.psdk-narrow-column {
15+
float: left;
16+
min-width: 30%;
17+
padding: 0rem 0.3125rem;
18+
}
19+
20+
.psdk-wide-column {
21+
float: left;
22+
width: 70%;
23+
padding: 0rem 0.3125rem;
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { WideNarrowFormComponent } from './wide-narrow-form.component';
4+
5+
describe('WideNarrowFormComponent', () => {
6+
let component: WideNarrowFormComponent;
7+
let fixture: ComponentFixture<WideNarrowFormComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ WideNarrowFormComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(WideNarrowFormComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Component, OnInit, Input } from '@angular/core';
2+
import { FormGroup, Form } from '@angular/forms';
3+
4+
@Component({
5+
selector: 'app-wide-narrow-form',
6+
templateUrl: './wide-narrow-form.component.html',
7+
styleUrls: ['./wide-narrow-form.component.scss']
8+
})
9+
export class WideNarrowFormComponent implements OnInit {
10+
11+
@Input() pConn$: any;
12+
@Input() formGroup$: FormGroup;
13+
14+
15+
configProps$ : Object;
16+
arChildren$: Array<any>;
17+
18+
19+
constructor() { }
20+
21+
ngOnInit() {
22+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
23+
this.arChildren$ = this.pConn$.getChildren();
24+
25+
26+
}
27+
28+
}

src/app/_components/case-create-stage/case-create-stage.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<div *ngIf="kid.getPConnect().getConfigProps().template != ''" >
55
<div [ngSwitch]="kid.getPConnect().getConfigProps().template">
66
<app-default-form *ngSwitchCase="'DefaultForm'" [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-default-form>
7+
<app-narrow-wide-form *ngSwitchCase="'NarrowWideForm'" [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-narrow-wide-form>
8+
<app-wide-narrow-form *ngSwitchCase="'WideNarrowForm'" [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-wide-narrow-form>
79
<app-one-column *ngSwitchCase="'OneColumn'" [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-one-column>
810
<app-two-column *ngSwitchCase="'TwoColumn'" [formGroup$]="formGroup$" [pConn$]="kid.getPConnect()"></app-two-column>
911
<app-three-column *ngSwitchCase="'ThreeColumn'" [formGroup$]="formGroup$"[pConn$]="kid.getPConnect()"></app-three-column>

src/app/_components/flow-container/flow-container.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,19 @@ export class FlowContainerComponent implements OnInit {
412412
const assignmentsList = localPConn.getValue(
413413
CASE_CONSTS.D_CASE_ASSIGNMENTS_RESULTS
414414
);
415+
// add status
416+
const status = localPConn.getValue("caseInfo.status");
417+
418+
let localAssignment = JSON.parse(JSON.stringify(assignmentsList[0]));
419+
localAssignment.status = status;
420+
let locaAssignmentsList: Array<any> = [];
421+
locaAssignmentsList.push(localAssignment);
415422

416423
const caseActions = localPConn.getValue(CASE_CONSTS.CASE_INFO_ACTIONS);
417424

418425
if (caseActions) {
419426
this.todo_caseInfoID$ = localPConn.getValue(CASE_CONSTS.CASE_INFO_ID);
420-
this.todo_datasource$ = { source: assignmentsList };
427+
this.todo_datasource$ = { source: locaAssignmentsList };
421428
}
422429

423430
let kid = this.pConn$.getChildren()[0];

0 commit comments

Comments
 (0)