Skip to content

Commit

Permalink
part II - remove component from this repo and use the one from ui fra…
Browse files Browse the repository at this point in the history
…mework
  • Loading branch information
dzonidoo committed Nov 12, 2024
1 parent 7e12c29 commit c159725
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {assertNever} from 'core/helpers/typescript-helpers';
import {DeskAndStage} from './subcomponents/desk-and-stage';
import {LockInfo} from './subcomponents/lock-info';
import {Button, ButtonGroup, IconButton, Label, Modal, NavButton, Popover, Spacer} from 'superdesk-ui-framework/react';
import {Button, ButtonGroup, IconButton, Label, Modal, NavButton, Popover, Spacer, WithPopover} from 'superdesk-ui-framework/react';

Check failure on line 6 in scripts/apps/authoring-react/authoring-angular-integration.tsx

View workflow job for this annotation

GitHub Actions / test

This line has a length of 132. Maximum allowed is 120

Check failure on line 6 in scripts/apps/authoring-react/authoring-angular-integration.tsx

View workflow job for this annotation

GitHub Actions / test

This line has a length of 132. Maximum allowed is 120

Check failure on line 6 in scripts/apps/authoring-react/authoring-angular-integration.tsx

View workflow job for this annotation

GitHub Actions / test

This line has a length of 132. Maximum allowed is 120
import {
IArticle,
ITopBarWidget,
Expand All @@ -19,7 +19,6 @@ import {sdApi} from 'api';
import ng from 'core/services/ng';
import {AuthoringIntegrationWrapper} from './authoring-integration-wrapper';
import {MarkedDesks} from './toolbar/mark-for-desks/mark-for-desks-popover';
import {WithPopover} from 'core/helpers/with-popover';
import {HighlightsCardContent} from './toolbar/highlights-management';
import {
authoringStorageIArticle,
Expand Down Expand Up @@ -168,7 +167,6 @@ function getInlineToolbarActions(
/>
)}
placement="right-end"
zIndex={1050}
>
{
(togglePopup) => (
Expand Down
3 changes: 1 addition & 2 deletions scripts/apps/search/components/fields/translations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {gettext, gettextPlural} from 'core/utils';
import {IArticle} from 'superdesk-api';
import {TranslationsListWrapper} from '../translations-list-wrapper';
import {showPopup} from 'core/ui/components/popupNew';
import {showPopup} from 'superdesk-ui-framework/react';

interface IProps {
item: IArticle;
Expand Down Expand Up @@ -41,7 +41,6 @@ export class Translations extends React.PureComponent<IProps> {
close={closePopup}
/>
),
100,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ class AnnotationInputBody extends React.Component<IProps, IState> {
ref={(component) => {
this.positionerRef = component;
}}
zIndex={1051}
>
<Card padding={10}>
<div className="annotation-input" style={{width: 460}}>
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/get-superdesk-api-implementation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import {
LockInfo,
} from 'apps/authoring-react/subcomponents/lock-info-generic';
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';
Expand All @@ -120,6 +119,7 @@ import {getLabelNameResolver} from 'apps/workspace/helpers/getLabelForFieldId';
import {getSortedFields, getSortedFieldsFiltered} from 'apps/authoring/preview/utils';
import {editor3ToOperationalFormat} from 'apps/authoring-react/fields/editor3';
import {prepareSuperdeskQuery} from './helpers/universal-query';
import {showPopup} from 'superdesk-ui-framework/react';

export function openArticle(
id: IArticle['_id'],
Expand Down
42 changes: 0 additions & 42 deletions scripts/core/helpers/with-popover.tsx

This file was deleted.

1 change: 0 additions & 1 deletion scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3081,7 +3081,6 @@ declare module 'superdesk-api' {
referenceElement: HTMLElement,
placement: import('@popperjs/core').Placement,
Component: React.ComponentType<{closePopup(): void}>,
zIndex?: number,
closeOnHoverEnd?: boolean,
onClose?: () => void,
): {close: () => void};
Expand Down
3 changes: 1 addition & 2 deletions scripts/core/ui/components/UserPopup/UserPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import {showPopup} from 'core/ui/components/popupNew';
import {IUser} from 'superdesk-api';
import {UserAvatar} from 'apps/users/components/UserAvatar';
import {gettext} from 'core/utils';
import {showPopup} from 'superdesk-ui-framework/react';

interface IProps {
user: IUser;
Expand All @@ -28,7 +28,6 @@ const UserPopup = ({mentionName, user}: IProps) => {
</div>
</div>
),
100,
true,
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import React from 'react';
import {IArticle} from 'superdesk-api';
import {Button} from 'superdesk-ui-framework/react';
import {Button, showPopup} from 'superdesk-ui-framework/react';
import ng from 'core/services/ng';
import {gettext} from 'core/utils';
import {showPopup} from '../popupNew';
import {InitialView} from './initial-view';
import {DropZone3} from '../drop-zone-3';
import {getSuperdeskType} from 'utils/dragging';
Expand Down Expand Up @@ -78,7 +77,6 @@ export class ContentCreateDropdown extends React.PureComponent<IProps> {
onCreate={this.props.onCreate}
/>
),
1050,
);
}}
/>
Expand Down
157 changes: 0 additions & 157 deletions scripts/core/ui/components/popupNew.tsx

This file was deleted.

9 changes: 6 additions & 3 deletions scripts/core/ui/components/position-once.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {Placement} from '@popperjs/core';
import React from 'react';
import ReactDOM from 'react-dom';
import {IPropsPositioner, PopupPositioner} from './popupNew';
import {PopupPositioner} from 'superdesk-ui-framework/react';

interface IProps extends Omit<IPropsPositioner, 'referenceElement'> {
interface IProps {
delayed?: boolean;
placement: Placement;
onClose(): void;
closeOnHoverEnd?: boolean;
}

interface IState {
Expand Down Expand Up @@ -41,7 +45,6 @@ export class PositionInline extends React.PureComponent<IProps, IState> {
<PopupPositioner
referenceElement={this.referenceEl}
placement={this.props.placement}
zIndex={this.props.zIndex}
onClose={this.props.onClose}
>
{this.props.children}
Expand Down
4 changes: 1 addition & 3 deletions scripts/core/ui/components/virtual-lists/select.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import {SuperdeskReactComponent} from 'core/SuperdeskReactComponent';
import {showPopup} from '../popupNew';
import {IBaseRestApiResponse, IPropsSelectFromRemote, ISuperdeskQuery} from 'superdesk-api';
import {VirtualListFromQuery} from './virtual-list-from-query';
import {gettext} from 'core/utils';
import {InputLabel} from '../input-label';
import {SpacerBlock} from '../Spacer';
import {IconButton} from 'superdesk-ui-framework';
import {IconButton, showPopup} from 'superdesk-ui-framework/react';

interface IState<T> {
selected: 'loading' | T | null;
Expand Down Expand Up @@ -154,7 +153,6 @@ export class SelectFromEndpoint<T extends IBaseRestApiResponse>
/>
</div>
),
3000,
undefined,
() => {
this.lastPopup = null;
Expand Down

0 comments on commit c159725

Please sign in to comment.