From 8e05cf452a015e8b94f2ce5ea62f031f803f6950 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Wed, 24 Apr 2024 10:51:24 +0200 Subject: [PATCH] fix extensions --- client/extensions/auto-tagger/src/auto-tagging.tsx | 12 ++++++------ client/extensions/upload-iptc/src/extension.ts | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/extensions/auto-tagger/src/auto-tagging.tsx b/client/extensions/auto-tagger/src/auto-tagging.tsx index 54813d3a..9f304cfd 100644 --- a/client/extensions/auto-tagger/src/auto-tagging.tsx +++ b/client/extensions/auto-tagger/src/auto-tagging.tsx @@ -3,7 +3,7 @@ import {OrderedMap, OrderedSet, Map} from 'immutable'; import {Switch, Button, ButtonGroup, EmptyState, Autocomplete, Modal} from 'superdesk-ui-framework/react'; import {ToggleBoxNext} from 'superdesk-ui-framework'; -import {IArticle, IAuthoringSideWidget, ISuperdesk} from 'superdesk-api'; +import {IArticle, IArticleSideWidget, ISuperdesk} from 'superdesk-api'; import {getTagsListComponent} from './tag-list'; import {getNewItemComponent} from './new-item'; @@ -35,7 +35,7 @@ interface IAutoTaggingSearchResult { }; } -type IProps = React.ComponentProps; +type IProps = React.ComponentProps; interface ISemaphoreFields { [key: string]: { @@ -141,12 +141,12 @@ function showAutoTaggerServiceErrorModal(superdesk: ISuperdesk, errors: Array @@ -487,7 +487,7 @@ export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string): I ) } - +
{/* Run automatically button is hidden for the next release */} diff --git a/client/extensions/upload-iptc/src/extension.ts b/client/extensions/upload-iptc/src/extension.ts index d888899b..334e1507 100644 --- a/client/extensions/upload-iptc/src/extension.ts +++ b/client/extensions/upload-iptc/src/extension.ts @@ -1,4 +1,4 @@ -import {IExtension, IExtensionActivationResult, ISuperdesk, IArticle, ISubject} from 'superdesk-api'; +import {IExtension, IExtensionActivationResult, ISuperdesk, IArticle, ISubject, IVocabulary} from 'superdesk-api'; const PHOTO_CAT_ID = 'photo_categories'; const PHOTO_SUPPCAT_ID = 'photo_supplementalcategories'; @@ -51,7 +51,7 @@ const extension: IExtension = { iptcMapping: (data, item: IArticle) => Promise.all([ superdesk.entities.vocabulary.getVocabulary(PHOTO_CAT_ID), superdesk.entities.vocabulary.getVocabulary(PHOTO_SUPPCAT_ID), - ]).then(([categories, supp_categories]: [Array, Array]) => { + ]).then(([categories, supp_categories]: [IVocabulary, IVocabulary]) => { Object.assign(item, { slugline: toString(data.ObjectName), byline: toString(data['By-line']), @@ -65,10 +65,10 @@ const extension: IExtension = { keywords: toArray(data.SubjectReference), subject: (item.subject || []).concat( data.Category != null ? - categories.filter((subj) => subj.qcode === data.Category).map(copySubj(PHOTO_CAT_ID)) : + categories.items.filter((subj) => subj.qcode === data.Category).map(copySubj(PHOTO_CAT_ID)) : [], data.SupplementalCategories != null ? - supp_categories.filter((subj) => subj.qcode === data.SupplementalCategories).map(copySubj(PHOTO_SUPPCAT_ID)) : + supp_categories.items.filter((subj) => subj.qcode === data.SupplementalCategories).map(copySubj(PHOTO_SUPPCAT_ID)) : [], ), dateline: {