Add more jsdoc for closure checks

1. add `@extends` for all polymer elements
2. add `@override` for all lifecycle methods
3. fix a wrong type in gr-auth

Change-Id: Id9dea76b169197084d2e0b5f267459cdc4aaec3e
This commit is contained in:
Tao Zhou 2020-01-12 15:20:39 +01:00
parent c4409bd739
commit ab57ce3744
168 changed files with 294 additions and 4 deletions

View File

@ -49,6 +49,7 @@
},
},
/** @override */
detached() {
this._handleHideTooltip();
},

View File

@ -540,6 +540,7 @@ shortcuts are.
}
},
/** @override */
attached() {
const shortcuts = shortcutManager.attachHost(this);
if (!shortcuts) { return; }
@ -559,6 +560,7 @@ shortcuts are.
}
},
/** @override */
detached() {
if (shortcutManager.detachHost(this)) {
this.removeOwnKeyBindings();

View File

@ -40,6 +40,7 @@
/**
* @appliesMixin Gerrit.AccessMixin
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrAccessSection extends Polymer.mixinBehaviors( [
Gerrit.AccessBehavior,
@ -84,6 +85,7 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('access-saved',

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.ListViewMixin
* @extends Polymer.Element
*/
class GrAdminGroupList extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -77,6 +78,7 @@
};
}
/** @override */
attached() {
super.attached();
this._getCreateGroupCapability();

View File

@ -23,6 +23,7 @@
* @appliesMixin Gerrit.AdminNavMixin
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrAdminView extends Polymer.mixinBehaviors( [
Gerrit.AdminNavBehavior,
@ -82,6 +83,7 @@
];
}
/** @override */
attached() {
super.attached();
this.reload();

View File

@ -25,6 +25,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmDeleteItemDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -24,6 +24,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrCreateChangeDialog extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -64,6 +65,7 @@
};
}
/** @override */
attached() {
super.attached();
if (!this.repoName) { return Promise.resolve(); }

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrCreateGroupDialog extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,

View File

@ -25,6 +25,7 @@
/**
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrCreatePointerDialog extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrCreateRepoDialog extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,

View File

@ -22,6 +22,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.ListViewMixin
* @extends Polymer.Element
*/
class GrGroupAuditLog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -42,11 +43,13 @@
};
}
/** @override */
attached() {
super.attached();
this.fire('title-change', {title: 'Audit Log'});
}
/** @override */
ready() {
super.ready();
this._getAuditLogs();

View File

@ -27,6 +27,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrGroupMembers extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -76,6 +77,7 @@
};
}
/** @override */
attached() {
super.attached();
this._loadGroupDetails();

View File

@ -32,6 +32,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrGroup extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -105,6 +106,7 @@
];
}
/** @override */
attached() {
super.attached();
this._loadGroup();

View File

@ -37,6 +37,7 @@
* Fired when a permission that was previously added was removed.
*
* @event added-permission-removed
* @extends Polymer.Element
*/
class GrPermission extends Polymer.mixinBehaviors( [
Gerrit.AccessBehavior,
@ -94,12 +95,14 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('access-saved',
() => this._handleAccessSaved());
}
/** @override */
ready() {
super.ready();
this._setupValues();

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrPluginConfigArrayEditor extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.ListViewMixin
* @extends Polymer.Element
*/
class GrPluginList extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -74,6 +75,7 @@
};
}
/** @override */
attached() {
super.attached();
this.fire('title-change', {title: 'Plugins'});

View File

@ -72,6 +72,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrRepoAccess extends Polymer.mixinBehaviors( [
Gerrit.AccessBehavior,
@ -128,6 +129,7 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('access-modified',

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrRepoCommand extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -28,6 +28,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrRepoCommands extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -50,6 +51,7 @@
};
}
/** @override */
attached() {
super.attached();
this._loadRepo();

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrRepoDashboards extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -28,6 +28,7 @@
* @appliesMixin Gerrit.ListViewMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrRepoDetailList extends Polymer.mixinBehaviors( [
Gerrit.ListViewBehavior,

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.ListViewMixin
* @extends Polymer.Element
*/
class GrRepoList extends Polymer.mixinBehaviors( [
Gerrit.ListViewBehavior,
@ -78,6 +79,7 @@
};
}
/** @override */
attached() {
super.attached();
this._getCreateRepoCapability();

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.RepoPluginConfigMixin
* @extends Polymer.Element
*/
class GrRepoPluginConfig extends Polymer.mixinBehaviors( [
Gerrit.RepoPluginConfig,

View File

@ -53,6 +53,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrRepo extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -123,6 +124,7 @@
];
}
/** @override */
attached() {
super.attached();
this._loadRepo();

View File

@ -69,6 +69,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrRuleEditor extends Polymer.mixinBehaviors( [
Gerrit.AccessBehavior,
@ -118,12 +119,14 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('access-saved',
() => this._handleAccessSaved());
}
/** @override */
ready() {
super.ready();
// Called on ready rather than the observer because when new rules are
@ -132,6 +135,7 @@
this._setupValues(this.rule);
}
/** @override */
attached() {
super.attached();
if (!this.rule) { return; } // Check needed for test purposes.

View File

@ -30,6 +30,7 @@
* @appliesMixin Gerrit.PathListMixin
* @appliesMixin Gerrit.RESTClientMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrChangeListItem extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -74,6 +75,7 @@
};
}
/** @override */
attached() {
super.attached();
Gerrit.awaitPluginsLoaded().then(() => {

View File

@ -33,6 +33,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrChangeListView extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -133,6 +134,7 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('next-page',
@ -141,6 +143,7 @@
() => this._handlePreviousPage());
}
/** @override */
attached() {
super.attached();
this._loadPreferences();

View File

@ -29,6 +29,7 @@
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.RESTClientMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrChangeList extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -135,17 +136,20 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('keydown',
e => this._scopedKeydownHandler(e));
}
/** @override */
ready() {
super.ready();
this._ensureAttribute('tabindex', 0);
}
/** @override */
attached() {
super.attached();
Gerrit.awaitPluginsLoaded().then(() => {

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrCreateChangeHelp extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -23,6 +23,7 @@
PUSH_PREFIX: 'git push origin HEAD:refs/for/',
};
/** @extends Polymer.Element */
class GrCreateCommandsDialog extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -22,6 +22,7 @@
* name and the branch name.
*
* @event confirm
* @extends Polymer.Element
*/
class GrCreateDestinationDialog extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(

View File

@ -22,6 +22,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrDashboardView extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -94,6 +95,7 @@
);
}
/** @override */
attached() {
super.attached();
this._loadPreferences();

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrEmbedDashboard extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrRepoHeader extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -17,6 +17,9 @@
(function() {
'use strict';
/**
* @extends Polymer.Element
*/
class GrUserHeader extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -196,6 +196,7 @@
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrChangeActions extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -432,6 +433,7 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('fullscreen-overlay-opened',
@ -440,6 +442,7 @@
() => this._handleShowBackgroundContent());
}
/** @override */
ready() {
super.ready();
this.$.jsAPI.addElement(this.$.jsAPI.Element.CHANGE_ACTIONS, this);

View File

@ -50,6 +50,7 @@
/**
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrChangeMetadata extends Polymer.mixinBehaviors( [
Gerrit.RESTClientBehavior,

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrChangeRequirements extends Polymer.mixinBehaviors( [
Gerrit.RESTClientBehavior,

View File

@ -68,6 +68,7 @@
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrChangeView extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -324,6 +325,7 @@
};
}
/** @override */
created() {
super.created();
@ -346,6 +348,7 @@
() => this._handleReloadCommentThreads());
}
/** @override */
attached() {
super.attached();
this._getServerConfig().then(config => {
@ -391,6 +394,7 @@
this.listen(document, 'visibilitychange', '_handleVisibilityChange');
}
/** @override */
detached() {
super.detached();
this.unlisten(window, 'scroll', '_handleScroll');

View File

@ -21,6 +21,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.PathListMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrCommentList extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrCommitInfo extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @extends Polymer.Element
*/
class GrConfirmAbandonDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmCherrypickConflictDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -21,6 +21,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmCherrypickDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -21,6 +21,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmMoveDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrConfirmRebaseDialog extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -22,6 +22,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmRevertDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -23,6 +23,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrConfirmRevertSubmissionDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrConfirmSubmitDialog extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -21,6 +21,7 @@
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrDownloadDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -54,6 +55,7 @@
};
}
/** @override */
ready() {
super.ready();
this._ensureAttribute('role', 'dialog');

View File

@ -24,6 +24,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @extends Polymer.Element
*/
class GrFileListHeader extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -48,6 +48,7 @@
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.PathListMixin
* @extends Polymer.Element
*/
class GrFileList extends Polymer.mixinBehaviors( [
Gerrit.AsyncForeachBehavior,
@ -236,12 +237,14 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('keydown',
e => this._scopedKeydownHandler(e));
}
/** @override */
attached() {
super.attached();
Gerrit.awaitPluginsLoaded().then(() => {
@ -265,6 +268,7 @@
});
}
/** @override */
detached() {
super.detached();
this._cancelDiffs();

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrIncludedInDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrLabelScoreRow extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrLabelScores extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -22,6 +22,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrMessage extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -113,12 +114,14 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('click',
e => this._handleClick(e));
}
/** @override */
ready() {
super.ready();
this.$.restAPI.getConfig().then(config => {

View File

@ -25,6 +25,7 @@
SHOW_MORE: 'show-more-messages',
};
/** @extends Polymer.Element */
class GrMessagesList extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -21,6 +21,7 @@
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrRelatedChangesList extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -58,6 +58,7 @@
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrReplyDialog extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -249,6 +250,7 @@
];
}
/** @override */
attached() {
super.attached();
this._getAccount().then(account => {
@ -256,6 +258,7 @@
});
}
/** @override */
ready() {
super.ready();
this.$.jsAPI.addElement(this.$.jsAPI.Element.REPLY_DIALOG, this);

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrReviewerList extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -21,6 +21,7 @@
* Fired when a comment is saved or deleted
*
* @event thread-list-modified
* @extends Polymer.Element
*/
class GrThreadList extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(

View File

@ -29,6 +29,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrUploadHelpDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -65,6 +66,7 @@
};
}
/** @override */
attached() {
super.attached();
this.$.restAPI.getLoggedIn()

View File

@ -21,6 +21,7 @@
/**
* @appliesMixin Gerrit.DisplayNameMixin
* @extends Polymer.Element
*/
class GrAccountDropdown extends Polymer.mixinBehaviors( [
Gerrit.DisplayNameBehavior,
@ -50,6 +51,7 @@
};
}
/** @override */
attached() {
super.attached();
this._handleLocationChange();
@ -66,6 +68,7 @@
});
}
/** @override */
detached() {
super.detached();
this.unlisten(window, 'location-change', '_handleLocationChange');

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrErrorDialog extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -28,6 +28,7 @@
/**
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrErrorManager extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -74,6 +75,7 @@
this._authErrorHandlerDeregistrationHook;
}
/** @override */
attached() {
super.attached();
this.listen(document, 'server-error', '_handleServerError');
@ -89,6 +91,7 @@
});
}
/** @override */
detached() {
super.detached();
this._clearHideAlertHandle();

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrKeyBindingDisplay extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -22,6 +22,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @extends Polymer.Element
*/
class GrKeyboardShortcutsDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -59,17 +60,20 @@
};
}
/** @override */
ready() {
super.ready();
this._ensureAttribute('role', 'dialog');
}
/** @override */
attached() {
super.attached();
this.addKeyboardShortcutDirectoryListener(
this._onDirectoryUpdated.bind(this));
}
/** @override */
detached() {
super.detached();
this.removeKeyboardShortcutDirectoryListener(

View File

@ -74,6 +74,7 @@
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.DocsUrlMixin
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrMainHeader extends Polymer.mixinBehaviors( [
Gerrit.AdminNavBehavior,
@ -150,11 +151,13 @@
];
}
/** @override */
ready() {
super.ready();
this._ensureAttribute('role', 'banner');
}
/** @override */
attached() {
super.attached();
this._loadAccount();
@ -162,6 +165,7 @@
this.listen(window, 'location-change', '_handleLocationChange');
}
/** @override */
detached() {
super.detached();
this.unlisten(window, 'location-change', '_handleLocationChange');

View File

@ -214,6 +214,7 @@
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrRouter extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,

View File

@ -107,6 +107,7 @@
/**
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.URLEncodingMixin
* @extends Polymer.Element
*/
class GrSearchBar extends Polymer.mixinBehaviors( [
Gerrit.KeyboardShortcutBehavior,

View File

@ -23,6 +23,7 @@
/**
* @appliesMixin Gerrit.DisplayNameMixin
* @extends Polymer.Element
*/
class GrSmartSearch extends Polymer.mixinBehaviors( [
Gerrit.DisplayNameBehavior,
@ -56,6 +57,7 @@
};
}
/** @override */
attached() {
super.attached();
this.$.restAPI.getConfig().then(cfg => {

View File

@ -466,6 +466,7 @@
/**
* @appliesMixin Gerrit.PatchSetMixin
* @extends Polymer.Element
*/
class GrCommentApi extends Polymer.mixinBehaviors( [
Gerrit.PatchSetBehavior,
@ -480,6 +481,7 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('reload-drafts',

View File

@ -24,6 +24,7 @@
[Gerrit.CoverageType.NOT_INSTRUMENTED, 'Not instrumented by any tests.'],
]);
/** @extends Polymer.Element */
class GrCoverageLayer extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -35,6 +35,7 @@
const LEFT_SIDE_CLASS = 'target-side-left';
const RIGHT_SIDE_CLASS = 'target-side-right';
/** @extends Polymer.Element */
class GrDiffCursor extends Polymer.mixinBehaviors([Gerrit.FireBehavior],
Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(Polymer.Element))) {
@ -105,6 +106,7 @@
];
}
/** @override */
ready() {
super.ready();
Polymer.RenderStatus.afterNextRender(this, () => {
@ -122,12 +124,14 @@
});
}
/** @override */
attached() {
super.attached();
// Catch when users are scrolling as the view loads.
this.listen(window, 'scroll', '_handleWindowScroll');
}
/** @override */
detached() {
super.detached();
this.unlisten(window, 'scroll', '_handleWindowScroll');

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrDiffHighlight extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -57,6 +58,7 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('comment-thread-mouseleave',

View File

@ -77,6 +77,8 @@
*
* Webcomponent fetching diffs and related data from restAPI and passing them
* to the presentational gr-diff for rendering.
*
* @extends Polymer.Element
*/
class GrDiffHost extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -249,6 +251,7 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener(
@ -276,6 +279,7 @@
event => this._handleDiffContextExpanded(event));
}
/** @override */
ready() {
super.ready();
if (this._canReload()) {
@ -283,6 +287,7 @@
}
}
/** @override */
attached() {
super.attached();
this._getLoggedIn().then(loggedIn => {

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrDiffModeSelector extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrDiffPreferencesDialog extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,

View File

@ -63,6 +63,8 @@
* "expand context" widget. This may require splitting a chunk/group so
* that the part that is within the context or has comments is shown, while
* the rest is not.
*
* @extends Polymer.Element
*/
class GrDiffProcessor extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
@ -119,11 +121,13 @@
};
}
/** @override */
attached() {
super.attached();
this.listen(window, 'scroll', '_handleWindowScroll');
}
/** @override */
detached() {
super.detached();
this.cancel();

View File

@ -32,6 +32,7 @@
/**
* @appliesMixin Gerrit.DomUtilMixin
* @extends Polymer.Element
*/
class GrDiffSelection extends Polymer.mixinBehaviors( [
Gerrit.DomUtilBehavior,
@ -58,6 +59,7 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('copy',
@ -66,6 +68,7 @@
e => this._handleDown(e));
}
/** @override */
attached() {
super.attached();
this.classList.add(SelectionClass.RIGHT);

View File

@ -39,6 +39,7 @@
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.PathListMixin
* @appliesMixin Gerrit.RESTClientMixin
* @extends Polymer.Element
*/
class GrDiffView extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -244,6 +245,7 @@
};
}
/** @override */
attached() {
super.attached();
this._getLoggedIn().then(loggedIn => {

View File

@ -94,6 +94,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @appliesMixin Gerrit.PatchSetMixin
* @extends Polymer.Element
*/
class GrDiff extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -284,6 +285,7 @@
];
}
/** @override */
created() {
super.created();
this.addEventListener('create-range-comment',
@ -292,11 +294,13 @@
() => this._handleRenderContent());
}
/** @override */
attached() {
super.attached();
this._observeNodes();
}
/** @override */
detached() {
super.detached();
this._unobserveIncrementalNodes();

View File

@ -30,6 +30,7 @@
*
* @property {string} patchNum
* @property {string} basePatchNum
* @extends Polymer.Element
*/
class GrPatchRangeSelect extends Polymer.mixinBehaviors( [
Gerrit.PatchSetBehavior,

View File

@ -23,6 +23,7 @@
const RANGE_HIGHLIGHT = 'style-scope gr-diff range';
const HOVER_HIGHLIGHT = 'style-scope gr-diff rangeHighlight';
/** @extends Polymer.Element */
class GrRangedCommentLayer extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.FireMixin
* @extends Polymer.Element
*/
class GrSelectionActionBox extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -42,6 +43,7 @@
};
}
/** @override */
created() {
super.created();

View File

@ -131,6 +131,7 @@
const GO_BACKSLASH_LITERAL = '\'\\\\\'';
const GLOBAL_LT_PATTERN = /</g;
/** @extends Polymer.Element */
class GrSyntaxLayer extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.ListViewMixin
* @extends Polymer.Element
*/
class GrDocumentationSearch extends Polymer.mixinBehaviors( [
Gerrit.ListViewBehavior,
@ -55,6 +56,7 @@
};
}
/** @override */
attached() {
super.attached();
this.dispatchEvent(

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrDefaultEditor extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -19,6 +19,7 @@
/**
* @appliesMixin Gerrit.PatchSetMixin
* @extends Polymer.Element
*/
class GrEditControls extends Polymer.mixinBehaviors( [
Gerrit.PatchSetBehavior,

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrEditFileControls extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -29,6 +29,7 @@
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @appliesMixin Gerrit.PatchSetMixin
* @appliesMixin Gerrit.PathListMixin
* @extends Polymer.Element
*/
class GrEditorView extends Polymer.mixinBehaviors( [
Gerrit.FireBehavior,
@ -92,12 +93,14 @@
};
}
/** @override */
created() {
super.created();
this.addEventListener('content-change',
e => this._handleContentChange(e));
}
/** @override */
attached() {
super.attached();
this._getEditPrefs().then(prefs => { this._prefs = prefs; });

View File

@ -20,6 +20,7 @@
/**
* @appliesMixin Gerrit.BaseUrlMixin
* @appliesMixin Gerrit.KeyboardShortcutMixin
* @extends Polymer.Element
*/
class GrAppElement extends Polymer.mixinBehaviors( [
Gerrit.BaseUrlBehavior,
@ -114,6 +115,7 @@
};
}
/** @override */
created() {
super.created();
this._bindKeyboardShortcuts();
@ -127,6 +129,7 @@
e => this._handleRpcLog(e));
}
/** @override */
ready() {
super.ready();
this.$.reporting.appStarted();

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrApp extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -41,6 +41,7 @@
return this._hooks[hookName];
};
/** @constructor */
function GrDomHook(hookName, opt_moduleName) {
this._instances = [];
this._callbacks = [];

View File

@ -19,6 +19,7 @@
const INIT_PROPERTIES_TIMEOUT_MS = 10000;
/** @extends Polymer.Element */
class GrEndpointDecorator extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {
@ -46,6 +47,7 @@
};
}
/** @override */
detached() {
super.detached();
for (const [el, domHook] of this._domHooks) {
@ -145,6 +147,7 @@
});
}
/** @override */
ready() {
super.ready();
Gerrit._endpoints.onNewEndpoint(this.name, this._initModule.bind(this));

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrEndpointParam extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrExternalStyle extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {
@ -73,11 +74,13 @@
});
}
/** @override */
attached() {
super.attached();
this._importAndApply();
}
/** @override */
ready() {
super.ready();
Gerrit.awaitPluginsLoaded().then(() => this._importAndApply());

View File

@ -17,6 +17,7 @@
(function() {
'use strict';
/** @extends Polymer.Element */
class GrPluginHost extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -17,6 +17,7 @@
(function(window) {
'use strict';
/** @extends Polymer.Element */
class GrPluginPopup extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {

View File

@ -65,6 +65,7 @@ limitations under the License.
setup(() => {
fixture('header-title');
stub('gr-custom-plugin-header', {
/** @override */
ready() { customHeader = this; },
});
Gerrit._loadPlugins([]);

Some files were not shown because too many files have changed in this diff Show More