Skip to content
Snippets Groups Projects
Commit 04c091fa authored by Pierre-Yves Bele Calo's avatar Pierre-Yves Bele Calo
Browse files

[US FOX-242] delete confirmation to stop subrogation

Approved-by: Makhtar Diagne
Approved-by: Zakaria TIRDAD
parent 3be9a41f
No related branches found
No related tags found
1 merge request!1Feature/design/1
{ {
"name": "ui-frontend-common", "name": "ui-frontend-common",
"version": "1.0.3", "version": "1.0.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "ui-frontend-common", "name": "ui-frontend-common",
"version": "1.0.3", "version": "1.0.4",
"main": "src/index.ts", "main": "src/index.ts",
"pki": { "pki": {
"path": "../../dev-deployment/environments/certs/server/hosts/localhost", "path": "../../dev-deployment/environments/certs/server/hosts/localhost",
......
...@@ -14,14 +14,3 @@ ...@@ -14,14 +14,3 @@
keyboard_arrow_up keyboard_arrow_up
</i> </i>
</div> </div>
<ng-template #stopConfirmDialog>
<vitamui-common-confirm-dialog
i18n="@@stopSubrogationConfirmDialogContent"
dialogTitle="Arrêter la subrogation ?" i18n-dialogTitle="@@stopSubrogationConfirmDialogTitle"
confirmLabel="Arrêter" i18n-confirmLabel="@@stopSubrogationConfirmDialogConfirmLabel"
cancelLabel="Annuler" i18n-cancelLabel="@@stopSubrogationConfirmDialogCancelLabel"
>
Êtes vous sûr de vouloir arrêter la subrogation de l'utilisateur {{ authService?.user?.lastname }} {{ authService?.user?.firstname }} ?
</vitamui-common-confirm-dialog>
</ng-template>
...@@ -35,12 +35,11 @@ ...@@ -35,12 +35,11 @@
* knowledge of the CeCILL-C license and that you accept its terms. * knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import * as moment_ from 'moment'; import * as moment_ from 'moment';
import { filter, switchMap } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../auth.service'; import { AuthService } from '../../auth.service';
import { ConfirmDialogService } from '../../components/confirm-dialog/confirm-dialog.service';
import { Subrogation } from '../../models'; import { Subrogation } from '../../models';
import { SubrogationService } from '../subrogation.service'; import { SubrogationService } from '../subrogation.service';
...@@ -53,8 +52,6 @@ const moment = moment_; ...@@ -53,8 +52,6 @@ const moment = moment_;
}) })
export class SubrogationBannerComponent implements OnInit { export class SubrogationBannerComponent implements OnInit {
@ViewChild('stopConfirmDialog', { static: true }) stopConfirmDialogTemplateRef: TemplateRef<SubrogationBannerComponent>;
show = false; show = false;
hidden = false; hidden = false;
endDate: Date; endDate: Date;
...@@ -63,8 +60,7 @@ export class SubrogationBannerComponent implements OnInit { ...@@ -63,8 +60,7 @@ export class SubrogationBannerComponent implements OnInit {
constructor( constructor(
public authService: AuthService, public authService: AuthService,
private subrogationService: SubrogationService, private subrogationService: SubrogationService
private confirmDialogService: ConfirmDialogService
) { } ) { }
ngOnInit() { ngOnInit() {
...@@ -84,10 +80,7 @@ export class SubrogationBannerComponent implements OnInit { ...@@ -84,10 +80,7 @@ export class SubrogationBannerComponent implements OnInit {
} }
onStopSubrogation() { onStopSubrogation() {
this.confirmDialogService.confirm(this.stopConfirmDialogTemplateRef).pipe( this.subrogationService.decline(this.subrogation.id).subscribe(() => {
switchMap(() => this.subrogationService.decline(this.subrogation.id))
)
.subscribe(() => {
this.show = false; this.show = false;
this.authService.logoutAndRedirectToUiForUser(this.authService.user.superUser); this.authService.logoutAndRedirectToUiForUser(this.authService.user.superUser);
}); });
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"rxjs": "^6.5.5", "rxjs": "^6.5.5",
"tslib": "^1.13.0", "tslib": "^1.13.0",
"ui-frontend-common": "file:../ui-frontend-common/ui-frontend-common-1.0.3.tgz", "ui-frontend-common": "file:../ui-frontend-common/ui-frontend-common-1.0.4.tgz",
"underscore": "^1.10.2", "underscore": "^1.10.2",
"utf-8-validate": "^5.0.2", "utf-8-validate": "^5.0.2",
"web-animations-js": "^2.3.2", "web-animations-js": "^2.3.2",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment