Skip to content

Instantly share code, notes, and snippets.

@orgads
Last active May 13, 2019 13:07
Show Gist options
  • Save orgads/340faf577bfc63a7440c61ed10b82772 to your computer and use it in GitHub Desktop.
Save orgads/340faf577bfc63a7440c61ed10b82772 to your computer and use it in GitHub Desktop.
<dom-module id="ac-confirm-submit">
<script>
Gerrit.install(plugin => {
plugin.registerCustomComponent(
'confirm-submit-change', 'submit-for-another');
});
</script>
</dom-module>
<dom-module id="submit-for-another">
<template>
<template is="dom-if" if="[[otherUser]]">
<p style="color:red"><strong>Heads Up!</strong> Submitting [[otherUser]]'s change.</p>
</template>
</template>
<script>
Polymer({
properties: {
otherUser: String,
change: Object
},
attached() {
const _this = this;
Gerrit.get('/accounts/self', u => {
const accountID = u._account_id;
if (accountID != _this.change.owner._account_id)
_this.otherUser = _this.change.owner.name;
else
_this.otherUser = null;
});
}
});
</script>
</dom-module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment