Skip to content

Commit

Permalink
fix extensions (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek authored Apr 24, 2024
1 parent 206f5f2 commit 23c0872
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions client/extensions/auto-tagger/src/auto-tagging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -35,7 +35,7 @@ interface IAutoTaggingSearchResult {
};
}

type IProps = React.ComponentProps<IAuthoringSideWidget['component']>;
type IProps = React.ComponentProps<IArticleSideWidget['component']>;

interface ISemaphoreFields {
[key: string]: {
Expand Down Expand Up @@ -141,12 +141,12 @@ function showAutoTaggerServiceErrorModal(superdesk: ISuperdesk, errors: Array<IT
));
}

export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string): IAuthoringSideWidget['component'] {
export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string): IArticleSideWidget['component'] {
const {preferences} = superdesk;
const {httpRequestJsonLocal} = superdesk;
const {gettext, gettextPlural} = superdesk.localization;
const {memoize, generatePatch, arrayToTree} = superdesk.utilities;
const {WidgetHeading, Alert} = superdesk.components;
const {AuthoringWidgetHeading, Alert} = superdesk.components;
const groupLabels = getGroups(superdesk);

const TagListComponent = getTagsListComponent(superdesk);
Expand Down Expand Up @@ -462,7 +462,7 @@ export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string): I
})()
}

<WidgetHeading
<AuthoringWidgetHeading
widgetName={label}
editMode={dirty}
>
Expand All @@ -487,7 +487,7 @@ export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string): I
</div>
)
}
</WidgetHeading>
</AuthoringWidgetHeading>
<div className="widget-content sd-padding-all--2">
<div>
{/* Run automatically button is hidden for the next release */}
Expand Down
8 changes: 4 additions & 4 deletions client/extensions/upload-iptc/src/extension.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<ISubject>, Array<ISubject>]) => {
]).then(([categories, supp_categories]: [IVocabulary, IVocabulary]) => {
Object.assign(item, {
slugline: toString(data.ObjectName),
byline: toString(data['By-line']),
Expand All @@ -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: {
Expand Down

0 comments on commit 23c0872

Please sign in to comment.