feat: add functionality to toggle inbox document source between personal and public scopes
Build and Push Multi-Platform Images / build-and-push (push) Successful in 34s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 34s
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
ReloadOutlined,
|
||||
ScanOutlined,
|
||||
SearchOutlined,
|
||||
TeamOutlined,
|
||||
UserOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
@@ -168,6 +169,19 @@ export default function InboxPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleUpdateSource = async (id: string, current: InboxFile['source']) => {
|
||||
const next = current === 'all' ? 'user' : 'all';
|
||||
try {
|
||||
await inboxApi.updateSource(id, next);
|
||||
message.success(
|
||||
next === 'all' ? 'Zu Öffentlich verschoben' : 'Zu Persönlich verschoben',
|
||||
);
|
||||
await load();
|
||||
} catch {
|
||||
message.error('Verschieben fehlgeschlagen');
|
||||
}
|
||||
};
|
||||
|
||||
const filtered = files.filter((f) =>
|
||||
search ? f.name.toLowerCase().includes(search.toLowerCase()) : true,
|
||||
);
|
||||
@@ -255,6 +269,21 @@ export default function InboxPage() {
|
||||
Löschen
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Tooltip
|
||||
title={
|
||||
record.source === 'all'
|
||||
? 'In meinen persönlichen Scan-Ordner verschieben'
|
||||
: 'In den gemeinsamen Ordner (Öffentlich) verschieben'
|
||||
}
|
||||
>
|
||||
<Button
|
||||
type="link"
|
||||
icon={record.source === 'all' ? <UserOutlined /> : <TeamOutlined />}
|
||||
onClick={() => handleUpdateSource(record.id, record.source)}
|
||||
>
|
||||
{record.source === 'all' ? 'Zu Persönlich' : 'Zu Öffentlich'}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user