Skip to content
Snippets Groups Projects
Commit 759e01bc authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #12091 TIME 0:30 fix unlock resource + refresh panel basket

parent a41ca6dc
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ export class ActionsListComponent implements OnInit { ...@@ -40,6 +40,7 @@ export class ActionsListComponent implements OnInit {
@Input('currentBasketInfo') currentBasketInfo: any; @Input('currentBasketInfo') currentBasketInfo: any;
@Output('refreshEvent') refreshEvent = new EventEmitter<string>(); @Output('refreshEvent') refreshEvent = new EventEmitter<string>();
@Output('refreshEventAfterAction') refreshEventAfterAction = new EventEmitter<string>();
@Output('refreshPanelFolders') refreshPanelFolders = new EventEmitter<string>(); @Output('refreshPanelFolders') refreshPanelFolders = new EventEmitter<string>();
constructor( constructor(
...@@ -56,7 +57,7 @@ export class ActionsListComponent implements OnInit { ...@@ -56,7 +57,7 @@ export class ActionsListComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
// Event after process action // Event after process action
this.subscription = this.actionService.catchAction().subscribe(message => { this.subscription = this.actionService.catchAction().subscribe(message => {
this.refreshEvent.emit(); this.refreshEventAfterAction.emit();
this.refreshPanelFolders.emit(); this.refreshPanelFolders.emit();
}); });
} }
......
...@@ -200,10 +200,14 @@ export class ActionsService { ...@@ -200,10 +200,14 @@ export class ActionsService {
} }
} }
unlockResourceAfterActionModal(state: string) {
this.stopRefreshResourceLock();
if (state !== 'success') {
this.unlockResource();
}
}
endAction(status: any) { endAction(status: any) {
this.unlockResource();
this.notify.success(this.lang.action + ' : "' + this.currentAction.label + '" ' + this.lang.done); this.notify.success(this.lang.action + ' : "' + this.currentAction.label + '" ' + this.lang.done);
this.eventAction.next(); this.eventAction.next();
...@@ -219,9 +223,8 @@ export class ActionsService { ...@@ -219,9 +223,8 @@ export class ActionsService {
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -242,9 +245,8 @@ export class ActionsService { ...@@ -242,9 +245,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -265,9 +267,8 @@ export class ActionsService { ...@@ -265,9 +267,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -288,9 +289,8 @@ export class ActionsService { ...@@ -288,9 +289,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -311,9 +311,8 @@ export class ActionsService { ...@@ -311,9 +311,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -334,9 +333,8 @@ export class ActionsService { ...@@ -334,9 +333,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -357,9 +355,8 @@ export class ActionsService { ...@@ -357,9 +355,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -380,9 +377,8 @@ export class ActionsService { ...@@ -380,9 +377,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -403,9 +399,8 @@ export class ActionsService { ...@@ -403,9 +399,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -433,9 +428,8 @@ export class ActionsService { ...@@ -433,9 +428,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -456,9 +450,8 @@ export class ActionsService { ...@@ -456,9 +450,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -478,9 +471,8 @@ export class ActionsService { ...@@ -478,9 +471,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
...@@ -501,9 +493,8 @@ export class ActionsService { ...@@ -501,9 +493,8 @@ export class ActionsService {
data: this.setDatasActionToSend() data: this.setDatasActionToSend()
}); });
dialogRef.afterClosed().pipe( dialogRef.afterClosed().pipe(
tap(() => { tap((data: any) => {
this.stopRefreshResourceLock(); this.unlockResourceAfterActionModal(data);
this.unlockResource();
}), }),
filter((data: string) => data === 'success'), filter((data: string) => data === 'success'),
tap((result: any) => { tap((result: any) => {
......
...@@ -199,6 +199,6 @@ ...@@ -199,6 +199,6 @@
<mat-divider></mat-divider> <mat-divider></mat-divider>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
<app-actions-list (refreshEvent)="refreshDao()" #actionsListContext [contextMode]="true" <app-actions-list (refreshEvent)="refreshDao()" (refreshEventAfterAction)="refreshDaoAfterAction()" #actionsListContext [contextMode]="true"
[totalRes]="allResInBasket.length" [selectedRes]="selectedRes" [currentBasketInfo]="currentBasketInfo" (refreshPanelFolders)="panelFolder.refreshFoldersTree()"> [totalRes]="allResInBasket.length" [selectedRes]="selectedRes" [currentBasketInfo]="currentBasketInfo" (refreshPanelFolders)="panelFolder.refreshFoldersTree()">
</app-actions-list> </app-actions-list>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment