diff --git a/components/common/Dropdown.tsx b/components/common/Dropdown.tsx
index 07c4562..a9c943d 100644
--- a/components/common/Dropdown.tsx
+++ b/components/common/Dropdown.tsx
@@ -43,11 +43,11 @@ export const Dropdown = ({
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
- {/* z-30 value is important because we want all dropdowns to draw over other elements in the page and besides mobile menu, z-30 is the highest z-index we use in this codebase */}
+ {/* z-50 value is important because we want all dropdowns to draw over other elements in the page and besides mobile menu, z-40 is the highest z-index we use in this codebase */}
{items.map((item) => (
diff --git a/components/shell/CommandPalette/Root.tsx b/components/shell/CommandPalette/Root.tsx
index 8b194e4..c7d0898 100644
--- a/components/shell/CommandPalette/Root.tsx
+++ b/components/shell/CommandPalette/Root.tsx
@@ -52,8 +52,8 @@ export const CommandPaletteRoot = ({
return (
- {/* z-40 value is important because we want the cmd palette to be able above all panels and currently, the highest z-index we use is z-40 */}
-
+ {/* z-50 value is important because we want the cmd palette to be able above all panels and currently, the highest z-index we use is z-50 */}
+ {
+ const {
+ mutateAsync,
+ isLoading,
+ headers,
+ filename,
+ setFilename,
+ selectedColumns,
+ setSelectedColumns,
+ } = useWorkspaceExport()
+
+ const canDownload = selectedColumns.length > 0 && !isLoading && !!filename
+
+ return (
+
+ {({ open, close }) => (
+ <>
+
+
+
+ {isLoading ? 'Exporting...' : 'Export'}
+
+
+
+
+ {/* Use the `Transition` component. */}
+
+
+
+ Note:{' '}
+
+ The exported file will only contain the selected columns.
+
+ When exporting from records (posts, profiles etc.) the
+ exported file will only contain the author account details
+ of the records.
+
+
@@ -64,7 +67,7 @@ const WorkspaceList: React.FC = ({
items={items}
listData={listData}
onRemoveItem={onRemoveItem}
- canExport={key === 'dids'}
+ canExport={canExport}
title={
GroupTitles[key] ||
`${key.charAt(0).toUpperCase()}${key.slice(1)}`
@@ -92,7 +95,6 @@ const ListGroup = ({
const checkboxesRef = useRef<(HTMLInputElement | null)[]>([])
const [detailShown, setDetailShown] = useState([])
const areAllDetailShown = items.every((item) => detailShown.includes(item))
- const exportMutation = useWorkspaceExportMutation()
// This ensures that when shift+clicking checkboxes, all checkboxes between the last interacted item are toggled
const handleChange = (
@@ -121,15 +123,7 @@ const ListGroup = ({
{canExport && (
- exportMutation.mutateAsync(items)}
- >
-
- {exportMutation.isLoading ? 'Exporting...' : 'Export'}
-
-
+
)}
(v: V): v is NonNullable {
- return v != null
-}
+import { isNonNullable } from '@/lib/util'
export function WorkspacePanel(props: PropsOf) {
const { onClose, ...others } = props
@@ -71,100 +69,103 @@ export function WorkspacePanel(props: PropsOf) {
}>({ isSubmitting: false, error: '' })
const labelerAgent = useLabelerAgent()
- const supportsCorrelation = useServerConfig().pds != null
- const handleFindCorrelation = supportsCorrelation
- ? async () => {
- const selectedItems = new FormData(formRef.current!)
- .getAll('workspaceItem')
- .filter((item): item is string => typeof item === 'string')
-
- // For every selected item, find out which DID it corresponds
- const dids = selectedItems
- .map((item) => {
- if (item.startsWith('did:')) return item
-
- const status = workspaceListStatuses?.[item]
-
- if (ToolsOzoneModerationDefs.isRepoViewDetail(status)) {
- return status.did
- }
-
- if (ToolsOzoneModerationDefs.isRecordViewDetail(status)) {
- return status.repo.did
- }
+ const { pds, role } = useServerConfig()
+ const handleFindCorrelation =
+ pds != null
+ ? async () => {
+ const selectedItems = new FormData(formRef.current!)
+ .getAll('workspaceItem')
+ .filter((item): item is string => typeof item === 'string')
+
+ // For every selected item, find out which DID it corresponds
+ const dids = selectedItems
+ .map((item) => {
+ if (item.startsWith('did:')) return item
+
+ const status = workspaceListStatuses?.[item]
+
+ if (ToolsOzoneModerationDefs.isRepoViewDetail(status)) {
+ return status.did
+ }
- if (ToolsOzoneModerationDefs.isSubjectStatusView(status)) {
- const { subject } = status
- if (ComAtprotoAdminDefs.isRepoRef(subject)) {
- return subject.did
+ if (ToolsOzoneModerationDefs.isRecordViewDetail(status)) {
+ return status.repo.did
}
- if (ComAtprotoRepoStrongRef.isMain(subject)) {
- return new AtUri(subject.uri).host
+ if (ToolsOzoneModerationDefs.isSubjectStatusView(status)) {
+ const { subject } = status
+ if (ComAtprotoAdminDefs.isRepoRef(subject)) {
+ return subject.did
+ }
+
+ if (ComAtprotoRepoStrongRef.isMain(subject)) {
+ return new AtUri(subject.uri).host
+ }
}
- }
- // Should never happen (future proofing against new item types in workspace)
- return undefined
- })
- .filter(isNonNullable)
+ // Should never happen (future proofing against new item types in workspace)
+ return undefined
+ })
+ .filter(isNonNullable)
- if (dids.length <= 1) {
- toast.warning('Please select at least two accounts to correlate.')
- return
- }
+ if (dids.length <= 1) {
+ toast.warning('Please select at least two accounts to correlate.')
+ return
+ }
- if (dids.length !== selectedItems.length) {
- toast.info('Only accounts can be correlated (ignoring non-accounts).')
- }
+ if (dids.length !== selectedItems.length) {
+ toast.info(
+ 'Only accounts can be correlated (ignoring non-accounts).',
+ )
+ }
- const res = await labelerAgent.tools.ozone.signature.findCorrelation({
- dids,
- })
-
- const { details } = res.data
-
- if (!details.length) {
- toast.info('No correlation found between the selected accounts.')
- } else {
- toast.success(
-
- The following correlation were found between the selected
- accounts:
-
- {details.map(({ property, value }) => (
-
-
-
- {property}
-
-
- ))}
- {details.length > 1 && (
- <>
-
+ const res = await labelerAgent.tools.ozone.signature.findCorrelation({
+ dids,
+ })
+
+ const { details } = res.data
+
+ if (!details.length) {
+ toast.info('No correlation found between the selected accounts.')
+ } else {
+ toast.success(
+
+ The following correlation were found between the selected
+ accounts:
+
+ {details.map(({ property, value }) => (
s.value)),
- )}`}
- className="text-blue-500 underline"
+ key={property}
+ href={`/repositories?term=sig:${encodeURIComponent(value)}`}
>
- Click here to show all accounts with the same details.
+
+
+ {property}
+
- >
- )}
-
,
- {
- autoClose: 10_000,
- },
- )
+ ))}
+ {details.length > 1 && (
+ <>
+
+ s.value)),
+ )}`}
+ className="text-blue-500 underline"
+ >
+ Click here to show all accounts with the same details.
+
+ >
+ )}
+