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

FEAT #12331 TIME 0:15 add can edit params + default tab

parent b9a309e8
No related branches found
No related tags found
No related merge requests found
...@@ -560,7 +560,7 @@ export class ActionsService { ...@@ -560,7 +560,7 @@ export class ActionsService {
processDocument(options: any = null) { processDocument(options: any = null) {
this.stopRefreshResourceLock(); this.stopRefreshResourceLock();
this.unlockResource(); this.unlockResource();
this.router.navigate([`/process/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/resId/${this.currentResIds}`], { queryParams: { tab: options.defaultTab } }); this.router.navigate([`/process/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/resId/${this.currentResIds}`]);
} }
signatureBookAction(options: any = null) { signatureBookAction(options: any = null) {
......
...@@ -238,8 +238,11 @@ export class ListAdministrationComponent implements OnInit { ...@@ -238,8 +238,11 @@ export class ListAdministrationComponent implements OnInit {
this.selectedListEvent = this.basketGroup.list_event === null ? 'noEvent' : this.basketGroup.list_event; this.selectedListEvent = this.basketGroup.list_event === null ? 'noEvent' : this.basketGroup.list_event;
this.selectedListEventClone = this.selectedListEvent; this.selectedListEventClone = this.selectedListEvent;
this.selectedProcessTool.defaultTab = this.basketGroup.list_event_data === null && this.basketGroup.list_event === 'processDocument' ? 'dashboard' : this.basketGroup.list_event_data.defaultTab; if (this.basketGroup.list_event === 'processDocument') {
this.selectedProcessTool.canUpdate = this.basketGroup.list_event_data === null ? false : this.basketGroup.list_event_data.canUpdate; this.selectedProcessTool.defaultTab = this.basketGroup.list_event_data === null ? 'dashboard' : this.basketGroup.list_event_data.defaultTab;
this.selectedProcessTool.canUpdate = this.basketGroup.list_event_data === null ? false : this.basketGroup.list_event_data.canUpdate;
}
this.selectedProcessToolClone = JSON.parse(JSON.stringify(this.selectedProcessTool)); this.selectedProcessToolClone = JSON.parse(JSON.stringify(this.selectedProcessTool));
this.displayedSecondaryDataClone = JSON.parse(JSON.stringify(this.displayedSecondaryData)); this.displayedSecondaryDataClone = JSON.parse(JSON.stringify(this.displayedSecondaryData));
} }
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
[resId]="currentResourceInformations.resId" [target]="'process'" (reloadBadgeAttachments)="refreshBadge($event,'attachments')"> [resId]="currentResourceInformations.resId" [target]="'process'" (reloadBadgeAttachments)="refreshBadge($event,'attachments')">
</app-attachments-list> </app-attachments-list>
<app-indexing-form *ngIf="currentTool === 'info' && !loading" #indexingForm [groupId]="currentGroupId" <app-indexing-form *ngIf="currentTool === 'info' && !loading" #indexingForm [groupId]="currentGroupId"
[resId]="currentResourceInformations.resId" [indexingFormId]="currentResourceInformations.modelId" [mode]="'process'"></app-indexing-form> [resId]="currentResourceInformations.resId" [indexingFormId]="currentResourceInformations.modelId" [mode]="'process'" [canEdit]="canEditData"></app-indexing-form>
<button mat-raised-button *ngIf="indexingForm !== undefined && currentTool === 'info'" [disabled]="!indexingForm.isResourceModified()" (click)="confirmModification()" color="primary" [title]="lang.openInExternalModal" style="position:absolute;top:0px;"> <button mat-raised-button *ngIf="indexingForm !== undefined && currentTool === 'info'" [disabled]="!indexingForm.isResourceModified()" (click)="confirmModification()" color="primary" [title]="lang.openInExternalModal" style="position:absolute;top:0px;">
{{lang.save}} {{lang.save}}
</button> </button>
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
<app-attachments-list *ngIf="modal.id === 'attachments' && !loading" #appAttachmentsList <app-attachments-list *ngIf="modal.id === 'attachments' && !loading" #appAttachmentsList
[resId]="currentResourceInformations.resId" (reloadBadgeAttachments)="refreshBadge($event,'attachments')"> [resId]="currentResourceInformations.resId" (reloadBadgeAttachments)="refreshBadge($event,'attachments')">
</app-attachments-list> </app-attachments-list>
<app-indexing-form *ngIf="modal.id === 'info' && !loading" #indexingForm [groupId]="currentGroupId" [indexingFormId]="currentResourceInformations.modelId" [resId]="currentResourceInformations.resId" [mode]="'process'"> <app-indexing-form *ngIf="modal.id === 'info' && !loading" #indexingForm [groupId]="currentGroupId" [indexingFormId]="currentResourceInformations.modelId" [resId]="currentResourceInformations.resId" [mode]="'process'" [canEdit]="canEditData">
</app-indexing-form> </app-indexing-form>
</div> </div>
</div> </div>
...@@ -47,9 +47,7 @@ export class ProcessComponent implements OnInit { ...@@ -47,9 +47,7 @@ export class ProcessComponent implements OnInit {
categoryUse: [] categoryUse: []
}; };
currentResourceInformations: any = { currentResourceInformations: any = {};
};
processTool: any[] = [ processTool: any[] = [
{ {
...@@ -122,6 +120,8 @@ export class ProcessComponent implements OnInit { ...@@ -122,6 +120,8 @@ export class ProcessComponent implements OnInit {
actionEnded: boolean = false; actionEnded: boolean = false;
canEditData: boolean = false;
@ViewChild('snav', { static: true }) sidenavLeft: MatSidenav; @ViewChild('snav', { static: true }) sidenavLeft: MatSidenav;
@ViewChild('snav2', { static: true }) sidenavRight: MatSidenav; @ViewChild('snav2', { static: true }) sidenavRight: MatSidenav;
...@@ -156,11 +156,6 @@ export class ProcessComponent implements OnInit { ...@@ -156,11 +156,6 @@ export class ProcessComponent implements OnInit {
this.headerService.setHeader(this.lang.eventProcessDoc); this.headerService.setHeader(this.lang.eventProcessDoc);
this.route.params.subscribe(params => { this.route.params.subscribe(params => {
this.route.queryParams.subscribe(queryParams => {
if (queryParams['tab'] !== undefined) {
this.currentTool = queryParams['tab'];
}
});
this.currentUserId = params['userSerialId']; this.currentUserId = params['userSerialId'];
this.currentGroupId = params['groupSerialId']; this.currentGroupId = params['groupSerialId'];
this.currentBasketId = params['basketId']; this.currentBasketId = params['basketId'];
...@@ -174,6 +169,19 @@ export class ProcessComponent implements OnInit { ...@@ -174,6 +169,19 @@ export class ProcessComponent implements OnInit {
this.loadResource(); this.loadResource();
this.http.get(`../../rest/baskets/${this.currentBasketId}/groups/${this.currentGroupId}/listEventData`).pipe(
tap((data: any) => {
if (data.listEventData !== null) {
this.currentTool = data.listEventData.defaultTab;
this.canEditData = data.listEventData.canUpdate;
}
}),
catchError((err: any) => {
this.notify.handleErrors(err);
return of(false);
})
).subscribe();
this.http.get(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/actions?resId=${this.currentResourceInformations.resId}`).pipe( this.http.get(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/actions?resId=${this.currentResourceInformations.resId}`).pipe(
map((data: any) => { map((data: any) => {
data.actions = data.actions.map((action: any, index: number) => { data.actions = data.actions.map((action: any, index: number) => {
......
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