Last active
May 13, 2019 13:07
-
-
Save orgads/340faf577bfc63a7440c61ed10b82772 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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