blob: 543f5bc829f6b364d004eef87d42eba45ded6456 [file] [log] [blame]
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
import '../gr-avatar/gr-avatar';
import '../gr-button/gr-button';
import '../gr-icon/gr-icon';
import '../../plugins/gr-endpoint-decorator/gr-endpoint-decorator';
import '../../plugins/gr-endpoint-param/gr-endpoint-param';
import {customElement, property} from 'lit/decorators.js';
import {AccountInfo, ChangeInfo} from '../../../types/common';
import {html, LitElement} from 'lit';
import {HovercardMixin} from '../../../mixins/hovercard-mixin/hovercard-mixin';
import {when} from 'lit/directives/when.js';
import './gr-hovercard-account-contents';
// This avoids JSC_DYNAMIC_EXTENDS_WITHOUT_JSDOC closure compiler error.
const base = HovercardMixin(LitElement);
export class GrHovercardAccount extends base {
@property({type: Object})
account!: AccountInfo;
* Optional ChangeInfo object, typically comes from the change page or
* from a row in a list of search results. This is needed for some change
* related features like adding the user as a reviewer.
@property({type: Object})
change?: ChangeInfo;
* Should attention set related features be shown in the component? Note
* that the information whether the user is in the attention set or not is
* part of the ChangeInfo object in the change property.
@property({type: Boolean})
highlightAttention = false;
override render() {
return html`
<div id="container" role="tooltip" tabindex="-1">
() =>
private redirectEventToTarget(e: CustomEvent<unknown>) {
this.dispatchEventThroughTarget(e.type, e.detail);
declare global {
interface HTMLElementTagNameMap {
'gr-hovercard-account': GrHovercardAccount;