Skip to content
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

fix: (Core) refactor Notifications to follow the latest design specs #5186

Merged
merged 12 commits into from
May 10, 2021
23 changes: 13 additions & 10 deletions apps/docs/src/app/core/api-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,25 @@ export const API_FILES = {
'MessageBoxFooterButtonComponent'
],
notification: [
'NotificationTitleDirective',
'NotificationIndicatorDirective',
'NotificationParagraphDirective',
'NotificationFooterContentDirective',
'NotificationSeparatorDirective',
'NotificationLimitTitleDirective',
'NotificationLimitDescriptionDirective',
'NotificationActionsComponent',
'NotificationContentComponent',
'NotificationLimitComponent',
'NotificationGroupHeaderComponent',
'NotificationGroupComponent',
'NotificationGroupListComponent',
'NotificationComponent',
'NotificationHeaderComponent',
'NotificationBodyComponent',
'NotificationFooterComponent',
'NotificationServiceDirective',
'NotificationActionsDirective',
'NotificationAvatarDirective',
'NotificationContentDirective',
'NotificationDescriptionDirective',
'NotificationMetadataDirective',
'NotificationTextDirective',
'NotificationTitleDirective',
'DefaultNotificationComponent',
'NotificationContainer',
'NotificationConfig',
'NotificationDefault',
'NotificationRef'
],
objectIdentifier: ['ObjectIdentifierComponent'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { NotificationService } from '@fundamental-ngx/core';
import { NotificationContentComponent } from './notification-content.component';
import { NotificationExampleContentComponent } from './notification-content.component';

@Component({
selector: 'fd-notification-component-as-content-example',
Expand All @@ -15,18 +15,15 @@ export class NotificationComponentAsContentExampleComponent {
constructor(private notificationService: NotificationService) {}

open(): void {
const notificationService = this.notificationService.open(NotificationContentComponent, {
const notificationService = this.notificationService.open(NotificationExampleContentComponent, {
data: {
title: 'Notification Title',
description: 'Notification Description',
metadata: 'Other Data',
moreInfo: 'More Info',
approve: 'Approve',
cancel: 'Cancel',
type: 'success'
paragraph: 'Notification Description',
firstFooterContent: 'SAP Analytics Cloud',
secondFooterContent: 'Just Now',
open: 'Open'
},
size: 'm',
type: 'success'
width: '500px'
});

notificationService.afterClosed.subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,48 @@ import { Component } from '@angular/core';
import { NotificationRef } from '@fundamental-ngx/core';

@Component({
selector: 'fd-notification-content',
selector: 'fd-notification-example-content',
template: `
<fd-notification-header
(closeButtonClick)="notificationRef.dismiss('Close Icon Click')"
[type]="notificationRef.data.type"
>
<h3 fd-notification-title>{{ notificationRef.data.title }}</h3>
</fd-notification-header>
<fd-notification-body>
<div fd-notification-content>
<div fd-notification-avatar>
<fd-avatar size="s" label="John Doe">JD</fd-avatar>
</div>
<div fd-notification-text>
<div fd-notification-description>
{{ notificationRef.data.description }}
</div>
<div fd-notification-metadata>
{{ notificationRef.data.metadata }}
</div>
</div>
</div>
<fd-message-strip type="success" [dismissible]="false" marginBottom="1rem">
A warning message strip.
</fd-message-strip>
<fd-notification-body>
<fd-notification-content>
<fd-notification-header>
<h2 fd-notification-title [unread]="true">
{{ notificationRef.data.title }}
</h2>
</fd-notification-header>
<p fd-notification-paragraph>
{{ notificationRef.data.paragraph }}
</p>
<fd-notification-footer>
<button fd-button [fdType]="'transparent'" [label]="notificationRef.data.moreInfo"></button>
<div fd-notification-actions>
<button fd-button
[fdType]="'positive'"
[label]="notificationRef.data.approve"
(click)="notificationRef.close('Approve Button Click')">
</button>
<button fd-button
[fdType]="'negative'"
[label]="notificationRef.data.cancel"
(click)="notificationRef.dismiss('Cancel Button Click')">
</button>
</div>
<span fd-notification-footer-content>
{{ notificationRef.data.firstFooterContent }}
</span>
<span fd-notification-separator></span>
<span fd-notification-footer-content>
{{ notificationRef.data.secondFooterContent }}
</span>
</fd-notification-footer>
</fd-notification-body>
</fd-notification-content>
<fd-notification-actions>
<button
fd-button
[label]="notificationRef.data.open"
[compact]="true"
(click)="notificationRef.close('Open Button Clicked')"></button>
<button
fd-button
fdType="transparent"
glyph="decline"
title="close"
[compact]="true"
(click)="notificationRef.close('Close Button Click')"></button>
</fd-notification-actions>
</fd-notification-body>
`
})
export class NotificationContentComponent {
export class NotificationExampleContentComponent {
constructor(public notificationRef: NotificationRef) {}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading