refactor: place all presentation code in a presentation folder
Some features didn't have this folder.
Bug: twpowertools:226
Change-Id: Ic9803e7ee66a15c6c9e083509e059e453a26ed0f
diff --git a/src/features/ccDarkTheme/nodeWatcherHandlers/reportDialog.handler.ts b/src/features/ccDarkTheme/nodeWatcherHandlers/reportDialog.handler.ts
deleted file mode 100644
index 56699e9..0000000
--- a/src/features/ccDarkTheme/nodeWatcherHandlers/reportDialog.handler.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import { OptionsProviderPort } from '../../../services/options/OptionsProvider';
-import ReportDialogColorThemeFix from '../core/logic/reportDialog';
-
-/**
- * Sets the report dialog iframe's theme to the appropriate theme.
- */
-export default class CCDarkThemeReportDialogHandler extends CssSelectorNodeWatcherHandler {
- cssSelector = 'iframe';
-
- constructor(
- private optionsProvider: OptionsProviderPort,
- private reportDialogColorThemeFix: ReportDialogColorThemeFix,
- ) {
- super();
- }
-
- onMutatedNode(mutation: NodeMutation) {
- this.reportDialogColorThemeFix.fixThemeIfReportDialogIframeAndApplicable(
- mutation.node,
- this.optionsProvider,
- );
- }
-}
diff --git a/src/features/ccDarkTheme/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts b/src/features/ccDarkTheme/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts
deleted file mode 100644
index 28b9753..0000000
--- a/src/features/ccDarkTheme/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import { OptionsProviderPort } from '../../../services/options/OptionsProvider';
-import { isDarkThemeOn } from '../core/logic/darkTheme';
-import { unifiedProfilesFix } from '../core/logic/unifiedProfiles';
-
-/**
- * Redirect unified profile iframe to dark version if applicable
- */
-export default class CCDarkThemeUnifiedProfilesIframeHandler extends CssSelectorNodeWatcherHandler {
- cssSelector = 'iframe';
-
- constructor(private optionsProvider: OptionsProviderPort) {
- super();
- }
-
- async onMutatedNode(mutation: NodeMutation) {
- const optionsValues = await this.optionsProvider.getOptionsValues();
-
- if (
- isDarkThemeOn(optionsValues) &&
- unifiedProfilesFix.checkIframe(mutation.node)
- ) {
- unifiedProfilesFix.fixIframe(mutation.node);
- }
- }
-}
diff --git a/src/features/ccDarkTheme/nodeWatcherHandlers/ecApp.handler.ts b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/ecApp.handler.ts
similarity index 67%
rename from src/features/ccDarkTheme/nodeWatcherHandlers/ecApp.handler.ts
rename to src/features/ccDarkTheme/presentation/nodeWatcherHandlers/ecApp.handler.ts
index 355de3f..3676bcd 100644
--- a/src/features/ccDarkTheme/nodeWatcherHandlers/ecApp.handler.ts
+++ b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/ecApp.handler.ts
@@ -1,7 +1,7 @@
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import { OptionsProviderPort } from '../../../services/options/OptionsProvider';
-import { injectDarkThemeButton } from '../core/logic/darkTheme';
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import { OptionsProviderPort } from '../../../../services/options/OptionsProvider';
+import { injectDarkThemeButton } from '../../core/logic/darkTheme';
/**
* Injects the dark theme button.
diff --git a/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/reportDialog.handler.ts b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/reportDialog.handler.ts
new file mode 100644
index 0000000..89ccdf2
--- /dev/null
+++ b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/reportDialog.handler.ts
@@ -0,0 +1,25 @@
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import { OptionsProviderPort } from '../../../../services/options/OptionsProvider';
+import ReportDialogColorThemeFix from '../../core/logic/reportDialog';
+
+/**
+ * Sets the report dialog iframe's theme to the appropriate theme.
+ */
+export default class CCDarkThemeReportDialogHandler extends CssSelectorNodeWatcherHandler {
+ cssSelector = 'iframe';
+
+ constructor(
+ private optionsProvider: OptionsProviderPort,
+ private reportDialogColorThemeFix: ReportDialogColorThemeFix,
+ ) {
+ super();
+ }
+
+ onMutatedNode(mutation: NodeMutation) {
+ this.reportDialogColorThemeFix.fixThemeIfReportDialogIframeAndApplicable(
+ mutation.node,
+ this.optionsProvider,
+ );
+ }
+}
diff --git a/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts
new file mode 100644
index 0000000..13b6cc9
--- /dev/null
+++ b/src/features/ccDarkTheme/presentation/nodeWatcherHandlers/unifiedProfilesIframe.handler.ts
@@ -0,0 +1,27 @@
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import { OptionsProviderPort } from '../../../../services/options/OptionsProvider';
+import { isDarkThemeOn } from '../../core/logic/darkTheme';
+import { unifiedProfilesFix } from '../../core/logic/unifiedProfiles';
+
+/**
+ * Redirect unified profile iframe to dark version if applicable
+ */
+export default class CCDarkThemeUnifiedProfilesIframeHandler extends CssSelectorNodeWatcherHandler {
+ cssSelector = 'iframe';
+
+ constructor(private optionsProvider: OptionsProviderPort) {
+ super();
+ }
+
+ async onMutatedNode(mutation: NodeMutation) {
+ const optionsValues = await this.optionsProvider.getOptionsValues();
+
+ if (
+ isDarkThemeOn(optionsValues) &&
+ unifiedProfilesFix.checkIframe(mutation.node)
+ ) {
+ unifiedProfilesFix.fixIframe(mutation.node);
+ }
+ }
+}
diff --git a/src/features/ccDarkTheme/scripts/injectAutoDarkTheme.script.ts b/src/features/ccDarkTheme/presentation/scripts/injectAutoDarkTheme.script.ts
similarity index 74%
rename from src/features/ccDarkTheme/scripts/injectAutoDarkTheme.script.ts
rename to src/features/ccDarkTheme/presentation/scripts/injectAutoDarkTheme.script.ts
index c1bf0a1..afbe161 100644
--- a/src/features/ccDarkTheme/scripts/injectAutoDarkTheme.script.ts
+++ b/src/features/ccDarkTheme/presentation/scripts/injectAutoDarkTheme.script.ts
@@ -1,5 +1,5 @@
-import { ScriptPage } from '../../../common/architecture/scripts/Script';
-import StylesheetScript from '../../../common/architecture/scripts/stylesheet/StylesheetScript';
+import { ScriptPage } from '../../../../common/architecture/scripts/Script';
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
export default class CCDarkThemeInjectAutoDarkTheme extends StylesheetScript {
stylesheet = 'ccDarkTheme.bundle.css';
diff --git a/src/features/ccDarkTheme/scripts/injectForcedDarkTheme.script.ts b/src/features/ccDarkTheme/presentation/scripts/injectForcedDarkTheme.script.ts
similarity index 78%
rename from src/features/ccDarkTheme/scripts/injectForcedDarkTheme.script.ts
rename to src/features/ccDarkTheme/presentation/scripts/injectForcedDarkTheme.script.ts
index 04c624a..0a16a70 100644
--- a/src/features/ccDarkTheme/scripts/injectForcedDarkTheme.script.ts
+++ b/src/features/ccDarkTheme/presentation/scripts/injectForcedDarkTheme.script.ts
@@ -1,5 +1,5 @@
-import { ScriptPage } from '../../../common/architecture/scripts/Script';
-import StylesheetScript from '../../../common/architecture/scripts/stylesheet/StylesheetScript';
+import { ScriptPage } from '../../../../common/architecture/scripts/Script';
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
export default class CCDarkThemeInjectForcedDarkTheme extends StylesheetScript {
stylesheet = 'ccDarkTheme.bundle.css';
diff --git a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
similarity index 63%
rename from src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
rename to src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
index d1068e3..c776588 100644
--- a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
+++ b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
@@ -1,6 +1,6 @@
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import CCInfiniteScroll from '../core/ccInfiniteScroll';
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import CCInfiniteScroll from '../../core/ccInfiniteScroll';
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
export default class CCInfiniteScrollLoadMoreBarHandler extends CssSelectorNodeWatcherHandler {
cssSelector = '.load-more-bar';
diff --git a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
similarity index 66%
rename from src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
rename to src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
index 0dd8db6..2f3e72a 100644
--- a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
+++ b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
@@ -1,6 +1,6 @@
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
-import CCInfiniteScroll from '../core/ccInfiniteScroll';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import CCInfiniteScroll from '../../core/ccInfiniteScroll';
export default class CCInfiniteScrollLoadMoreBtnHandler extends CssSelectorNodeWatcherHandler {
cssSelector =
diff --git a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
similarity index 62%
rename from src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
rename to src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
index 0d77cf7..ad6e153 100644
--- a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
+++ b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
@@ -1,6 +1,6 @@
-import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
-import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
-import CCInfiniteScroll from '../core/ccInfiniteScroll';
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import CCInfiniteScroll from '../../core/ccInfiniteScroll';
export default class CCInfiniteScrollSetUpHandler extends CssSelectorNodeWatcherHandler {
cssSelector = 'ec-app, .scrollable-content';