Adrià Vilanova Martínez | c78c3ad | 2024-05-18 00:35:51 +0200 | [diff] [blame] | 1 | import DependenciesProviderSingleton, { |
| 2 | WorkflowsDependency, |
| 3 | WorkflowsImportDependency, |
| 4 | } from '../../../common/architecture/dependenciesProvider/DependenciesProvider'; |
| 5 | import { |
| 6 | ScriptEnvironment, |
| 7 | ScriptPage, |
| 8 | ScriptRunPhase, |
| 9 | } from '../../../common/architecture/scripts/Script'; |
Adrià Vilanova Martínez | 8b591d9 | 2024-10-19 15:55:15 +0200 | [diff] [blame^] | 10 | import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript'; |
Adrià Vilanova Martínez | c78c3ad | 2024-05-18 00:35:51 +0200 | [diff] [blame] | 11 | import WorkflowsImport from '../core/communityConsole/import'; |
| 12 | import Workflows from '../core/communityConsole/workflows'; |
| 13 | import WorkflowsImportCRTagsHandler from '../nodeWatcherHandlers/crTags.handler'; |
| 14 | import WorkflowsThreadListActionBarHandler from '../nodeWatcherHandlers/threadListActionBar.handler'; |
| 15 | |
| 16 | export interface WorkflowsNodeWatcherDependencies { |
| 17 | workflows: Workflows; |
| 18 | workflowsImport: WorkflowsImport; |
| 19 | } |
| 20 | |
Adrià Vilanova Martínez | 8b591d9 | 2024-10-19 15:55:15 +0200 | [diff] [blame^] | 21 | export default class WorkflowsNodeWatcherScript extends LegacyNodeWatcherScript<WorkflowsNodeWatcherDependencies> { |
Adrià Vilanova Martínez | c78c3ad | 2024-05-18 00:35:51 +0200 | [diff] [blame] | 22 | public page = ScriptPage.CommunityConsole; |
| 23 | public environment = ScriptEnvironment.ContentScript; |
| 24 | public runPhase = ScriptRunPhase.Main; |
| 25 | public handlers = new Map([ |
| 26 | ['workflowsImportCRTags', WorkflowsImportCRTagsHandler], |
| 27 | ['workflowsThreadListActionBar', WorkflowsThreadListActionBarHandler], |
| 28 | ]); |
| 29 | |
| 30 | protected optionsFactory(): WorkflowsNodeWatcherDependencies { |
| 31 | const dependenciesProvider = DependenciesProviderSingleton.getInstance(); |
| 32 | return { |
| 33 | workflows: dependenciesProvider.getDependency(WorkflowsDependency), |
| 34 | workflowsImport: dependenciesProvider.getDependency( |
| 35 | WorkflowsImportDependency, |
| 36 | ), |
| 37 | }; |
| 38 | } |
| 39 | } |