chore: fix ContentType usage (#2353)

* chore: fix ContentType usage

* chore: fix specs
This commit is contained in:
Karol Sójko
2023-07-12 13:53:29 +02:00
committed by GitHub
parent d057cdff84
commit 325737bfbd
247 changed files with 1092 additions and 1060 deletions

View File

@@ -1,7 +1,6 @@
import { ContentType } from '@standardnotes/common'
import { ComponentAction } from './ComponentAction'
export type ComponentPermission = {
name: ComponentAction
content_types?: ContentType[]
content_types?: string[]
}

View File

@@ -1,5 +1,4 @@
import { ComponentPermission } from '../Component/ComponentPermission'
import { ContentType } from '@standardnotes/common'
import { ComponentArea } from '../Component/ComponentArea'
import { PermissionName } from '../Permission/PermissionName'
import { FeatureIdentifier } from './FeatureIdentifier'
@@ -51,7 +50,7 @@ export type ClientFeatureDescription = RoleFields & {
export type ComponentFeatureDescription = BaseFeatureDescription & {
/** The relative path of the index.html file or the main css file if theme, within the component folder itself */
index_path: string
content_type: ContentType
content_type: string
area: ComponentArea
}

View File

@@ -1,4 +1,4 @@
import { ContentType } from '@standardnotes/common'
import { ContentType, RoleName } from '@standardnotes/domain-core'
import {
EditorFeatureDescription,
IframeComponentFeatureDescription,
@@ -10,7 +10,6 @@ import { NoteType } from '../Component/NoteType'
import { FillEditorComponentDefaults } from './Utilities/FillEditorComponentDefaults'
import { ComponentAction } from '../Component/ComponentAction'
import { ComponentArea } from '../Component/ComponentArea'
import { RoleName } from '@standardnotes/domain-core'
export function GetDeprecatedFeatures(): FeatureDescription[] {
const bold: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -21,14 +20,14 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
component_permissions: [
{
name: ComponentAction.StreamContextItem,
content_types: [ContentType.Note],
content_types: [ContentType.TYPES.Note],
},
{
name: ComponentAction.StreamItems,
content_types: [
ContentType.FilesafeCredentials,
ContentType.FilesafeFileMetadata,
ContentType.FilesafeIntegration,
ContentType.TYPES.FilesafeCredentials,
ContentType.TYPES.FilesafeFileMetadata,
ContentType.TYPES.FilesafeIntegration,
],
},
],
@@ -101,14 +100,14 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
component_permissions: [
{
name: ComponentAction.StreamContextItem,
content_types: [ContentType.Note],
content_types: [ContentType.TYPES.Note],
},
{
name: ComponentAction.StreamItems,
content_types: [
ContentType.FilesafeCredentials,
ContentType.FilesafeFileMetadata,
ContentType.FilesafeIntegration,
ContentType.TYPES.FilesafeCredentials,
ContentType.TYPES.FilesafeFileMetadata,
ContentType.TYPES.FilesafeIntegration,
],
},
],

View File

@@ -1,5 +1,6 @@
import { ContentType } from '@standardnotes/domain-core'
import { ComponentAction } from '../../Component/ComponentAction'
import { ContentType } from '@standardnotes/common'
import { EditorFeatureDescription } from '../../Feature/FeatureDescription'
import { ComponentArea } from '../../Component/ComponentArea'
@@ -16,12 +17,12 @@ export function FillEditorComponentDefaults(
component.component_permissions = [
{
name: ComponentAction.StreamContextItem,
content_types: [ContentType.Note],
content_types: [ContentType.TYPES.Note],
},
]
}
component.content_type = ContentType.Component
component.content_type = ContentType.TYPES.Component
if (!component.area) {
component.area = ComponentArea.Editor
}

View File

@@ -1,4 +1,5 @@
import { ContentType } from '@standardnotes/common'
import { ContentType } from '@standardnotes/domain-core'
import { ThemeFeatureDescription } from '../../Feature/FeatureDescription'
import { ComponentArea } from '../../Component/ComponentArea'
@@ -11,7 +12,7 @@ export function FillThemeComponentDefaults(
theme.index_path = 'index.css'
}
theme.content_type = ContentType.Theme
theme.content_type = ContentType.TYPES.Theme
if (!theme.area) {
theme.area = ComponentArea.Themes