blob: ef239269e0a1a3e9d36387d77f8f8a7e4b520221 [file] [log] [blame]
Adrià Vilanova Martínez54964a52022-10-26 23:53:29 +02001import {css} from 'lit';
2
Adrià Vilanova Martínez78dcfdf2024-02-26 02:02:22 +01003import * as pb from '../../proto/main_pb.js';
4
Adrià Vilanova Martínez54964a52022-10-26 23:53:29 +02005// TODO: remove this and substitute it with proper localization.
6export const kActionHeadings = {
7 0: 'Unknown action',
8 1: 'Reply',
9 2: 'Move to a forum',
10 3: 'Mark as duplicate of a thread',
11 4: 'Unmark duplicate',
Adrià Vilanova Martínez78dcfdf2024-02-26 02:02:22 +010012 5: 'Change thread attribute',
Adrià Vilanova Martínez54964a52022-10-26 23:53:29 +020013 6: 'Reply with canned response',
14 16: 'Star/unstar thread',
15 17: 'Subscribe/unsubscribe to thread',
16 18: 'Vote thread',
17 19: 'Report thread',
Adrià Vilanova Martínez6c4739a2022-11-07 00:11:53 +010018 20: 'Mark as read',
19 21: 'Mark as unread',
Adrià Vilanova Martínez54964a52022-10-26 23:53:29 +020020};
21
Adrià Vilanova Martínez78dcfdf2024-02-26 02:02:22 +010022export const kSupportedActions = new Set([
23 pb.workflows.Action.ActionCase.ATTRIBUTE_ACTION,
24 pb.workflows.Action.ActionCase.REPLY_WITH_CR_ACTION,
25 pb.workflows.Action.ActionCase.MARK_AS_READ_ACTION,
26 pb.workflows.Action.ActionCase.MARK_AS_UNREAD_ACTION,
27]);
Adrià Vilanova Martínez54964a52022-10-26 23:53:29 +020028
29export const kActionStyles = css`
30 .action {
31 margin-bottom: 20px;
32 }
33
34 .header {
35 display: flex;
36 align-items: center;
37 margin-bottom: 8px;
38 }
39
40 .step {
41 display: flex;
42 position: relative;
43 align-items: center;
44 justify-content: center;
45
46 min-height: 30px;
47 min-width: 30px;
48 margin-inline-end: 8px;
49
50 font-weight: 500;
51 font-size: 18px;
52
53 border-radius: 50%;
54 color: white;
55 background-color: #018786;
56 }
57
58 :is(.action--idle, .action--running) .step {
59 color: black;
60 background-color: #d1d1d1;
61 }
62
63 .action--error .step {
64 background-color: #c30000;
65 }
66
67 .step mwc-circular-progress {
68 position: absolute;
69 --mdc-theme-primary: #018786;
70 }
71
72 .title {
73 font-weight: 500;
74 margin: 0;
75 flex-grow: 1;
76 }
77
78 .header .select {
79 flex-grow: 1;
80 width: 300px;
81 padding: 4px;
82 margin-inline-end: 8px;
83 font-size: 16px;
84 }
85`;