-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move modules * Fix tests * Remove unwanted changes * Add new test * update version * remove code
- Loading branch information
1 parent
c5c84d4
commit 87282a3
Showing
15 changed files
with
204 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ts/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...cd-case-ui-toolkit/src/lib/shared/components/palette/query-management/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
export * from './qualifying-questions/qualifying-question-detail/qualifying-question-detail.component'; | ||
export * from './qualifying-questions/qualifying-question-options/qualifying-question-options.component'; | ||
export * from './query-attachments-read/query-attachments-read.component'; | ||
export * from './query-case-details-header/query-case-details-header.component'; | ||
export * from './query-check-your-answers/query-check-your-answers.component'; | ||
export * from './query-details/query-details.component'; | ||
export * from './query-event-completion/query-event-completion.component'; | ||
export * from './query-list/query-list.component'; | ||
export * from './query-write/query-write-date-input/query-write-date-input.component'; | ||
export * from './query-write/query-write-add-documents/query-write-add-documents.component'; | ||
export * from './query-write/query-write-date-input/query-write-date-input.component'; | ||
export * from './query-write/query-write-raise-query/query-write-raise-query.component'; | ||
export * from './query-write/query-write-respond-to-query/query-write-respond-to-query.component'; | ||
export * from './query-attachments-read/query-attachments-read.component'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 54 additions & 2 deletions
56
...uery-management/components/query-check-your-answers/query-check-your-answers.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,72 @@ | ||
import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; | ||
import { FormGroup } from '@angular/forms'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { Subscription } from 'rxjs'; | ||
import { take } from 'rxjs/operators'; | ||
import { TaskSearchParameter } from '../../../../../../../lib/shared/domain'; | ||
import { EventCompletionParams } from '../../../../case-editor/domain/event-completion-params.model'; | ||
import { CaseNotifier, WorkAllocationService } from '../../../../case-editor/services'; | ||
import { QueryCreateContext, QueryListItem } from '../../models'; | ||
|
||
@Component({ | ||
selector: 'ccd-query-check-your-answers', | ||
templateUrl: './query-check-your-answers.component.html', | ||
styleUrls: ['./query-check-your-answers.component.scss'] | ||
}) | ||
export class QueryCheckYourAnswersComponent { | ||
export class QueryCheckYourAnswersComponent implements OnInit, OnDestroy { | ||
@Input() public formGroup: FormGroup; | ||
@Input() public queryItem: QueryListItem; | ||
@Input() public queryCreateContext: QueryCreateContext; | ||
@Output() public backClicked = new EventEmitter<boolean>(); | ||
public queryCreateContextEnum = QueryCreateContext; | ||
|
||
public eventCompletionParams: EventCompletionParams; | ||
private caseId: string; | ||
private eventId: string; | ||
private queryId: string; | ||
private searchTasksSubsciption: Subscription; | ||
|
||
constructor( | ||
private readonly route: ActivatedRoute, | ||
private readonly workAllocationService: WorkAllocationService, | ||
private readonly caseNotifier: CaseNotifier) { } | ||
|
||
public ngOnInit(): void { | ||
this.queryId = this.route.snapshot.params.qid; | ||
this.caseNotifier.caseView.pipe(take(1)).subscribe(caseDetails => { | ||
this.caseId = caseDetails.case_id; | ||
// To be set after integration | ||
this.eventId = 'respondToQuery'; | ||
}); | ||
} | ||
|
||
public ngOnDestroy(): void { | ||
this.searchTasksSubsciption?.unsubscribe(); | ||
} | ||
|
||
public goBack(): void { | ||
this.backClicked.emit(true); | ||
} | ||
|
||
public submit(): void { | ||
// Search Task | ||
const searchParameter = { ccdId: this.caseId } as TaskSearchParameter; | ||
this.searchTasksSubsciption = this.workAllocationService.searchTasks(searchParameter) | ||
.subscribe((response: any) => { | ||
// Filter task by query id | ||
const filteredtask = response.tasks?.find((task) => { | ||
return Object.values(task.additional_properties).some((value) => { | ||
if (value === this.queryId) { | ||
return task; | ||
} | ||
}); | ||
}); | ||
// Trigger event completion | ||
this.eventCompletionParams = { | ||
caseId: this.caseId, | ||
eventId: this.eventId, | ||
task: filteredtask | ||
}; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
.../query-management/components/query-event-completion/query-event-completion.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<ccd-case-event-completion [eventCompletionParams]="eventCompletionParams" | ||
(eventCanBeCompleted)="onEventCanBeCompleted($event)"> | ||
</ccd-case-event-completion> |
25 changes: 25 additions & 0 deletions
25
...ery-management/components/query-event-completion/query-event-completion.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { QueryEventCompletionComponent } from './query-event-completion.component'; | ||
|
||
describe('QueryEventCompletionComponent', () => { | ||
let component: QueryEventCompletionComponent; | ||
let fixture: ComponentFixture<QueryEventCompletionComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ QueryEventCompletionComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(QueryEventCompletionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
...te/query-management/components/query-event-completion/query-event-completion.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { EventCompletionParams } from '../../../../case-editor/domain/event-completion-params.model'; | ||
|
||
@Component({ | ||
selector: 'ccd-query-event-completion', | ||
templateUrl: './query-event-completion.component.html' | ||
}) | ||
export class QueryEventCompletionComponent { | ||
@Input() public eventCompletionParams: EventCompletionParams; | ||
|
||
public onEventCanBeCompleted(value: boolean): void { | ||
// Submit the query response | ||
} | ||
} |