Skip to content

Commit

Permalink
refactor: rebase upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Sep 30, 2024
1 parent 2f2442c commit dabeaa8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/library-authoring/components/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
useToggle,
} from '@openedx/paragon';
import { MoreVert } from '@openedx/paragon/icons';
import { useContext } from 'react';
import { Link } from 'react-router-dom';

import { type CollectionHit } from '../../search-manager';
Expand All @@ -19,11 +18,11 @@ import { useDeleteCollection, useRestoreCollection } from '../data/apiHooks';
import DeleteModal from '../../generic/delete-modal/DeleteModal';
import messages from './messages';

type CollectionCardProps = {
type CollectionMenuProps = {
collectionHit: CollectionHit,
};

const CollectionMenu = ({ collectionHit } : CollectionCardProps) => {
const CollectionMenu = ({ collectionHit } : CollectionMenuProps) => {
const intl = useIntl();
const { showToast } = useContext(ToastContext);
const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useToggle(false);
Expand Down Expand Up @@ -68,10 +67,16 @@ const CollectionMenu = ({ collectionHit } : CollectionCardProps) => {
src={MoreVert}
iconAs={Icon}
variant="primary"
alt={intl.formatMessage(messages.componentCardMenuAlt)}
alt={intl.formatMessage(messages.collectionCardMenuAlt)}
data-testid="collection-card-menu-toggle"
/>
<Dropdown.Menu>
<Dropdown.Item
as={Link}
to={`/library/${collectionHit.contextKey}/collection/${collectionHit.blockId}/`}
>
<FormattedMessage {...messages.menuOpen} />
</Dropdown.Item>
<Dropdown.Item onClick={openDeleteModal}>
<FormattedMessage {...messages.deleteCollection} />
</Dropdown.Item>
Expand All @@ -92,6 +97,10 @@ const CollectionMenu = ({ collectionHit } : CollectionCardProps) => {
);
};

type CollectionCardProps = {
collectionHit: CollectionHit,
};

const CollectionCard = ({ collectionHit } : CollectionCardProps) => {
const intl = useIntl();
const {
Expand Down
1 change: 0 additions & 1 deletion src/search-manager/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ interface BaseContentHit {
displayName: string;
usageKey: string;
blockId: string;
usageKey: string;
/** The course or library ID */
contextKey: string;
org: string;
Expand Down

0 comments on commit dabeaa8

Please sign in to comment.