fix
This commit is contained in:
parent
d43ee77617
commit
b08d37fbf0
2 changed files with 21 additions and 12 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Group, Center, Text, Badge, ActionIcon, Tooltip } from "@mantine/core";
|
import {
|
||||||
|
Group,
|
||||||
|
Center,
|
||||||
|
Text,
|
||||||
|
Badge,
|
||||||
|
ActionIcon,
|
||||||
|
Tooltip,
|
||||||
|
getDefaultZIndex,
|
||||||
|
} from "@mantine/core";
|
||||||
import { Spotlight } from "@mantine/spotlight";
|
import { Spotlight } from "@mantine/spotlight";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { IconFile, IconDownload } from "@tabler/icons-react";
|
import { IconFile, IconDownload } from "@tabler/icons-react";
|
||||||
|
|
@ -48,7 +56,7 @@ export function SearchResultItem({
|
||||||
>
|
>
|
||||||
<Group wrap="nowrap" w="100%">
|
<Group wrap="nowrap" w="100%">
|
||||||
<Center>
|
<Center>
|
||||||
<IconFile size={20} />
|
<IconFile size={16} />
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<div style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
|
|
@ -64,19 +72,19 @@ export function SearchResultItem({
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: DOMPurify.sanitize(attachmentResult.highlight, {
|
__html: DOMPurify.sanitize(attachmentResult.highlight, {
|
||||||
ALLOWED_TAGS: ["mark", "em", "strong", "b"],
|
ALLOWED_TAGS: ["mark", "em", "strong", "b"],
|
||||||
ALLOWED_ATTR: []
|
ALLOWED_ATTR: [],
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Tooltip label={t("Download attachment")} withArrow>
|
<Tooltip
|
||||||
<ActionIcon
|
label={t("Download attachment")}
|
||||||
variant="subtle"
|
zIndex={getDefaultZIndex("max")}
|
||||||
color="gray"
|
withArrow
|
||||||
onClick={handleDownload}
|
>
|
||||||
>
|
<ActionIcon variant="subtle" color="gray" onClick={handleDownload}>
|
||||||
<IconDownload size={18} />
|
<IconDownload size={18} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
@ -115,7 +123,7 @@ export function SearchResultItem({
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: DOMPurify.sanitize(pageResult.highlight, {
|
__html: DOMPurify.sanitize(pageResult.highlight, {
|
||||||
ALLOWED_TAGS: ["mark", "em", "strong", "b"],
|
ALLOWED_TAGS: ["mark", "em", "strong", "b"],
|
||||||
ALLOWED_ATTR: []
|
ALLOWED_ATTR: [],
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import { useDebouncedValue } from "@mantine/hooks";
|
||||||
import { useGetSpacesQuery } from "@/features/space/queries/space-query";
|
import { useGetSpacesQuery } from "@/features/space/queries/space-query";
|
||||||
import { useLicense } from "@/ee/hooks/use-license";
|
import { useLicense } from "@/ee/hooks/use-license";
|
||||||
import classes from "./search-spotlight-filters.module.css";
|
import classes from "./search-spotlight-filters.module.css";
|
||||||
|
import { isCloud } from "@/lib/config.ts";
|
||||||
|
|
||||||
interface SearchSpotlightFiltersProps {
|
interface SearchSpotlightFiltersProps {
|
||||||
onFiltersChange?: (filters: any) => void;
|
onFiltersChange?: (filters: any) => void;
|
||||||
|
|
@ -79,7 +80,7 @@ export function SearchSpotlightFilters({
|
||||||
{
|
{
|
||||||
value: "attachment",
|
value: "attachment",
|
||||||
label: t("Attachments"),
|
label: t("Attachments"),
|
||||||
disabled: !hasLicenseKey,
|
disabled: !isCloud() && !hasLicenseKey,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue