2bd5c217d0
This also includes backwards compatibility with the old /projects/ url. This only renames it for the admin interface. It does not rename it for changes or anything else. Bug: Issue 7754 Change-Id: Ia31d3f26871556729fb3c5b5b28ceca12da1ec7c
43 lines
1.0 KiB
HTML
43 lines
1.0 KiB
HTML
<dom-module id="sample-repo-command">
|
|
<script>
|
|
Gerrit.install(plugin => {
|
|
// High-level API
|
|
plugin.project()
|
|
.createCommand('Bork', (repoName, projectConfig) => {
|
|
if (repoName !== 'All-Projects') {
|
|
return false;
|
|
}
|
|
}).onTap(() => {
|
|
alert('Bork, bork!');
|
|
});
|
|
|
|
// Low-level API
|
|
plugin.registerCustomComponent(
|
|
'repo-command', 'repo-command-low');
|
|
});
|
|
</script>
|
|
</dom-module>
|
|
|
|
<!-- Low-level custom component for repo command. -->
|
|
<dom-module id="repo-command-low">
|
|
<template>
|
|
<gr-repo-command
|
|
title="Low-level bork"
|
|
on-command-tap="_handleCommandTap">
|
|
</gr-repo-command>
|
|
</template>
|
|
<script>
|
|
Polymer({
|
|
is: 'repo-command-low',
|
|
attached() {
|
|
console.log(this.repoName);
|
|
console.log(this.config);
|
|
this.hidden = this.repoName !== 'All-Projects';
|
|
},
|
|
_handleCommandTap() {
|
|
alert('(softly) bork, bork.');
|
|
},
|
|
});
|
|
</script>
|
|
</dom-module>
|