Ok-484, OK-485, OK-486 Column w eye-symbol and lookup-entry call
diff --git a/src/app/dialogs/entry/entry.component.ts b/src/app/dialogs/entry/entry.component.ts
index b7fd69d..1f51c24 100644
--- a/src/app/dialogs/entry/entry.component.ts
+++ b/src/app/dialogs/entry/entry.component.ts
@@ -12,7 +12,7 @@
import { AbstractListComponent } from '../../lists/abstract-list/abstract-list.component';
import { SessionContext } from '../../common/session-context';
import { BannerMessage } from '../../common/banner-message';
-import { StatusEn, BannerMessageStatusEn,ErrorType } from '../../common/enums';
+import { StatusEn, BannerMessageStatusEn, ErrorType } from '../../common/enums';
import { FormattedTimestampPipe } from '../../common-components/pipes/formatted-timestamp.pipe';
import { MessageService } from '../../services/message.service';
@Component({
diff --git a/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.html b/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.html
index 2513ae7..d8b9aad 100644
--- a/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.html
+++ b/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.html
@@ -9,9 +9,9 @@
<app-message-banner></app-message-banner>
<div class="panel-body shift-change-protocol-panel-body">
<app-responsibility #respCompVar [responsiblitySelection]="responsibilitiesContainer"></app-responsibility>
- <app-future-notifications [withCheckboxes]="true" [withEditButtons]="false" [isCollapsible]="false" [stayHidden]="false"></app-future-notifications>
- <app-open-notifications [withCheckboxes]="true" [withEditButtons]="false" [isCollapsible]="false" [stayHidden]="false"></app-open-notifications>
- <app-finished-notifications [withCheckboxes]="true" [withEditButtons]="false" [isCollapsible]="false" [stayHidden]="false"></app-finished-notifications>
+ <app-future-notifications [withCheckboxes]="true" [withEditButtons]="true" [isCollapsible]="false" [stayHidden]="true" [gridId]="'ShiftChangeFutureNot'" (onLookUpNotification)="openDialogLookUpEntry($event)"></app-future-notifications>
+ <app-open-notifications [withCheckboxes]="true" [withEditButtons]="true" [isCollapsible]="false" [stayHidden]="true" [gridId]="'ShiftChangeOpenNot'" (onLookUpNotification)="openDialogLookUpEntry($event)"></app-open-notifications>
+ <app-finished-notifications [withCheckboxes]="true" [withEditButtons]="true" [isCollapsible]="false" [stayHidden]="true" [gridId]="'ShiftChangeFinishedNot'" (onLookUpNotification)="openDialogLookUpEntry($event)"></app-finished-notifications>
</div>
</div>
</div>
diff --git a/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.ts b/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.ts
index 8f75cca..5d99ab6 100644
--- a/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.ts
+++ b/src/app/dialogs/shift-change-protocol/shift-change-protocol.component.ts
@@ -1,26 +1,48 @@
-import { Component, Optional, OnInit, EventEmitter } from '@angular/core';
-import { MdDialogRef } from '@angular/material';
+import { Component, Optional, Input, Output, OnInit, EventEmitter } from '@angular/core';
+import { MdDialog, MdDialogRef, MdDialogConfig } from '@angular/material';
+import { SessionContext } from '../../common/session-context';
+import { User } from '../../model/user';
+import { Notification } from '../../model/notification';
+import { FilterMatrix } from '../../model/controller-model/filter-matrix';
+import { EntryComponent } from '../../dialogs/entry/entry.component';
import { TerritoryResponsibility } from '../../model/territory-responsibility';
import { ResponsibilityService } from '../../services/responsibility.service';
import { BannerMessage } from '../../common/banner-message';
import { BannerMessageStatusEn } from '../../common/enums';
import { NotificationService } from '../../services/notification.service';
import { MessageService } from '../../services/message.service';
+import { ErrorType } from '../../common/enums';
+import { StatusEn } from '../../common/enums';
@Component({
selector: 'app-shift-change-protocol',
templateUrl: './shift-change-protocol.component.html',
styleUrls: ['./shift-change-protocol.component.css', '../../lists/abstract-list/abstract-list.component.css'],
})
-export class ShiftChangeProtocolComponent {
+export class ShiftChangeProtocolComponent implements OnInit {
+ @Output() onLookUpNotification = new EventEmitter<Notification>();
+
+ private dialogConfig = new MdDialogConfig();
+
+ user: User = null;
+ responsiblitiesRetrieveDone = false;
+
+ public sessionContext: SessionContext;
responsibilitiesContainer: TerritoryResponsibility[];
notificationService: NotificationService;
- constructor(
+ constructor( public dialog: MdDialog,
@Optional() public dialogRef: MdDialogRef<ShiftChangeProtocolComponent>,
private responsibilityService: ResponsibilityService,
public messageService: MessageService) { }
+
+ ngOnInit() {
+ this.dialogConfig.disableClose = true;
+ this.user = this.sessionContext.getCurrUser();
+
+ }
+
setResponsibilitiesContainer(responsibilitiesContainer: TerritoryResponsibility[]) {
this.responsibilitiesContainer = responsibilitiesContainer;
}
@@ -29,4 +51,15 @@
this.dialogRef.close();
this.messageService.deactivateMessage();
}
+
+ openDialogLookUpEntry(notification: Notification) {
+
+ const lookupDlgRef = this.dialog.open(EntryComponent, this.dialogConfig);
+ // TODO: check init of sessionContext
+ lookupDlgRef.componentInstance.user = this.user;
+ lookupDlgRef.componentInstance.setNotification(notification);
+ lookupDlgRef.componentInstance.isReadOnlyDialog = true;
+ lookupDlgRef.afterClosed().subscribe(result => {
+ });
+ }
}
diff --git a/src/app/lists/abstract-list/abstract-list.component.ts b/src/app/lists/abstract-list/abstract-list.component.ts
index 77f1e60..de0cf94 100644
--- a/src/app/lists/abstract-list/abstract-list.component.ts
+++ b/src/app/lists/abstract-list/abstract-list.component.ts
@@ -258,6 +258,13 @@
return this.user && this.user.specialUser;
}
+ isForShiftChangeGrid(): boolean {
+ if (this.gridId === null || this.gridId === '') {
+ return false;
+ }
+ return this.gridId.startsWith('ShiftChange');
+ }
+
public sort(column: string) {
diff --git a/src/app/lists/finished-notifications/finished-notifications.component.html b/src/app/lists/finished-notifications/finished-notifications.component.html
index c65006a..c557c12 100644
--- a/src/app/lists/finished-notifications/finished-notifications.component.html
+++ b/src/app/lists/finished-notifications/finished-notifications.component.html
@@ -53,7 +53,7 @@
</thead>
<tbody>
<tr *ngFor="let notification of notifications" class='notification_row_testable'>
- <td colspan="8" style="padding:0px;">
+ <td [attr.colspan]="(withCheckboxes && withEditButtons)?9:8" style="padding:0px;">
<table style="width:100%">
<tr>
<td *ngIf="withCheckboxes" class="notification-check-col">
@@ -82,10 +82,10 @@
<td class="notification-tab-finished-at-col">{{ notification.finishedDate | formattedTimestamp: 'DD.MM.YYYY HH:mm' }}</td>
<td class="notification-tab-responsibility-forwarding">{{ notification.responsibilityForwarding }}</td>
<td class="notification-tab-edit-buttons" *ngIf="withEditButtons && !isStatusClosed(notification)">
- <button type="button" class="btn btn-primary btn-sm" *ngIf="isSpecialUser() || !notification.adminFlag" (click)="editNotification(notification)">
+ <button type="button" class="btn btn-primary btn-sm" *ngIf="(isSpecialUser() || !notification.adminFlag) && !isForShiftChangeGrid()" (click)="editNotification(notification)">
<span class="glyphicon glyphicon-pencil"></span>
</button>
- <button type="button" class="btn btn-default btn-sm" *ngIf="!isSpecialUser() && notification.adminFlag" (click)="lookUpNotification(notification)">
+ <button type="button" class="btn btn-default btn-sm" *ngIf="(!isSpecialUser() && notification.adminFlag) || isForShiftChangeGrid()" (click)="lookUpNotification(notification)">
<span class="glyphicon glyphicon-eye-open"></span>
</button>
</td>
@@ -96,7 +96,7 @@
</td>
</tr>
<tr id="history_openNot_{{notification.id}}" [ngClass]="{'panel-collapse': notification.historyOpen}" *ngIf="isCollapsible && notification.historyOpen">
- <td colspan="8">
+ <td [attr.colspan]="(withCheckboxes && withEditButtons)?9:8">
<table style="width:100%;" class="notificationVersions">
<tbody>
<tr *ngFor="let notificationVersion of notification.decoratorNotificationVersions">
diff --git a/src/app/lists/future-notifications/future-notifications.component.html b/src/app/lists/future-notifications/future-notifications.component.html
index fea9d06..6d140a7 100644
--- a/src/app/lists/future-notifications/future-notifications.component.html
+++ b/src/app/lists/future-notifications/future-notifications.component.html
@@ -56,7 +56,7 @@
</thead>
<tbody>
<tr *ngFor="let notification of notifications">
- <td colspan="7" style="padding:0px;">
+ <td [attr.colspan]="(withCheckboxes && withEditButtons)?8:7" style="padding:0px;">
<table style="width:100%">
<tbody>
<tr>
@@ -88,10 +88,10 @@
<td class="notification-tab-finished-at-col">{{ notification.expectedFinishDate | formattedTimestamp: 'DD.MM.YYYY HH:mm'}}</td>
<td class="notification-tab-responsibility-forwarding">{{ notification.responsibilityForwarding }}</td>
<td class="notification-tab-edit-buttons" *ngIf="withEditButtons">
- <button type="button" class="btn btn-primary btn-sm" *ngIf="isSpecialUser() || !notification.adminFlag" (click)="editNotification(notification)">
+ <button type="button" class="btn btn-primary btn-sm" *ngIf="(isSpecialUser() || !notification.adminFlag) && !isForShiftChangeGrid()" (click)="editNotification(notification)">
<span class="glyphicon glyphicon-pencil"></span>
</button>
- <button type="button" class="btn btn-default btn-sm" *ngIf="!isSpecialUser() && notification.adminFlag" (click)="lookUpNotification(notification)">
+ <button type="button" class="btn btn-default btn-sm" *ngIf="(!isSpecialUser() && notification.adminFlag) || isForShiftChangeGrid()" (click)="lookUpNotification(notification)">
<span class="glyphicon glyphicon-eye-open"></span>
</button>
</td>
diff --git a/src/app/lists/open-notifications/open-notifications.component.html b/src/app/lists/open-notifications/open-notifications.component.html
index ad01b0d..3fced63 100644
--- a/src/app/lists/open-notifications/open-notifications.component.html
+++ b/src/app/lists/open-notifications/open-notifications.component.html
@@ -39,7 +39,7 @@
</thead>
<tbody>
<tr *ngFor="let notification of notifications">
- <td colspan="8" style="padding:0px;">
+ <td [attr.colspan]="(withCheckboxes && withEditButtons)?9:8" style="padding:0px;">
<table style="width:100%">
<tbody>
<tr>
@@ -86,16 +86,16 @@
</span>
</td>
<td class="notification-tab-edit-buttons" *ngIf="withEditButtons">
- <button type="button" class="btn btn-primary btn-sm" *ngIf="isSpecialUser() || !notification.adminFlag" (click)="editNotification(notification)">
+ <button type="button" class="btn btn-primary btn-sm" *ngIf="(isSpecialUser() || !notification.adminFlag) && !isForShiftChangeGrid()" (click)="editNotification(notification)">
<span class="glyphicon glyphicon-pencil"></span>
</button>
- <button type="button" class="btn btn-default btn-sm" *ngIf="!isSpecialUser() && notification.adminFlag" (click)="lookUpNotification(notification)">
+ <button type="button" class="btn btn-default btn-sm" *ngIf="(!isSpecialUser() && notification.adminFlag) || isForShiftChangeGrid()" (click)="lookUpNotification(notification)">
<span class="glyphicon glyphicon-eye-open"></span>
</button>
</td>
</tr>
<tr id="history_openNot_{{notification.id}}" [ngClass]="{'panel-collapse': notification.historyOpen}" *ngIf="isCollapsible && notification.historyOpen">
- <td colspan="8">
+ <td [attr.colspan]="(withCheckboxes && withEditButtons)?9:8">
<table style="width:100%;" class="notificationVersions">
<tbody>
<tr *ngFor="let notificationVersion of notification.decoratorNotificationVersions">
diff --git a/src/app/pages/reminder/reminder.component.spec.ts b/src/app/pages/reminder/reminder.component.spec.ts
index 66730c0..9ff331f 100644
--- a/src/app/pages/reminder/reminder.component.spec.ts
+++ b/src/app/pages/reminder/reminder.component.spec.ts
@@ -172,19 +172,19 @@
}),
MockComponent({
selector: 'app-abstract-list', inputs: [
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-finished-notifications', inputs: [ 'responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-open-notifications', inputs: [ 'responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-future-notifications', inputs: [ 'responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-message-banner'
diff --git a/src/app/pages/search/search.component.spec.ts b/src/app/pages/search/search.component.spec.ts
index 92d7a3c..779d275 100644
--- a/src/app/pages/search/search.component.spec.ts
+++ b/src/app/pages/search/search.component.spec.ts
@@ -180,19 +180,19 @@
MockComponent({ selector: 'app-loading-spinner' }),
MockComponent({
selector: 'app-abstract-list', inputs: [
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-finished-notifications', inputs: ['responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-open-notifications', inputs: ['responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-future-notifications', inputs: ['responsiblitySelection',
- 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden']
+ 'withCheckboxes', 'withEditButtons', 'isCollapsible', 'stayHidden', 'gridId']
}),
MockComponent({
selector: 'app-message-banner'
diff --git a/src/styles.css b/src/styles.css
index 59d48d0..fffe858 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -174,7 +174,7 @@
.shift-change-protocol-panel-body {
padding: 0px 15px;
overflow: scroll;
- display: table;
+ display: inline;
}