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(ui5-notifications): add missing imports for used icons #5907

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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