Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Change styling of notification rows according to specification

Henriette Darge786ae2b1606b
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
index a18d2baf598..677425ea599 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
@@ -7,14 +7,18 @@
<div class="op-ian-center--content">
<ng-container *ngIf="(hasNotifications$ | async) as notifications; else noResults">
<cdk-virtual-scroll-viewport
- itemSize="90"
+ itemSize="100"
class="op-ian-center--viewport"
>
<op-in-app-notification-entry
*cdkVirtualFor="let records of notifications$ | async; trackBy: trackNotificationGroups; templateCacheSize: 0"
- class="op-ian-center--entry"
+ class="op-ian-item"
+ [class.op-ian-item_expanded]="records[0].expanded"
+ [class.op-ian-item_read]="records[0].readIAN === true"
[notification]="records[0]"
[aggregatedNotifications]="records"
+ attr.data-qa-selector="op-ian-notification-item-{{records[0].id}}"
+ [attr.data-qa-ian-read]="records[0].readIAN === true || undefined"
></op-in-app-notification-entry>
</cdk-virtual-scroll-viewport>
</ng-container>
diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html
index e8b86dc478c..98248a0aedb 100644
--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html
+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.html
@@ -1,111 +1,101 @@
-<div
- class="op-ian-item"
- [class.op-ian-item_expanded]="notification.expanded"
- [class.op-ian-item_read]="notification.readIAN === true"
- attr.data-qa-selector="op-ian-notification-item-{{notification.id}}"
- [attr.data-qa-ian-read]="notification.readIAN === true || undefined"
+<button
+ type="button"
+ class="op-ian-item--row"
+ [class.op-ian-item--row_unexpandable]="unexpandable"
+ (click)="showDetails()"
>
<ng-container *ngIf="workPackage$ && (workPackage$ | async) as workPackage; else workPackageLoading">
- <button
- type="button"
- class="op-ian-item--row"
- [class.op-ian-item--row_unexpandable]="unexpandable"
- (click)="showDetails()"
- >
+ <div
+ class="op-ian-item--top-line"
+ >
+ <div class="op-ian-item--status">
+ <op-in-app-notification-status [status]="workPackage.status"></op-in-app-notification-status>
+ </div>
+
+ <a
+ class="op-ian-item--work-package-id-link"
+ [attr.title]="workPackage.subject"
+ uiSref="work-packages.show"
+ [uiParams]="{workPackageId: workPackage.id}"
+ [textContent]="'#' + workPackage.id"
+ >
+ </a>
<div
- class="op-ian-item--top-line"
+ *ngIf="project"
+ class="op-ian-item--project"
>
- <div class="op-ian-item--status">
- <op-in-app-notification-status [status]="workPackage.status"></op-in-app-notification-status>
- </div>
+ - <a
+ class="op-ian-item--project-link" [href]="project.showUrl"
+ [textContent]="project.title"
+ (click)="projectClicked($event)"
+ target="_blank"
+ ></a> -
+ </div>
- <a
- class="op-ian-item--work-package-id-link"
- [attr.title]="workPackage.subject"
- uiSref="work-packages.show"
- [uiParams]="{workPackageId: workPackage.id}"
- [textContent]="'#' + workPackage.id"
- (click)="resourceLinkClicked.emit(workPackage)"
- >
- </a>
+ <div
+ class="op-ian-item--reason-wrapper"
+ >
+ <span
+ class="op-ian-item--reason"
+ *ngFor="let item of translatedReasons | keyvalue; let first = first; let last = last"
+ >
+ {{ item.key }}<ng-container *ngIf="!last && first !== last">, </ng-container>
+ </span>
+ </div>
- <div
- *ngIf="project"
- class="op-ian-item--project"
- >
- - <a
- class="op-ian-item--project-link" [href]="project.showUrl"
- [textContent]="project.title"
- (click)="projectClicked($event)"
- target="_blank"
- ></a> -
- </div>
+ <span
+ class="op-ian-item--reason-count"
+ [textContent]="aggregatedNotifications.length"
+ ></span>
- <div
- class="op-ian-item--reason-wrapper"
+ <div class="op-ian-item--buttons">
+ <i
+ *ngIf="!notification.readIAN"
+ data-qa-selector="mark-as-read-button"
+ class="op-ian-item--button icon-mark-read"
+ (click)="markAsRead($event, aggregatedNotifications)"
>
- <span
- class="op-ian-item--reason"
- *ngFor="let item of translatedReasons | keyvalue; let first = first; let last = last"
- >
- {{ item.key }}<ng-container *ngIf="!last && first !== last">, </ng-container>
- </span>
- </div>
-
- <span
- class="op-ian-item--reason-count"
- [textContent]="aggregatedNotifications.length"
- ></span>
-
- <div class="op-ian-item--buttons">
- <i
- *ngIf="!notification.readIAN"
- data-qa-selector="mark-as-read-button"
- class="op-ian-item--button icon-mark-read"
- (click)="markAsRead($event, aggregatedNotifications)"
- >
- </i>
- </div>
+ </i>
</div>
+ </div>
- <div
- class="op-ian-item--middle-line"
+ <div
+ class="op-ian-item--middle-line"
+ >
+ <span
+ [ngClass]="'op-ian-item--work-package-type __hl_inline_type_' + workPackage.type.id"
+ [textContent]="workPackage.type.name">
+ </span>
+ <span
+ [textContent]="workPackage.subject"
+ class="op-ian-item--work-package-subject"
+ [class.-read]="notification.readIAN"
>
+ </span>
+ </div>
+
+ <div
+ class="op-ian-item--bottom-line"
+ >
+ <div
+ class="op-ian-item--date"
+ [title]="fixedTime"
+ [textContent]="relativeTime$ | async"
+ ></div>
+ <div>
+ <op-principal
+ class="op-ian-item--actors"
+ [principal]="actors[0]"
+ [hide-name]="false"
+ [hide-avatar]="true"
+ ></op-principal>
<span
- [ngClass]="'op-ian-item--work-package-type __hl_inline_type_' + workPackage.type.id"
- [textContent]="workPackage.type.name">
- </span>
- <span
- [textContent]="workPackage.subject"
- class="op-ian-item--work-package-subject"
- [class.-read]="notification.readIAN"
+ *ngIf="actors.length > 1"
>
+ {{ text_for_additional_authors(actors.length - 1) }}
</span>
</div>
-
- <div
- class="op-ian-item--bottom-line"
- >
- <div
- class="op-ian-item--date"
- [title]="fixedTime"
- [textContent]="relativeTime$ | async"
- ></div>
- <div>
- <op-principal
- class="op-ian-item--actors"
- [principal]="actors[0]"
- [hide-name]="false"
- [hide-avatar]="true"
- ></op-principal>
- <span
- *ngIf="actors.length > 1"
- >
- {{ text_for_additional_authors(actors.length - 1) }}
- </span>
- </div>
- </div>
- </button>
+ </div>
</ng-container>
<ng-template #workPackageLoading>
<op-content-loader
@@ -118,4 +108,4 @@
<svg:rect x="0" y="14" width="100%" height="5" rx="1" />
</op-content-loader>
</ng-template>
-</div>
+</button>
diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
index e3b3b53ed85..0dc2b0cc596 100644
--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass
@@ -1,24 +1,36 @@
@import "src/assets/sass/helpers"
-$ian-bg-color: #F9F9F9
-$ian-bg-hover-color: #F1F8FF
+$ian-bg-color: #FFFFFF
+$ian-bg-hover-color: var(--gray-light)
+$ian-bg-selected-color: #D1E5F5
+$ian-bg-selected-hover-color: darken($ian-bg-selected-color, 2)
// This needs to be set in the itemSize of
// the virtual scroller
-$ian-height: 90px
+$ian-height: 100px
$subject-font-size: 14px
.op-ian-item
+ display: block
background: $ian-bg-color
- margin: 0 0 10px 0
- padding: 10px 20px 10px 10px
+ margin: 0
+ padding: 15px 20px 15px 10px
font-size: 0.9rem
- border: 1px solid var(--content-default-border-color)
+ border-top: 1px solid var(--content-default-border-color)
border-radius: 2px
height: $ian-height
&:hover
background: $ian-bg-hover-color
+ &:last-of-type
+ border-bottom: 1px solid var(--content-default-border-color)
+
+ &_selected
+ background: $ian-bg-selected-color
+
+ &_selected:hover
+ background: $ian-bg-selected-hover-color
+
&--row
@include unset-button-styles
width: 100%
diff --git a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts
index 176a4d55eb0..5af620a4f02 100644
--- a/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts
+++ b/frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts
@@ -2,6 +2,7 @@ import {
ChangeDetectionStrategy,
Component,
EventEmitter,
+ HostBinding,
Input,
OnInit,
Output,
@@ -40,12 +41,12 @@ import { IanCenterService } from 'core-app/features/in-app-notifications/center/
encapsulation: ViewEncapsulation.None,
})
export class InAppNotificationEntryComponent implements OnInit {
+ @HostBinding('class.op-ian-item') className = true;
+
@Input() notification:InAppNotification;
@Input() aggregatedNotifications:InAppNotification[];
- @Output() resourceLinkClicked = new EventEmitter<unknown>();
-
workPackage$:Observable<WorkPackageResource>|null = null;
loading$ = this.storeService.query.selectLoading();