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

FEAT #12091 TIME 0:10 fix lock mode + available role diff list

parent af4236c3
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ export class ActionsListComponent implements OnInit {
this.currentResource = row;
}
this.actionService.launchAction(action, this.currentBasketInfo.ownerId, this.currentBasketInfo.groupId, this.currentBasketInfo.basketId, this.selectedRes, this.currentResource);
this.actionService.launchAction(action, this.currentBasketInfo.ownerId, this.currentBasketInfo.groupId, this.currentBasketInfo.basketId, this.selectedRes, this.currentResource, true);
}
......
......@@ -29,6 +29,7 @@ export class ActionsService {
mode: string = 'indexing';
currentResourceLock: any = null;
lockMode: boolean = true;
currentAction: any = null;
currentUserId: number = null;
......@@ -116,11 +117,12 @@ export class ActionsService {
}
launchAction(action: any, userId: number, groupId: number, basketId: number, resIds: number[], datas: any) {
launchAction(action: any, userId: number, groupId: number, basketId: number, resIds: number[], datas: any, lockRes: boolean = true) {
if (this.setActionInformations(action, userId, groupId, basketId, resIds)) {
this.loading = true;
this.lockMode = lockRes;
this.setResourceInformations(datas);
if (this.mode !== 'process') {
if (this.lockMode) {
this.http.put(`../../rest/resourcesList/users/${userId}/groups/${groupId}/baskets/${basketId}/lock`, { resources: resIds }).pipe(
tap((data: any) => {
if (this.canExecuteAction(data.lockedResources, data.lockers, resIds)) {
......@@ -216,7 +218,7 @@ export class ActionsService {
unlockResourceAfterActionModal(state: string) {
this.stopRefreshResourceLock();
if (state !== 'success' && this.mode !== 'process') {
if (state !== 'success' && this.lockMode) {
this.unlockResource();
}
}
......
......@@ -41,7 +41,7 @@
class="fa fa-chevron-down"></i></button>
<mat-menu #menu="matMenu" [class]="'roleListMenu'">
<ng-container *ngFor="let selectRole of availableRoles">
<button mat-menu-item *ngIf="selectRole.canUpdate || (selectRole.id !== 'dest' && target === 'redirect')"
<button mat-menu-item *ngIf="(selectRole.canUpdate && target !== 'redirect') || (selectRole.id !== 'dest' && target === 'redirect' && selectRole.canUpdate)"
(click)="changeRole(diffusion,role,selectRole)"
style="font-size:13px;">{{selectRole.label}}</button>
</ng-container>
......
......@@ -231,7 +231,7 @@ export class ProcessComponent implements OnInit {
}
onSubmit() {
this.actionService.launchAction(this.selectedAction, this.currentUserId, this.currentGroupId, this.currentBasketId, [this.currentResourceInformations.resId], this.currentResourceInformations);
this.actionService.launchAction(this.selectedAction, this.currentUserId, this.currentGroupId, this.currentBasketId, [this.currentResourceInformations.resId], this.currentResourceInformations, false);
}
showActionInCurrentCategory(action: any) {
......
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