diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.html b/src/frontend/app/indexation/indexing-form/indexing-form.component.html index e4bc43357ccb68c823fc1c341766f6c64f206960..7049a0574d6274d6bfffad6df524c0477827f3e6 100644 --- a/src/frontend/app/indexation/indexing-form/indexing-form.component.html +++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.html @@ -2,7 +2,7 @@ <mat-spinner style="margin:auto;"></mat-spinner> </div> <ng-container *ngIf="!loading"> - <div *ngIf="!adminMode" + <div *ngIf="!adminMode && mode == 'indexation'" style="display: flex;align-items: center;justify-content: flex-end;margin-top: 10px;margin-bottom: -20px;"> <button mat-button class="categoryLabel" (click)="toggleMailTracking()" [title]="arrFormControl['mailÂtracking'].value ? lang.untrackThisMail : lang.trackThisMail"> diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts index b057f00dfcf8e47f9c277ba669ecbde79ccbf144..ebf9b88d041654d8271d8d044b9d028935d9ef94 100644 --- a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts +++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts @@ -883,24 +883,6 @@ export class IndexingFormComponent implements OnInit { toggleMailTracking() { this.arrFormControl['mailÂtracking'].setValue(!this.arrFormControl['mailÂtracking'].value); - - if (this.mode !== 'indexation') { - if (this.arrFormControl['mailÂtracking'].value) { - this.http.post('../../rest/resources/follow', {resources: [this.resId]}).pipe( - catchError((err: any) => { - this.notify.handleErrors(err); - return of(false); - }) - ).subscribe(); - } else { - this.http.request('DELETE', '../../rest/resources/unfollow', { body: { resources: [this.resId] } }).pipe( - catchError((err: any) => { - this.notify.handleErrors(err); - return of(false); - }) - ).subscribe(); - } - } } changeCategory(categoryId: string) { diff --git a/src/frontend/app/process/process.component.html b/src/frontend/app/process/process.component.html index 1ea25fe2e241d585ed21cd483f4ef03a80507c5b..9a6c3a640d8c19e7cf8e504ff1dbe4e839112ab4 100644 --- a/src/frontend/app/process/process.component.html +++ b/src/frontend/app/process/process.component.html @@ -25,13 +25,6 @@ <ng-container *ngIf="currentTool === 'dashboard'"> <div style="display: flex;align-items: center;justify-content: flex-end;margin-top: 10px;margin-bottom: -20px;"> - <button mat-button class="categoryLabel" (click)="toggleMailTracking()" - [title]="currentResourceInformations.mailtracking ? lang.untrackThisMail : lang.trackThisMail"> - {{currentResourceInformations.mailtracking ? lang.untrackThisMail : lang.trackThisMail}} - <mat-icon color="primary" - class="{{currentResourceInformations.mailtracking ? 'fas':'far'}} fa-star" - style="font-size: 20px;"></mat-icon> - </button> </div> <div class="banner" [style.borderColor]="currentPriorityColor"> <div class="title" (click)="currentTool = 'history'"> @@ -172,6 +165,10 @@ <div class="title-divider"></div> </div> <div class="content"> + <button mat-button class="categoryLabel" (click)="toggleFollow()"> + <mat-icon color="primary" class="{{this.resourceFollowed ? 'fas':'far'}} fa-star" + style="font-size: 20px;"></mat-icon> + </button> <div class="content-item" *ngIf="this.currentResourceInformations.priority !== undefined"> <b><i class="fas fa-flag" [style.color]="this.currentResourceInformations.priorityColor" style="font-size: 25px;padding-right: 20px;"></i> @@ -273,4 +270,4 @@ </button> </div> </div> -</div> \ No newline at end of file +</div> diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index 6651bd1db85de91f63ca4ab938ccf6cf565b1041..1d7692dd56d2633a7673d63e6462a27877bceeaf 100755 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -138,6 +138,8 @@ export class ProcessComponent implements OnInit { senderLightInfo: any = { 'displayName': null, 'fillingRate': null }; hasContact: boolean = false; + resourceFollowed: boolean = false; + constructor( private route: ActivatedRoute, private _activatedRoute: ActivatedRoute, @@ -502,4 +504,24 @@ export class ProcessComponent implements OnInit { return true; } } + + toggleFollow() { + this.resourceFollowed = !this.resourceFollowed; + + if (this.resourceFollowed) { + this.http.post('../../rest/resources/follow', {resources: [this.currentResourceInformations.resId]}).pipe( + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } else { + this.http.request('DELETE', '../../rest/resources/unfollow', {body: {resources: [this.currentResourceInformations.resId]}}).pipe( + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } + } }