blob: 4a46af8dde4ecbefe5b0f688898dbc3e4c2ee98d [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import {fieldTypes} from 'shared/issue-fields.js';
6import {USER_REF} from './constants-users.js';
7import 'shared/typedef.js';
8
9/** @type {string} */
10export const PROJECT_NAME = 'project-name';
11
12/** @type {FieldDef} */
13export const FIELD_DEF_INT = Object.freeze({
14 fieldRef: Object.freeze({
15 fieldId: 123,
16 fieldName: 'field-name',
17 type: fieldTypes.INT_TYPE,
18 }),
19});
20
21/** @type {FieldDef} */
22export const FIELD_DEF_ENUM = Object.freeze({
23 fieldRef: Object.freeze({
24 fieldId: 456,
25 fieldName: 'enum',
26 type: fieldTypes.ENUM_TYPE,
27 }),
28});
29
30/** @type {Array<FieldDef>} */
31export const FIELD_DEFS = [
32 FIELD_DEF_INT,
33 FIELD_DEF_ENUM,
34];
35
36/** @type {Config} */
37export const CONFIG = Object.freeze({
38 projectName: PROJECT_NAME,
39 fieldDefs: FIELD_DEFS,
40 labelDefs: [
41 {label: 'One'},
42 {label: 'EnUm'},
43 {label: 'eNuM-Options'},
44 {label: 'hello-world', docstring: 'hmmm'},
45 {label: 'hello-me', docstring: 'hmmm'},
46 ],
47});
48
49/** @type {string} */
50export const DEFAULT_QUERY = 'owner:me';
51
52/** @type {PresentationConfig} */
53export const PRESENTATION_CONFIG = Object.freeze({
54 projectThumbnailUrl: 'test.png',
55 defaultColSpec: 'ID+Summary+AllLabels',
56 defaultQuery: DEFAULT_QUERY,
57});
58
59/** @type {Array<string>} */
60export const CUSTOM_PERMISSIONS = ['google', 'security'];
61
62/** @type {{userRefs: Array<UserRef>, groupRefs: Array<UserRef>}} */
63export const VISIBLE_MEMBERS = Object.freeze({
64 userRefs: [USER_REF],
65 groupRefs: [],
66});
67
68/** @type {TemplateDef} */
69export const TEMPLATE_DEF = Object.freeze({
70 templateName: 'Template Name',
71});
72
73export const STATE = Object.freeze({projectV0: {
74 name: PROJECT_NAME,
75 configs: {[PROJECT_NAME]: CONFIG},
76 presentationConfigs: {[PROJECT_NAME]: PRESENTATION_CONFIG},
77 customPermissions: {[PROJECT_NAME]: CUSTOM_PERMISSIONS},
78 visibleMembers: {[PROJECT_NAME]: VISIBLE_MEMBERS},
79 templates: {[PROJECT_NAME]: TEMPLATE_DEF},
80}});