refactor: migrate standalone scripts to the new DI architecture
Bug: twpowertools:226
Change-Id: Ie32b0200a31626bde06f3bdb0655790bb5a76802
diff --git a/src/presentation/standaloneScripts/startupDataStorage/baseApplyStartupDataModifications.script.ts b/src/presentation/standaloneScripts/startupDataStorage/baseApplyStartupDataModifications.script.ts
new file mode 100644
index 0000000..8244382
--- /dev/null
+++ b/src/presentation/standaloneScripts/startupDataStorage/baseApplyStartupDataModifications.script.ts
@@ -0,0 +1,24 @@
+import Script, {
+ ScriptEnvironment,
+ ScriptPage,
+} from '../../../common/architecture/scripts/Script';
+import { StartupDataStoragePort } from '../../../services/communityConsole/StartupDataStorage.port';
+
+/**
+ * Base class which applies pending startup data modifications which have been
+ * added by other scripts.
+ */
+export default abstract class BaseApplyStartupDataModificationsScript extends Script {
+ priority = 2 ** 32;
+
+ page = ScriptPage.CommunityConsole;
+ environment = ScriptEnvironment.ContentScript;
+
+ constructor(private startupDataStorage: StartupDataStoragePort) {
+ super();
+ }
+
+ execute() {
+ this.startupDataStorage.applyModifications();
+ }
+}