blob: c8dd2bd0433d8715965fc2dcce3828c38e943d6d [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001// Copyright 2020 The Chromium Authors
Copybara854996b2021-09-07 19:36:02 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import page from 'page';
6import {LitElement, html, css} from 'lit-element';
7
8/**
9 * `<mr-issue-entry-page>`
10 *
11 * This is the main details section for a given issue.
12 *
13 */
14export class MrIssueEntryPage extends LitElement {
15 /** @override */
16 static get styles() {
17 return css`
18 :host {
19 margin: 0;
20 }
21 `;
22 }
23
24 /** @override */
25 static get properties() {
26 return {
27 userDisplayName: {type: String},
28 loginUrl: {type: String},
29 };
30 }
31
32 /** @override */
33 constructor() {
34 super();
35
36 /* dependency injection for testing purpose */
37 this._page = page;
38 }
39
40 /** @override */
41 connectedCallback() {
42 super.connectedCallback();
43 if (!this.userDisplayName) {
44 this._page(this.loginUrl);
45 }
46 }
47
48 /** @override */
49 render() {
50 return html`
51 <div>SPA issue entry page place holder</div>
52 `;
53 }
54}
55
56customElements.define('mr-issue-entry-page', MrIssueEntryPage);