Bug 530164 - Search page: Add "Edit"-Button to the search result table
diff --git a/src/app/lists/search-result-list/search-result-list.component.html b/src/app/lists/search-result-list/search-result-list.component.html
index b69f898..73e5411 100644
--- a/src/app/lists/search-result-list/search-result-list.component.html
+++ b/src/app/lists/search-result-list/search-result-list.component.html
@@ -82,10 +82,17 @@
{{ notification.responsibilityForwarding }}
</span>
</td>
- <td class="notification-tab-edit-buttons" >
- <button type="button" class="btn btn-default btn-sm" (click)="lookUpNotification(notification)">
- <span class="glyphicon glyphicon-eye-open"></span>
- </button>
+ <td class="notification-tab-edit-buttons">
+ <button type="button" class="btn btn-primary btn-sm"
+ *ngIf="(isSpecialUser() || !notification.adminFlag) && !isEnforceShowReadOnly()"
+ (click)="editNotification(notification)">
+ <span class="glyphicon glyphicon-pencil"></span>
+ </button>
+ <button type="button" class="btn btn-default btn-sm"
+ *ngIf="(!isSpecialUser() && notification.adminFlag) || isEnforceShowReadOnly()"
+ (click)="lookUpNotification(notification)">
+ <span class="glyphicon glyphicon-eye-open"></span>
+ </button>
</td>
</tr>
</tbody>
diff --git a/src/app/lists/search-result-list/search-result-list.component.ts b/src/app/lists/search-result-list/search-result-list.component.ts
index 8e2bd79..21d429f 100644
--- a/src/app/lists/search-result-list/search-result-list.component.ts
+++ b/src/app/lists/search-result-list/search-result-list.component.ts
@@ -69,6 +69,10 @@
}
}
+ onItemChanged(notification: Notification): void {
+ this.getSearchResults();
+ }
+
isBranchGas(branchId: number): boolean {
return this.sessionContext.getBranchClassById(branchId) === 'gas';
}
diff --git a/src/app/pages/search/search.component.html b/src/app/pages/search/search.component.html
index 501809c..d57bedd 100644
--- a/src/app/pages/search/search.component.html
+++ b/src/app/pages/search/search.component.html
@@ -123,7 +123,7 @@
</div>
</div>
</div>
- <app-search-result-list [globalSearchFilter]="globalSearchFilter" (onLookUpNotification)="openDialogLookUpEntry($event)"></app-search-result-list>
+ <app-search-result-list [globalSearchFilter]="globalSearchFilter" (onEditNotification)="openDialogEditEntry($event)" (onLookUpNotification)="openDialogLookUpEntry($event)"></app-search-result-list>
</div>
</div>
</div>
diff --git a/src/app/pages/search/search.component.ts b/src/app/pages/search/search.component.ts
index 7f1632e..e8c1f0b 100644
--- a/src/app/pages/search/search.component.ts
+++ b/src/app/pages/search/search.component.ts
@@ -71,6 +71,16 @@
});
}
+ openDialogEditEntry(notification: Notification) {
+ const dialogRef = this.dialog.open(EntryComponent, this.dialogConfig);
+ dialogRef.componentInstance.user = this.user;
+ dialogRef.componentInstance.isInstructionDialog = notification.adminFlag;
+ dialogRef.componentInstance.setNotification(notification);
+ dialogRef.componentInstance.isEditDialog = true;
+ dialogRef.afterClosed().subscribe(result => {
+ });
+ }
+
search() {
this.globalSearchFilter = Object.assign({}, this.currentSearchFilter);
this.sessionContext.setGlobalSearchFilter(this.globalSearchFilter);