-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implementation/59434 visualize reminders in notification center #17323
Merged
akabiru
merged 13 commits into
dev
from
implementation/59434-visualize-reminders-in-notification-center
Dec 12, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5124543
Reinstate "Add reminder note as an embedded notification detail"
akabiru 1e6d463
Extract relative time component for reuse
akabiru c50b436
Render reminder inline notification entry
akabiru 7b90cf3
Add reminders filter to notifications sidemenu
akabiru eb74b9c
Remove actor byline in reminder context
akabiru 5e1e42b
Add basic notification reminder feature spec
akabiru 2ad579f
Add full stop on relative time as per design
akabiru 177fa19
Switch to clock icon for reminders menu
akabiru 6887ec4
Merge branch 'implementation/59721-add-setedit-reminder-buttondialog-…
akabiru a8537f3
add notification center sidemenu feature specs
akabiru 3f84773
Implementation/59967 remove reminder notifications from aggregation a…
akabiru 0ce5623
[#59989] Truncate the reminder note
akabiru 7a5e1cf
[#59992] Remove muted style from reminder note so it stands out separ…
akabiru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...res/in-app-notifications/entry/actors-line/in-app-notification-actors-line.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...in-app-notifications/entry/relative-time/in-app-notification-relative-time.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div | ||
class="op-ian-relative-time" | ||
[title]="fixedTime" | ||
[textContent]="relativeTime$ | async"> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
...in-app-notifications/entry/relative-time/in-app-notification-relative-time.component.sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "helpers" | ||
|
||
.op-ian-relative-time | ||
@include text-shortener | ||
max-width: 100% | ||
line-height: 1rem |
63 changes: 63 additions & 0 deletions
63
...s/in-app-notifications/entry/relative-time/in-app-notification-relative-time.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
Input, | ||
OnInit, | ||
ViewEncapsulation, | ||
} from '@angular/core'; | ||
import { TimezoneService } from 'core-app/core/datetime/timezone.service'; | ||
import { I18nService } from 'core-app/core/i18n/i18n.service'; | ||
import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model'; | ||
import { Observable, timer } from 'rxjs'; | ||
import { distinctUntilChanged, map } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'op-in-app-notification-relative-time', | ||
templateUrl: './in-app-notification-relative-time.component.html', | ||
styleUrls: ['./in-app-notification-relative-time.component.sass'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class InAppNotificationRelativeTimeComponent implements OnInit { | ||
@Input() notification:INotification; | ||
@Input() hasActorByLine:boolean = true; | ||
|
||
// Fixed notification time | ||
fixedTime:string; | ||
|
||
// Format relative elapsed time (n seconds/minutes/hours ago) | ||
// at an interval for auto updating | ||
relativeTime$:Observable<string>; | ||
|
||
text = { | ||
updated_by_at: (age:string):string => this.I18n.t( | ||
'js.notifications.center.text_update_date_by', | ||
{ date: age }, | ||
), | ||
}; | ||
|
||
constructor( | ||
private I18n:I18nService, | ||
private timezoneService:TimezoneService, | ||
) { } | ||
|
||
ngOnInit():void { | ||
this.buildTime(); | ||
} | ||
|
||
private buildTime() { | ||
this.fixedTime = this.timezoneService.formattedDatetime(this.notification.createdAt); | ||
this.relativeTime$ = timer(0, 10000) | ||
.pipe( | ||
map(() => { | ||
const time = this.timezoneService.formattedRelativeDateTime(this.notification.createdAt); | ||
if (this.hasActorByLine && this.notification._links.actor) { | ||
return this.text.updated_by_at(time); | ||
} | ||
|
||
return `${time}.`; | ||
}), | ||
distinctUntilChanged(), | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...-app-notifications/entry/reminder-alert/in-app-notification-reminder-alert.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<op-in-app-notification-relative-time | ||
[notification]="reminderAlert" | ||
[hasActorByLine]="false" | ||
/> | ||
<span | ||
class="op-ian-reminder-alert--note" | ||
[textContent]="reminderNote" | ||
></span> |
16 changes: 16 additions & 0 deletions
16
...-app-notifications/entry/reminder-alert/in-app-notification-reminder-alert.component.sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import "helpers" | ||
|
||
.op-ian-reminder-alert | ||
display: grid | ||
grid-template-columns: auto 1fr | ||
grid-column-gap: $spot-spacing-0_25 | ||
align-items: center | ||
color: var(--fgColor-muted) | ||
|
||
&--note | ||
@include text-shortener | ||
line-height: 1rem | ||
color: var(--fgColor-default) | ||
|
||
> * | ||
flex-shrink: 0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see the issue raised by wieland in our last meeting as well - a longer note text gets hidden on mobile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had planned on resolving separately in https://community.openproject.org/wp/59989 but it should also be small enough to fit here 👍🏾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0ce5623