|
|
@@ -23,7 +23,9 @@ import {
|
|
|
IPageInfoAll, IPageInfoForEntity, IPageInfoForListing, IPageWithMeta, isIPageInfoForListing,
|
|
|
} from '~/interfaces/page';
|
|
|
import { IPageSearchMeta, isIPageSearchMeta } from '~/interfaces/search';
|
|
|
-import { OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction } from '~/interfaces/ui';
|
|
|
+import {
|
|
|
+ OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction, OnPutBackedFunction,
|
|
|
+} from '~/interfaces/ui';
|
|
|
import LinkedPagePath from '~/models/linked-page-path';
|
|
|
|
|
|
import { ForceHideMenuItems, PageItemControl } from '../Common/Dropdown/PageItemControl';
|
|
|
@@ -40,6 +42,7 @@ type Props = {
|
|
|
onPageDuplicated?: OnDuplicatedFunction,
|
|
|
onPageRenamed?: OnRenamedFunction,
|
|
|
onPageDeleted?: OnDeletedFunction,
|
|
|
+ onPagePutBacked?: OnPutBackedFunction,
|
|
|
}
|
|
|
|
|
|
const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (props: Props, ref): JSX.Element => {
|
|
|
@@ -48,7 +51,7 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
|
|
|
page: { data: pageData, meta: pageMeta }, isSelected, isEnableActions,
|
|
|
forceHideMenuItems,
|
|
|
showPageUpdatedTime,
|
|
|
- onClickItem, onCheckboxChanged, onPageDuplicated, onPageRenamed, onPageDeleted,
|
|
|
+ onClickItem, onCheckboxChanged, onPageDuplicated, onPageRenamed, onPageDeleted, onPagePutBacked,
|
|
|
} = props;
|
|
|
|
|
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
|
@@ -129,8 +132,8 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
|
|
|
|
|
|
const revertMenuItemClickHandler = useCallback(() => {
|
|
|
const { _id: pageId, path } = pageData;
|
|
|
- openPutBackPageModal({ pageId, path });
|
|
|
- }, [openPutBackPageModal, pageData]);
|
|
|
+ openPutBackPageModal({ pageId, path }, { onPutBacked: onPagePutBacked });
|
|
|
+ }, [onPagePutBacked, openPutBackPageModal, pageData]);
|
|
|
|
|
|
const styleListGroupItem = (!isDeviceSmallerThanLg && onClickItem != null) ? 'list-group-item-action' : '';
|
|
|
// background color of list item changes when class "active" exists under 'list-group-item'
|