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

Fix superdesk-api so it's compatible with planning develop #4350

Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions scripts/core/get-superdesk-api-implementation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import {tryLocking, tryUnlocking} from './helpers/locking-helpers';
import {showPopup} from './ui/components/popupNew';
import {Card} from './ui/components/Card';
import {getTextColor} from './helpers/utils';
import {showModal} from '@superdesk/common';

function getContentType(id): Promise<IContentProfile> {
return dataApi.findOne('content_types', id);
Expand Down Expand Up @@ -344,6 +345,9 @@ export function getSuperdeskApiImplementation(
},
prepareExternalImageForDroppingToEditor,
},
showModal: (Component: React.ComponentType<{closeModal(): void}>, containerClass?: string) => {
return showModal(Component, containerClass);
},
alert: (message: string) => modal.alert({bodyText: message}),
confirm: (message: string, title?: string) => new Promise((resolve) => {
modal.confirm(message, title ?? gettext('Confirm'))
Expand Down
1 change: 1 addition & 0 deletions scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,7 @@ declare module 'superdesk-api' {
additionalData?: Partial<IArticle>,
): void;
};
showModal: (Component: React.ComponentType<{closeModal(): void;}>, containerClass?: string) => Promise<void>;
alert(message: string): Promise<void>;
confirm(message: string, title?: string): Promise<boolean>;
showIgnoreCancelSaveDialog(props: IIgnoreCancelSaveProps): Promise<IIgnoreCancelSaveResponse>;
Expand Down
Loading