refactor: merge themes into components (#2388)

This commit is contained in:
Mo
2023-08-06 08:52:19 -05:00
committed by GitHub
parent 1d60af0243
commit d2f8a36f19
33 changed files with 117 additions and 150 deletions

View File

@@ -1,7 +1,7 @@
import { ApplicationStage } from '@standardnotes/services'
import { Migration } from '@Lib/Migrations/Migration'
import { ThemeInterface } from '@standardnotes/models'
import { ContentType } from '@standardnotes/domain-core'
import { ComponentInterface } from '@standardnotes/models'
const NoDistractionIdentifier = 'org.standardnotes.theme-no-distraction'
@@ -18,7 +18,7 @@ export class Migration2_42_0 extends Migration {
}
private async deleteNoDistraction(): Promise<void> {
const themes = this.services.itemManager.getItems<ThemeInterface>(ContentType.TYPES.Theme).filter((theme) => {
const themes = this.services.itemManager.getItems<ComponentInterface>(ContentType.TYPES.Theme).filter((theme) => {
return theme.identifier === NoDistractionIdentifier
})

View File

@@ -1,4 +1,4 @@
import { CompoundPredicate, Predicate, SNComponent } from '@standardnotes/models'
import { CompoundPredicate, Predicate, ComponentItem } from '@standardnotes/models'
import { Migration } from '@Lib/Migrations/Migration'
import { ApplicationStage } from '@standardnotes/services'
import { ContentType } from '@standardnotes/domain-core'
@@ -19,8 +19,8 @@ export class Migration2_7_0 extends Migration {
const batchMgrId = 'org.standardnotes.batch-manager'
const batchMgrPred = new CompoundPredicate('and', [
new Predicate<SNComponent>('content_type', '=', ContentType.TYPES.Component),
new Predicate<SNComponent>('identifier', '=', batchMgrId),
new Predicate<ComponentItem>('content_type', '=', ContentType.TYPES.Component),
new Predicate<ComponentItem>('identifier', '=', batchMgrId),
])
const batchMgrSingleton = this.services.singletonManager.findSingleton(ContentType.TYPES.Component, batchMgrPred)