Commit 80d075dc authored by John Lee's avatar John Lee Committed by Commit Bot

WebUI: Replace cr-section with cr-row class

This CLs replaces all usage of the cr-section class with a new cr-row
class. It also removes uses of the class where there isn't much benefit
to using them and cleans up some of the HTML and CSS that were used
to override the class.

Bug: 973674
Change-Id: I1c33ca05626bde382bd7fbd0b54b4ab3b86089dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134197
Commit-Queue: John Lee <johntlee@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756447}
parent 051cc668
...@@ -58,26 +58,7 @@ ...@@ -58,26 +58,7 @@
margin-inline-end: 10px; margin-inline-end: 10px;
} }
.cr-section { .cr-row cr-button + cr-button {
margin-bottom: 10px;
}
.cr-section.first {
border-top: none;
}
.cr-section.single-column {
align-items: stretch;
flex-direction: column;
justify-content: center;
}
.cr-section > .start {
align-items: center;
flex: auto;
}
.cr-section cr-button + cr-button {
margin-inline-start: 8px; margin-inline-start: 8px;
} }
...@@ -93,19 +74,17 @@ ...@@ -93,19 +74,17 @@
</style> </style>
<!-- Title section: Icon + name + connection state. --> <!-- Title section: Icon + name + connection state. -->
<div id="title" class="cr-section first"> <div id="title" class="cr-row first">
<div class="start layout horizontal center"> <network-icon
<network-icon show-technology-badge="[[showTechnologyBadge_]]"
show-technology-badge="[[showTechnologyBadge_]]" network-state="[[getNetworkState_(managedProperties_)]]">
network-state="[[getNetworkState_(managedProperties_)]]"> </network-icon>
</network-icon> <div id="networkName" class="title">
<div id="networkName" class="title"> [[getNameText_(managedProperties_)]]
[[getNameText_(managedProperties_)]] </div>
</div> <div id="networkState" class="title flex"
<div id="networkState" class="title" connected$="[[isConnectedState_(managedProperties_)]]">
connected$="[[isConnectedState_(managedProperties_)]]"> [[getStateText_(managedProperties_)]]
[[getStateText_(managedProperties_)]]
</div>
</div> </div>
<cr-button on-click="onForgetTap_" <cr-button on-click="onForgetTap_"
hidden$="[[!showForget_(managedProperties_)]]"> hidden$="[[!showForget_(managedProperties_)]]">
...@@ -121,17 +100,17 @@ ...@@ -121,17 +100,17 @@
<!-- SIM Info (Cellular only). --> <!-- SIM Info (Cellular only). -->
<template is="dom-if" if="[[showCellularSim_(managedProperties_)]]" <template is="dom-if" if="[[showCellularSim_(managedProperties_)]]"
restamp> restamp>
<div class="cr-section single-column"> <div class="cr-row">
<network-siminfo device-state="[[deviceState_]]"> <network-siminfo class="flex" device-state="[[deviceState_]]">
</network-siminfo> </network-siminfo>
<div> </div>
</template> </template>
<!-- Choose Mobile Network (Cellular only) --> <!-- Choose Mobile Network (Cellular only) -->
<template is="dom-if" <template is="dom-if"
if="[[showCellularChooseNetwork_(managedProperties_)]]"> if="[[showCellularChooseNetwork_(managedProperties_)]]">
<div class="cr-section single-column"> <div class="cr-row">
<network-choose-mobile device-state="[[deviceState_]]" <network-choose-mobile class="flex" device-state="[[deviceState_]]"
managed-properties="[[managedProperties_]]"> managed-properties="[[managedProperties_]]">
</network-choose-mobile> </network-choose-mobile>
</div> </div>
...@@ -139,25 +118,25 @@ ...@@ -139,25 +118,25 @@
<!-- APN (Cellular only) --> <!-- APN (Cellular only) -->
<template is="dom-if" if="[[isCellular_(managedProperties_)]]"> <template is="dom-if" if="[[isCellular_(managedProperties_)]]">
<div class="cr-section single-column"> <div class="cr-row">
<network-apnlist editable on-apn-change="onApnChange_" <network-apnlist class="flex" editable on-apn-change="onApnChange_"
managed-properties="[[managedProperties_]]"> managed-properties="[[managedProperties_]]">
</network-apnlist> </network-apnlist>
</div> </div>
</template> </template>
<!-- Proxy --> <!-- Proxy -->
<div class="cr-section single-column"> <div class="cr-row">
<template is="dom-if" <template is="dom-if"
if="[[shouldShowProxyPolicyIndicator_(managedProperties_)]]"> if="[[shouldShowProxyPolicyIndicator_(managedProperties_)]]">
<div class="property-box"> <cr-policy-network-indicator-mojo
<cr-policy-network-indicator-mojo property="[[managedProperties_.proxySettings.type]]">
property="[[managedProperties_.proxySettings.type]]"> </cr-policy-network-indicator-mojo>
</cr-policy-network-indicator-mojo> <div>$i18n{networkProxyEnforcedPolicy}</div>
<div>$i18n{networkProxyEnforcedPolicy}</div>
</div>
</template> </template>
<network-proxy editable use-shared-proxies </div>
<div class="cr-row continuation">
<network-proxy class="flex" editable use-shared-proxies
on-proxy-change="onProxyChange_" on-proxy-change="onProxyChange_"
managed-properties="[[managedProperties_]]"> managed-properties="[[managedProperties_]]">
</network-proxy> </network-proxy>
...@@ -165,38 +144,40 @@ ...@@ -165,38 +144,40 @@
<template is="dom-if" if="[[isRememberedOrConnected_(managedProperties_)]]"> <template is="dom-if" if="[[isRememberedOrConnected_(managedProperties_)]]">
<!-- IP Config --> <!-- IP Config -->
<div class="cr-section single-column"> <div class="cr-row">
<network-ip-config editable on-ip-change="onIPConfigChange_" <network-ip-config class="flex"
editable on-ip-change="onIPConfigChange_"
managed-properties="[[managedProperties_]]"> managed-properties="[[managedProperties_]]">
</network-ip-config> </network-ip-config>
</div> </div>
<!-- Nameservers --> <!-- Nameservers -->
<div class="cr-section single-column"> <div class="cr-row">
<network-nameservers editable <network-nameservers class="flex" editable
on-nameservers-change="onIPConfigChange_" on-nameservers-change="onIPConfigChange_"
managed-properties="[[managedProperties_]]"> managed-properties="[[managedProperties_]]">
</network-nameservers> </network-nameservers>
</div> </div>
</template> </template>
<div class="cr-section single-column indented"> <div class="cr-row">
<!-- MAC Address. --> <!-- MAC Address. -->
<div class="property-box single-column two-line" <div class="property-box single-column two-line"
hidden$="[[!deviceState_.macAddress]]"> hidden$="[[!deviceState_.macAddress]]">
<div>$i18n{OncMacAddress}</div> <div>$i18n{OncMacAddress}</div>
<div class="secondary">[[deviceState_.macAddress]]</div> <div class="secondary">[[deviceState_.macAddress]]</div>
</div> </div>
</div>
<!-- Other properties to show if present. --> <!-- Other properties to show if present. -->
<template is="dom-if" if="[[hasInfoFields_(managedProperties_)]]"> <template is="dom-if" if="[[hasInfoFields_(managedProperties_)]]">
<network-property-list-mojo <div class="cr-row continuation">
<network-property-list-mojo class="flex"
fields="[[getInfoFields_(managedProperties_)]]" fields="[[getInfoFields_(managedProperties_)]]"
property-dict="[[managedProperties_]]"> property-dict="[[managedProperties_]]">
</network-property-list-mojo> </network-property-list-mojo>
</template> </div>
</div> </template>
</template> </template>
<script src="internet_detail_dialog.js"></script> <script src="internet_detail_dialog.js"></script>
</dom-module> </dom-module>
......
...@@ -40,25 +40,15 @@ ...@@ -40,25 +40,15 @@
flex-grow: 1; flex-grow: 1;
} }
.cr-section.block { .section {
box-sizing: border-box; box-sizing: border-box;
display: block; padding: var(--cr-section-vertical-padding) var(--cr-section-padding);
padding-bottom: var(--cr-section-vertical-padding);
padding-top: var(--cr-section-vertical-padding);
}
.cr-section.continuation {
border-top: none;
} }
.cr-section.control-line { .cr-row.control-line {
justify-content: space-between; justify-content: space-between;
} }
.cr-section:first-child {
border: none;
}
.section-content { .section-content {
color: var(--cr-secondary-text-color); color: var(--cr-secondary-text-color);
} }
...@@ -146,7 +136,7 @@ ...@@ -146,7 +136,7 @@
[[data.name]] [[data.name]]
</span> </span>
</div> </div>
<div class="cr-section continuation control-line" id="enable-section"> <div class="cr-row first control-line" id="enable-section">
<span class$="[[computeEnabledStyle_(data.state)]]"> <span class$="[[computeEnabledStyle_(data.state)]]">
[[computeEnabledText_(data.state, '$i18nPolymer{itemOn}', [[computeEnabledText_(data.state, '$i18nPolymer{itemOn}',
'$i18nPolymer{itemOff}')]] '$i18nPolymer{itemOff}')]]
...@@ -178,7 +168,7 @@ ...@@ -178,7 +168,7 @@
</div> </div>
<div id="warnings" hidden$="[[!hasWarnings_(data.*)]]"> <div id="warnings" hidden$="[[!hasWarnings_(data.*)]]">
<div id="runtime-warnings" hidden$="[[!data.runtimeWarnings.length]]" <div id="runtime-warnings" hidden$="[[!data.runtimeWarnings.length]]"
class="cr-section continuation warning control-line"> class="cr-row continuation warning control-line">
<iron-icon class="warning-icon" icon="cr:error"></iron-icon> <iron-icon class="warning-icon" icon="cr:error"></iron-icon>
<span> <span>
<template is="dom-repeat" items="[[data.runtimeWarnings]]"> <template is="dom-repeat" items="[[data.runtimeWarnings]]">
...@@ -192,7 +182,7 @@ ...@@ -192,7 +182,7 @@
</cr-button> </cr-button>
</template> </template>
</div> </div>
<div class="cr-section continuation warning" id="suspicious-warning" <div class="cr-row continuation warning" id="suspicious-warning"
hidden$="[[!data.disableReasons.suspiciousInstall]]"> hidden$="[[!data.disableReasons.suspiciousInstall]]">
<iron-icon class="warning-icon" icon="cr:warning"></iron-icon> <iron-icon class="warning-icon" icon="cr:warning"></iron-icon>
<span> <span>
...@@ -202,7 +192,7 @@ ...@@ -202,7 +192,7 @@
</a> </a>
</span> </span>
</div> </div>
<div class="cr-section continuation warning control-line" <div class="cr-row continuation warning control-line"
id="corrupted-warning" id="corrupted-warning"
hidden$="[[!showRepairButton_(data.disableReasons.corruptInstall)]]"> hidden$="[[!showRepairButton_(data.disableReasons.corruptInstall)]]">
<iron-icon class="warning-icon" icon="cr:warning"></iron-icon> <iron-icon class="warning-icon" icon="cr:warning"></iron-icon>
...@@ -212,18 +202,18 @@ ...@@ -212,18 +202,18 @@
$i18n{itemRepair} $i18n{itemRepair}
</cr-button> </cr-button>
</div> </div>
<div class="cr-section continuation warning" id="blacklisted-warning" <div class="cr-row continuation warning" id="blacklisted-warning"
hidden$="[[!data.blacklistText]]"> hidden$="[[!data.blacklistText]]">
<iron-icon class="warning-icon" icon="cr:warning"></iron-icon> <iron-icon class="warning-icon" icon="cr:warning"></iron-icon>
<span>[[data.blacklistText]]</span> <span>[[data.blacklistText]]</span>
</div> </div>
<div class="cr-section continuation warning" id="update-required-warning" <div class="cr-row continuation warning" id="update-required-warning"
hidden$="[[!data.disableReasons.updateRequired]]"> hidden$="[[!data.disableReasons.updateRequired]]">
<iron-icon class="warning-icon" icon="cr:warning"></iron-icon> <iron-icon class="warning-icon" icon="cr:warning"></iron-icon>
<span>$i18n{updateRequiredByPolicy}</span> <span>$i18n{updateRequiredByPolicy}</span>
</div> </div>
</div> </div>
<div class="cr-section continuation block"> <div class="section">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemDescriptionLabel} $i18n{itemDescriptionLabel}
</div> </div>
...@@ -231,13 +221,13 @@ ...@@ -231,13 +221,13 @@
[[getDescription_(data.description, '$i18nPolymer{noDescription}')]] [[getDescription_(data.description, '$i18nPolymer{noDescription}')]]
</div> </div>
</div> </div>
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemVersion} $i18n{itemVersion}
</div> </div>
<div class="section-content">[[data.version]]</div> <div class="section-content">[[data.version]]</div>
</div> </div>
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemSize} $i18n{itemSize}
</div> </div>
...@@ -247,14 +237,14 @@ ...@@ -247,14 +237,14 @@
</paper-spinner-lite> </paper-spinner-lite>
</div> </div>
</div> </div>
<div class="cr-section block" id="id-section" hidden$="[[!inDevMode]]"> <div class="section hr" id="id-section" hidden$="[[!inDevMode]]">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemIdHeading} $i18n{itemIdHeading}
</div> </div>
<div class="section-content">[[data.id]]</div> <div class="section-content">[[data.id]]</div>
</div> </div>
<template is="dom-if" if="[[inDevMode]]"> <template is="dom-if" if="[[inDevMode]]">
<div class="cr-section block" id="inspectable-views"> <div class="section hr" id="inspectable-views">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemInspectViews} $i18n{itemInspectViews}
</div> </div>
...@@ -275,7 +265,7 @@ ...@@ -275,7 +265,7 @@
</div> </div>
</div> </div>
</template> </template>
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemPermissions} $i18n{itemPermissions}
</div> </div>
...@@ -299,7 +289,7 @@ ...@@ -299,7 +289,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemSiteAccess} $i18n{itemSiteAccess}
</div> </div>
...@@ -328,7 +318,7 @@ ...@@ -328,7 +318,7 @@
</div> </div>
<template is="dom-if" <template is="dom-if"
if="[[hasDependentExtensions_(data.dependentExtensions.splices)]]"> if="[[hasDependentExtensions_(data.dependentExtensions.splices)]]">
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemDependencies} $i18n{itemDependencies}
</div> </div>
...@@ -389,7 +379,7 @@ ...@@ -389,7 +379,7 @@
<cr-link-row class="hr" hidden="[[!data.webStoreUrl.length]]" <cr-link-row class="hr" hidden="[[!data.webStoreUrl.length]]"
id="viewInStore" label="$i18n{viewInStore}" id="viewInStore" label="$i18n{viewInStore}"
on-click="onViewInStoreTap_" external></cr-link-row> on-click="onViewInStoreTap_" external></cr-link-row>
<div class="cr-section block"> <div class="section hr">
<div class="section-title" role="heading" aria-level="2"> <div class="section-title" role="heading" aria-level="2">
$i18n{itemSource} $i18n{itemSource}
</div> </div>
......
...@@ -132,7 +132,7 @@ suite(extension_manager_unit_tests.suiteName, function() { ...@@ -132,7 +132,7 @@ suite(extension_manager_unit_tests.suiteName, function() {
expectEquals(description, detailsView.data.description); expectEquals(description, detailsView.data.description);
expectEquals( expectEquals(
description, description,
detailsView.$$('.cr-section .section-content').textContent.trim()); detailsView.$$('.section .section-content').textContent.trim());
}); });
test( test(
...@@ -170,7 +170,7 @@ suite(extension_manager_unit_tests.suiteName, function() { ...@@ -170,7 +170,7 @@ suite(extension_manager_unit_tests.suiteName, function() {
expectEquals(newDescription, detailsView.data.description); expectEquals(newDescription, detailsView.data.description);
expectEquals( expectEquals(
newDescription, newDescription,
detailsView.$$('.cr-section .section-content').textContent.trim()); detailsView.$$('.section .section-content').textContent.trim());
}); });
test( test(
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
opacity: var(--cr-container-shadow-max-opacity); opacity: var(--cr-container-shadow-max-opacity);
} }
.cr-section { .cr-row {
align-items: center; align-items: center;
border-top: var(--cr-separator-line); border-top: var(--cr-separator-line);
display: flex; display: flex;
...@@ -97,6 +97,11 @@ ...@@ -97,6 +97,11 @@
padding: 0 var(--cr-section-padding); padding: 0 var(--cr-section-padding);
} }
.cr-row.first,
.cr-row.continuation {
border-top: none;
}
/* Typography */ /* Typography */
.cr-title-text { .cr-title-text {
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
--cr-section-indent-padding: calc( --cr-section-indent-padding: calc(
var(--cr-section-padding) + var(--cr-section-indent-width)); var(--cr-section-padding) + var(--cr-section-indent-width));
/* TODO(crbug.com/973674): Do not use this mixin. Use the class cr-section /* TODO(crbug.com/973674): Do not use this mixin. Use the class cr-row
* from shared_style_css.html instead. */ * from shared_style_css.html instead. */
--cr-section: { --cr-section: {
align-items: center; align-items: center;
......
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