gerrit/polygerrit-ui/app/samples/repo-command.html
Paladox none 2bd5c217d0 Rename projects admin interface to repo
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
2017-12-27 21:40:31 +00:00

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>