Adrià Vilanova Martínez | 54964a5 | 2022-10-26 23:53:29 +0200 | [diff] [blame] | 1 | import {css} from 'lit'; |
| 2 | |
Adrià Vilanova Martínez | 78dcfdf | 2024-02-26 02:02:22 +0100 | [diff] [blame] | 3 | import * as pb from '../../proto/main_pb.js'; |
| 4 | |
Adrià Vilanova Martínez | 54964a5 | 2022-10-26 23:53:29 +0200 | [diff] [blame] | 5 | // TODO: remove this and substitute it with proper localization. |
| 6 | export 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ínez | 78dcfdf | 2024-02-26 02:02:22 +0100 | [diff] [blame] | 12 | 5: 'Change thread attribute', |
Adrià Vilanova Martínez | 54964a5 | 2022-10-26 23:53:29 +0200 | [diff] [blame] | 13 | 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ínez | 6c4739a | 2022-11-07 00:11:53 +0100 | [diff] [blame] | 18 | 20: 'Mark as read', |
| 19 | 21: 'Mark as unread', |
Adrià Vilanova Martínez | 54964a5 | 2022-10-26 23:53:29 +0200 | [diff] [blame] | 20 | }; |
| 21 | |
Adrià Vilanova Martínez | 78dcfdf | 2024-02-26 02:02:22 +0100 | [diff] [blame] | 22 | export 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ínez | 54964a5 | 2022-10-26 23:53:29 +0200 | [diff] [blame] | 28 | |
| 29 | export 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 | `; |