blob: c6c5b45c8abd9683481dc6cebe49943d0c2a70f2 [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001// Copyright 2019 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 * as issueV0 from './constants-issueV0.js';
6import * as users from './constants-users.js';
7import 'shared/typedef.js';
8
9/** @type {string} */
10export const NAME = 'hotlists/1234';
11
12/** @type {Hotlist} */
13export const HOTLIST = Object.freeze({
14 name: NAME,
15 displayName: 'Hotlist-Name',
16 owner: users.NAME,
17 editors: [users.NAME_2],
18 summary: 'Summary',
19 description: 'Description',
20 defaultColumns: [{column: 'Rank'}, {column: 'ID'}, {column: 'Summary'}],
21 hotlistPrivacy: 'PUBLIC',
22});
23
24export const HOTLIST_ITEM_NAME = NAME + '/items/56';
25
26/** @type {HotlistItem} */
27export const HOTLIST_ITEM = Object.freeze({
28 name: HOTLIST_ITEM_NAME,
29 issue: issueV0.NAME,
30 // rank: The API excludes the rank field if it's 0.
31 adder: users.NAME,
32 createTime: '2020-01-01T12:00:00Z',
33});
34
35/** @type {HotlistIssue} */
36export const HOTLIST_ISSUE = Object.freeze({
37 ...issueV0.ISSUE, ...HOTLIST_ITEM, adder: users.USER,
38});
39
40/** @type {HotlistItem} */
41export const HOTLIST_ITEM_OTHER_PROJECT = Object.freeze({
42 name: NAME + '/items/78',
43 issue: issueV0.NAME_OTHER_PROJECT,
44 rank: 1,
45 adder: users.NAME,
46 createTime: '2020-01-01T12:00:00Z',
47});
48
49/** @type {HotlistIssue} */
50export const HOTLIST_ISSUE_OTHER_PROJECT = Object.freeze({
51 ...issueV0.ISSUE_OTHER_PROJECT,
52 ...HOTLIST_ITEM_OTHER_PROJECT,
53 adder: users.USER,
54});
55
56/** @type {HotlistItem} */
57export const HOTLIST_ITEM_CLOSED = Object.freeze({
58 name: NAME + '/items/90',
59 issue: issueV0.NAME_CLOSED,
60 rank: 2,
61 adder: users.NAME,
62 createTime: '2020-01-01T12:00:00Z',
63});
64
65/** @type {HotlistIssue} */
66export const HOTLIST_ISSUE_CLOSED = Object.freeze({
67 ...issueV0.ISSUE_CLOSED, ...HOTLIST_ITEM_CLOSED, adder: users.USER,
68});
69
70/** @type {Object<string, Hotlist>} */
71export const BY_NAME = Object.freeze({[NAME]: HOTLIST});
72
73/** @type {Object<string, Array<HotlistItem>>} */
74export const HOTLIST_ITEMS = Object.freeze({
75 [NAME]: [HOTLIST_ITEM],
76});