Skip to content

Commit

Permalink
fix(ui5-notifications): add missing imports for used icons (#5907)
Browse files Browse the repository at this point in the history
Fixes #5905
  • Loading branch information
georgimkv authored Oct 7, 2022
1 parent 6afff29 commit a50a22f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
5 changes: 5 additions & 0 deletions packages/fiori/src/NotificationListGroupItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import Icon from "@ui5/webcomponents/dist/Icon.js";
import Popover from "@ui5/webcomponents/dist/Popover.js";
import NotificationListItemBase from "./NotificationListItemBase.js";

// Icons
import "@ui5/webcomponents-icons/dist/navigation-right-arrow.js";
import "@ui5/webcomponents-icons/dist/overflow.js";
import "@ui5/webcomponents-icons/dist/decline.js";

// Texts
import {
NOTIFICATION_LIST_GROUP_ITEM_TXT,
Expand Down
4 changes: 4 additions & 0 deletions packages/fiori/src/NotificationListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import Popover from "@ui5/webcomponents/dist/Popover.js";
import WrappingType from "@ui5/webcomponents/dist/types/WrappingType.js";
import NotificationListItemBase from "./NotificationListItemBase.js";

// Icons
import "@ui5/webcomponents-icons/dist/overflow.js";
import "@ui5/webcomponents-icons/dist/decline.js";

// Texts
import {
NOTIFICATION_LIST_ITEM_TXT,
Expand Down
19 changes: 10 additions & 9 deletions packages/fiori/src/NotificationListItemBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ import NotificationOverflowActionsPopoverTemplate from "./generated/templates/No
// Styles
import NotificationOverflowActionsPopoverCss from "./generated/themes/NotificationOverflowActionsPopover.css.js";

/**
* Defines the icons corresponding to the notification's priority.
*/
const ICON_PER_PRIORITY = {
[Priority.High]: "message-error",
[Priority.Medium]: "message-warning",
[Priority.Low]: "message-success",
};

/**
* @public
*/
Expand Down Expand Up @@ -152,14 +161,6 @@ class NotificationListItemBase extends ListItemBase {
return NotificationOverflowActionsPopoverCss;
}

static priorityIconsMappings() {
return {
"High": "message-error",
"Medium": "message-warning",
"Low": "message-success",
};
}

get hasTitleText() {
return !!this.titleText.length;
}
Expand All @@ -169,7 +170,7 @@ class NotificationListItemBase extends ListItemBase {
}

get priorityIcon() {
return NotificationListItemBase.priorityIconsMappings()[this.priority];
return ICON_PER_PRIORITY[this.priority];
}

get overflowButtonDOM() {
Expand Down

0 comments on commit a50a22f

Please sign in to comment.