Adrià Vilanova MartÃnez | ac4a644 | 2022-05-15 19:05:13 +0200 | [diff] [blame] | 1 | // Copyright 2022 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 | |
| 5 | // this const is used on issue wizard lading page for render user role options |
| 6 | export enum IssueWizardPersona { |
| 7 | EndUser = "EndUser", |
| 8 | Developer = "Developer", |
| 9 | Contributor = "Contributor", |
| 10 | }; |
| 11 | |
| 12 | |
| 13 | export const ISSUE_WIZARD_PERSONAS_DETAIL = Object.freeze({ |
| 14 | [IssueWizardPersona.EndUser]: { |
| 15 | name: 'End User', |
| 16 | description: 'I am trying to use a website.', |
| 17 | }, |
| 18 | [IssueWizardPersona.Developer]: { |
| 19 | name: 'Web Developer', |
| 20 | description: 'I am trying to build something on a website.', |
| 21 | }, |
| 22 | [IssueWizardPersona.Contributor]: { |
| 23 | name: 'Chromium Contributor', |
| 24 | description: 'I know about a problem in specific tests or code.', |
| 25 | } |
| 26 | }); |
| 27 | |
| 28 | export enum CustomQuestionType { |
| 29 | EMPTY, // this is used to define there is no subquestions |
| 30 | Text, |
| 31 | Input, |
| 32 | Select, |
| 33 | } |
| 34 | export type CustomQuestion = { |
| 35 | type: CustomQuestionType, |
| 36 | question: string, |
| 37 | answerPrefix?: string, |
| 38 | tip?: string, |
| 39 | options?: string[], |
| 40 | subQuestions?: CustomQuestion[] | null, |
| 41 | }; |
| 42 | |
| 43 | export type IssueCategory = { |
| 44 | name: string, |
| 45 | description: string, |
| 46 | persona: IssueWizardPersona, |
| 47 | enabled: boolean, |
| 48 | tip?: string, |
| 49 | component?: string, |
| 50 | customQuestions?: CustomQuestion[], |
| 51 | labels?: Array<string>, |
| 52 | }; |
| 53 | |
| 54 | export type SelectMenuOption = { |
| 55 | name: string, |
| 56 | description?: string, |
| 57 | }; |