Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

description_text field react #4194

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/apps/authoring-react/data-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ICommonFieldConfig,
IAuthoringStorage,
IFieldsAdapter,
IEditor3Config,
} from 'superdesk-api';
import ng from 'core/services/ng';
import {httpRequestJsonLocal} from 'core/helpers/network';
Expand Down Expand Up @@ -122,6 +123,28 @@ function getArticleContentProfile<T>(item: IArticle, fieldsAdapter: IFieldsAdapt
}
}

// TODO: write an upgrade script and remove hardcoding
// after angular based authoring is removed from the codebase
if (item.type === 'picture') {
thecalcc marked this conversation as resolved.
Show resolved Hide resolved
const fieldConfig: IEditor3Config = {
editorFormat: [],
minLength: fakeScope.schema?.minlength,
maxLength: fakeScope.schema?.maxlength,
cleanPastedHtml: fakeScope.editor?.cleanPastedHTML,
singleLine: true,
thecalcc marked this conversation as resolved.
Show resolved Hide resolved
disallowedCharacters: [],
};

const description_text: IAuthoringFieldV2 = {
id: 'description_text',
thecalcc marked this conversation as resolved.
Show resolved Hide resolved
name: gettext('Description'),
fieldType: 'editor3',
fieldConfig,
};

contentFields = contentFields.set(description_text.id, description_text);
thecalcc marked this conversation as resolved.
Show resolved Hide resolved
}

const profile: IContentProfileV2 = {
id: item.profile,
name: 'test content profile',
Expand Down