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-li-notification): It is now possible to not have a description #2744

Merged
merged 1 commit into from
Jan 29, 2021
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
4 changes: 2 additions & 2 deletions packages/fiori/src/NotificationListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class NotificationListItem extends NotificationListItemBase {
}

const headingWouldOverflow = this.headingHeight > this._headingOverflowHeight;
const descWouldOverflow = this.descriptionHeight > this._descOverflowHeight;
const descWouldOverflow = this.hasDesc && this.descriptionHeight > this._descOverflowHeight;
const overflows = headingWouldOverflow || descWouldOverflow;

if (this._showMorePressed && overflows) {
Expand All @@ -411,7 +411,7 @@ class NotificationListItem extends NotificationListItemBase {

if (this.headingOverflows || this.descriptionOverflows) {
this._headingOverflowHeight = this.headingHeight;
this._descOverflowHeight = this.descriptionHeight;
this._descOverflowHeight = this.hasDesc ? this.descriptionHeight : 0;
this._showMore = true;
return;
}
Expand Down
20 changes: 10 additions & 10 deletions packages/fiori/test/pages/NotificationListItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h3>Events on ui5-list level</h3>
<span slot="footnotes">John Doe</span>
<span slot="footnotes">2 Days</span>
<span slot="footnotes">Other stuff</span>

<ui5-notification-action id="acceptBtnInPopover" icon="accept" text="Accept" slot="actions"></ui5-notification-action>
<ui5-notification-action
id="rejectBtnInPopover"
Expand All @@ -192,41 +192,41 @@ <h3>Events on ui5-list level</h3>
slot="actions">
</ui5-notification-action>
</ui5-li-notification>

<ui5-li-notification
show-close
heading="New order (#2525) With a very long title - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc."
priority="High"
>
And with a very long description and long labels of the action buttons - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc.
<ui5-avatar icon="employee" size="XS" slot="avatar"></ui5-avatar>

<span slot="footnotes">Office Notifications</span>
<span slot="footnotes">3 Days</span>

<ui5-notification-action id="acceptBtn2InPopover" icon="accept" text="Accept" slot="actions"></ui5-notification-action>
</ui5-li-notification>

<ui5-li-notification
heading="New order (#2565) With a very long title - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc."
priority="Medium"
>
Short description
<ui5-avatar initials="JS" size="XS" slot="avatar"></ui5-avatar>

<span slot="footnotes">Patricia Clarck</span>
<span slot="footnotes">3 Days</span>

<ui5-notification-action icon="accept" text="Accept All Requested Information" slot="actions"></ui5-notification-action>
<ui5-notification-action icon="decline" design="Negative" text="Reject All Requested Information" slot="actions"></ui5-notification-action>
</ui5-li-notification>

<ui5-li-notification heading="New order (#2523)">
<div>. With a very long description - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc.</div>

<span slot="footnotes">John SMith</span>
<span slot="footnotes">3 Days</span>

<ui5-notification-action icon="message-error" design="Negative" text="Reject" slot="actions"></ui5-notification-action>
</ui5-li-notification>
</ui5-list>
Expand Down