Merge "CodeOwnersPluginConfigSnapshotTest: Fix required approval tests"
diff --git a/ui/code-owners-api.js b/ui/code-owners-api.js
index a1a1aed..e9a0227 100644
--- a/ui/code-owners-api.js
+++ b/ui/code-owners-api.js
@@ -129,8 +129,8 @@
`branches/${encodeURIComponent(branch)}/` +
`code_owners.branch_config`
);
- if (config.override_approval && !(config.override_approval
- instanceof Array)) {
+ if (config.override_approval &&
+ !(config.override_approval instanceof Array)) {
// In the upcoming backend changes, the override_approval will be changed
// to array with (possible) multiple items.
// While this transition is in progress, the frontend supports both API -
diff --git a/ui/code-owners-service.js b/ui/code-owners-service.js
index 0db6226..bf9fa4e 100644
--- a/ui/code-owners-service.js
+++ b/ui/code-owners-service.js
@@ -174,8 +174,8 @@
const oldPathStatus = status.old_path_status;
const newPathStatus = status.new_path_status;
// For deleted files, no new_path_status exists
- return (newPathStatus && newPathStatus.status !== OwnerStatus.APPROVED)
- || (oldPathStatus && oldPathStatus.status !== OwnerStatus.APPROVED);
+ return (newPathStatus && newPathStatus.status !== OwnerStatus.APPROVED) ||
+ (oldPathStatus && oldPathStatus.status !== OwnerStatus.APPROVED);
});
}
@@ -231,7 +231,6 @@
this.ownersProviders[suggestionsType].resume();
}
-
_formatStatuses(statuses) {
// convert the array of statuses to map between file path -> status
return statuses.reduce((prev, cur) => {
@@ -285,7 +284,8 @@
provider.reset();
}
const codeOwnersApi = new CodeOwnersApi(this.restApi);
- this.codeOwnersCacheApi = new CodeOwnersCacheApi(codeOwnersApi, change);
+ this.codeOwnersCacheApi =
+ new CodeOwnersCacheApi(codeOwnersApi, this.change);
}
async getBranchConfig() {
diff --git a/ui/owner-requirement.js b/ui/owner-requirement.js
index e6ced63..5fcbeec 100644
--- a/ui/owner-requirement.js
+++ b/ui/owner-requirement.js
@@ -65,7 +65,7 @@
</p>
<template is="dom-if" if="[[!_isLoading]]">
<template is="dom-if" if="[[!_pluginFailed(model.pluginStatus)]]">
- <template is="dom-if" if="[[!model.branchConfig.no_code_owners_defined]]">
+ <template is="dom-if" if="[[!model.branchConfig.no_code_owners_defined]]">
<span>[[_computeStatusText(_statusCount, _isOverriden)]]</span>
<template is="dom-if" if="[[_overrideInfoUrl]]">
<a on-click="_reportDocClick" href="[[_overrideInfoUrl]]"
@@ -78,7 +78,7 @@
[[_getSuggestOwnersText(_statusCount)]]
</gr-button>
</template>
- <template is="dom-if" if="[[model.branchConfig.no_code_owners_defined]]">
+ <template is="dom-if" if="[[model.branchConfig.no_code_owners_defined]]">
<span>No code-owners file</span>
<a href="https://gerrit.googlesource.com/plugins/code-owners/+/master/resources/Documentation/user-guide.md#how-to-submit-changes-with-files-that-have-no-code-owners" target="_blank">
<iron-icon icon="gr-icons:help-outline"
@@ -101,8 +101,8 @@
_statusCount: Object,
_isLoading: {
type: Boolean,
- computed: '_computeIsLoading(model.branchConfig, model.status, '
- + 'model.userRole, model.pluginStatus)',
+ computed: '_computeIsLoading(model.branchConfig, model.status, ' +
+ 'model.userRole, model.pluginStatus)',
},
_isOverriden: {
type: Boolean,
@@ -155,8 +155,8 @@
if (!branchConfig) {
return '';
}
- return branchConfig.general && branchConfig.general.override_info_url
- ? branchConfig.general.override_info_url : '';
+ return branchConfig.general && branchConfig.general.override_info_url ?
+ branchConfig.general.override_info_url : '';
}
_computeIsOverriden(change, branchConfig) {
diff --git a/ui/owner-status-column.js b/ui/owner-status-column.js
index 4e6e055..8f57a2b 100644
--- a/ui/owner-status-column.js
+++ b/ui/owner-status-column.js
@@ -51,8 +51,8 @@
computeHidden(change, patchRange) {
if ([change, patchRange].includes(undefined)) return true;
// if code-owners is not a submit requirement, don't show status column
- if (change.requirements
- && !change.requirements.find(r => r.type === 'code-owners')) {
+ if (change.requirements &&
+ !change.requirements.find(r => r.type === 'code-owners')) {
return true;
}
@@ -205,9 +205,9 @@
if (!oldPathStatus) {
this.status = newPathStatus;
} else {
- this.status = newPathStatus === STATUS_CODE.APPROVED
- ? this._computeStatus(oldPathStatus, /* oldPath= */ true)
- : newPathStatus;
+ this.status = newPathStatus === STATUS_CODE.APPROVED ?
+ this._computeStatus(oldPathStatus, /* oldPath= */ true) :
+ newPathStatus;
}
}
diff --git a/ui/suggest-owners-util.js b/ui/suggest-owners-util.js
index 898a6e5..fb18a0f 100644
--- a/ui/suggest-owners-util.js
+++ b/ui/suggest-owners-util.js
@@ -30,7 +30,6 @@
export function getDisplayOwnersGroups(files, allOwnersByPathMap,
reviewersIdSet, allowAllOwnersSubstition) {
-
const getDisplayOwnersFunc =
!allowAllOwnersSubstition || allOwnersByPathMap.size === 0 ||
reviewersIdSet.size === 0 ?
diff --git a/ui/suggest-owners.js b/ui/suggest-owners.js
index bf4fff3..9d3f183 100644
--- a/ui/suggest-owners.js
+++ b/ui/suggest-owners.js
@@ -103,7 +103,7 @@
border: 1px solid var(--view-background-color);
border-radius: var(--border-radius);
box-shadow: var(--elevation-level-1);
- padding: var(--spacing-s);
+ padding: 0 var(--spacing-m);
margin: var(--spacing-m) 0;
}
p.loading {
@@ -136,10 +136,10 @@
}
.show-all-owners-row {
padding: var(--spacing-m) var(--spacing-xl) var(--spacing-s);
- justify-content: flex-end;
+ justify-content: flex-end;
}
.suggestion-row-indicator {
- margin-right: var(--spacing-m);
+ margin-right: var(--spacing-s);
visibility: hidden;
line-height: 26px;
}
@@ -150,14 +150,16 @@
color: var(--link-color);
vertical-align: top;
position: relative;
- top: 3px; /* (26-20)/2 - 26px line-height and 20px icon */
+ --iron-icon-height: 18px;
+ --iron-icon-width: 18px;
+ top: 4px; /* (26-18)/2 - 26px line-height and 18px icon */
}
.suggestion-group-name {
- width: 200px;
+ width: 260px;
line-height: 26px;
text-overflow: ellipsis;
overflow: hidden;
- padding-right: var(--spacing-l);
+ padding-right: var(--spacing-s);
white-space: nowrap;
}
.group-name-content {
@@ -175,7 +177,7 @@
color: var(--deemphasized-text-color);
}
.suggested-owners {
- --account-gap: var(--spacing-s);
+ --account-gap: var(--spacing-xs);
--negative-account-gap: calc(-1*var(--account-gap));
margin: var(--negative-account-gap) 0 0 var(--negative-account-gap);
flex: 1;
@@ -617,7 +619,8 @@
this.suggestedOwners.forEach((suggestion, sId) => {
let hasSelected = false;
suggestion.owners.code_owners.forEach((owner, oId) => {
- if (accounts.some(account => account._account_id === owner.account._account_id)) {
+ if (accounts.some(
+ account => account._account_id === owner.account._account_id)) {
this.set(
['suggestedOwners', sId, 'owners', 'code_owners', oId],
{...owner,