Commit a30a548a authored by Alex Danilo's avatar Alex Danilo Committed by Commit Bot

Remove duplication of displayed error message.

Error panels were being displayed on 2 separate lines of text based on
the false assumption that two sentences would be separated by a period
'.' and space, resulting in the same line being displayed twice when
only one sentence existed in the error message.

Changes the text wrapping to use 'webkit-line-clamp' instead.

Bug: 995444
Tests: Modified integration test --gtest_filter="*/FilesApp*transferDeletedFile"
Change-Id: I36220a2e5e492dec37d8455d3767ceecddc31a9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761895
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689371}
parent e827d0f9
......@@ -78,6 +78,19 @@ class PanelItem extends HTMLElement {
white-space: nowrap;
}
:host([panel-type='3']) .xf-panel-label-text {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
white-space: normal;
width: 216px;
}
:host([panel-type='3']) .xf-linebreaker {
display: none;
}
.xf-panel-label-text {
color: rgb(32, 33, 36);
}
......@@ -133,7 +146,7 @@ class PanelItem extends HTMLElement {
<span class='xf-panel-label-text'>
Placeholder text
</span>
<br/>
<br class='xf-linebreaker'/>
</div>
<div class='xf-padder-24'></div>
<xf-button id='secondary-action' tabindex='-1'>
......
......@@ -466,10 +466,7 @@ class ProgressCenterPanel {
break;
case 'error':
panelItem.panelType = panelItem.panelTypeError;
panelItem.setAttribute(
'primary-text', item.message.replace(/\. .*/, '.'));
panelItem.setAttribute(
'secondary-text', item.message.replace(/.*\. /, ''));
panelItem.setAttribute('primary-text', item.message);
break;
}
} else if (panelItem) {
......
......@@ -591,4 +591,7 @@ testcase.transferDeletedFile = async () => {
chrome.test.assertEq(
`Whoops, ${entry.nameText} no longer exists.`,
element.attributes['primary-text']);
// Check that only one line of text is shown.
chrome.test.assertFalse(!!element.attributes['secondary-text']);
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment