fix: Tweaks to share links management
This commit is contained in:
@@ -58,7 +58,12 @@ function Shares() {
|
||||
|
||||
React.useEffect(() => {
|
||||
// sort the resulting data by the original order from the server
|
||||
setData(sortBy(shares.orderedData, (item) => shareIds.indexOf(item.id)));
|
||||
setData(
|
||||
sortBy(
|
||||
shares.orderedData.filter((item) => shareIds.includes(item.id)),
|
||||
(item) => shareIds.indexOf(item.id)
|
||||
)
|
||||
);
|
||||
}, [shares.orderedData, shareIds]);
|
||||
|
||||
return (
|
||||
@@ -88,8 +93,6 @@ function Shares() {
|
||||
</Trans>
|
||||
</Text>
|
||||
|
||||
<h2>{t("Shared documents")}</h2>
|
||||
|
||||
<SharesTable
|
||||
data={data}
|
||||
canManage={can.manage}
|
||||
|
||||
@@ -4,6 +4,7 @@ import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTheme } from "styled-components";
|
||||
import Share from "~/models/Share";
|
||||
import Flex from "~/components/Flex";
|
||||
import TableFromParams from "~/components/TableFromParams";
|
||||
import Time from "~/components/Time";
|
||||
import ShareMenu from "~/menus/ShareMenu";
|
||||
@@ -56,7 +57,11 @@ function SharesTable({ canManage, ...rest }: Props) {
|
||||
Header: t("Shared nested"),
|
||||
accessor: "includeChildDocuments",
|
||||
Cell: observer(({ value }: { value: string }) =>
|
||||
value ? <CheckmarkIcon color={theme.primary} /> : null
|
||||
value ? (
|
||||
<Flex align="center">
|
||||
<CheckmarkIcon color={theme.primary} />
|
||||
</Flex>
|
||||
) : null
|
||||
),
|
||||
},
|
||||
canManage
|
||||
@@ -67,7 +72,9 @@ function SharesTable({ canManage, ...rest }: Props) {
|
||||
disableSortBy: true,
|
||||
Cell: observer(
|
||||
({ row }: { value: string; row: { original: Share } }) => (
|
||||
<ShareMenu share={row.original} />
|
||||
<Flex align="center">
|
||||
<ShareMenu share={row.original} />
|
||||
</Flex>
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user