Commit 24a2fb78 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Commit Bot

plugin_vm: use dedicated message when list of shared folders is empty

Instead of showing empty list when there are no shared folders, let's
show dedicated message.

Bug: chromium:1094923
Change-Id: I10a886ba4ce48529a07a2f03e7e7f72f78db4527
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247160Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779513}
parent c8367eb6
......@@ -2722,6 +2722,9 @@
<message name="IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING" desc="Tooltip to show when hovering on the remove icon for a Plugin VM shared folder.">
Stop sharing
</message>
<message name="IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_LIST_EMPTY_MESSAGE" desc="Message shown when the user has not yet shared any folders in Plugin VM.">
Shared folders will appear here
</message>
<!-- Storage -->
<message name="IDS_SETTINGS_STORAGE_TITLE" desc="In Device Settings, the title for storage management.">
......
......@@ -17,18 +17,28 @@
</span>
</div>
</div>
<div class="settings-box continuation">
<h2 class="start">$i18n{pluginVmSharedPathsListHeading}</h2>
<div class="settings-box secondary continuation"
hidden="[[sharedPaths_.length]]" >
$i18n{pluginVmSharedPathsListEmptyMessage}
</div>
<div class="list-frame vertical-list">
<template is="dom-repeat" items="[[sharedPaths_]]">
<div class="list-item">
<div class="start">[[item.pathDisplayText]]</div>
<cr-icon-button class="icon-clear"
on-click="onRemoveSharedPathClick_"
title="$i18n{pluginVmSharedPathsRemoveSharing}"></cr-icon-button>
</div>
</template>
<div id="pluginVmList" hidden="[[!sharedPaths_.length]]">
<div class="settings-box continuation">
<h2 id="pluginVmListHeading" class="start">
$i18n{pluginVmSharedPathsListHeading}
</h2>
</div>
<div class="list-frame vertical-list" role="list"
aria-labeledby="pluginVmListHeading">
<template is="dom-repeat" items="[[sharedPaths_]]">
<div class="list-item" role="listitem">
<div class="start">[[item.pathDisplayText]]</div>
<cr-icon-button class="icon-clear"
on-click="onRemoveSharedPathClick_"
title="$i18n{pluginVmSharedPathsRemoveSharing}">
</cr-icon-button>
</div>
</template>
</div>
</div>
</template>
<script src="plugin_vm_shared_paths.js"></script>
......
......@@ -317,6 +317,8 @@ void AppsSection::AddPluginVmLoadTimeData(
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_INSTRUCTIONS_REMOVE},
{"pluginVmSharedPathsRemoveSharing",
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING},
{"pluginVmSharedPathsListEmptyMessage",
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_LIST_EMPTY_MESSAGE},
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
......
......@@ -57,7 +57,7 @@ suite('SharedPaths', function() {
test('Remove', async function() {
await setPrefs({'path1': ['PvmDefault'], 'path2': ['PvmDefault']});
assertEquals(2, page.shadowRoot.querySelectorAll('.settings-box').length);
assertEquals(3, page.shadowRoot.querySelectorAll('.settings-box').length);
assertEquals(2, page.shadowRoot.querySelectorAll('.list-item').length);
assertFalse(page.$.pluginVmInstructionsRemove.hidden);
assertTrue(!!page.$$('.list-item cr-icon-button'));
......
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