refactor(tasks): simplify create task list modal by removing share dropdown
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 57s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 57s
This commit is contained in:
1 parent
634fdcac11
commit
e389c7bebc
1 file changed
+1
-44
@@ -78,7 +78,6 @@ export const TasksView: React.FC<TasksViewProps> = ({
|
|||||||
const [showNewListModal, setShowNewListModal] = useState(false);
|
const [showNewListModal, setShowNewListModal] = useState(false);
|
||||||
const [newListTitle, setNewListTitle] = useState('');
|
const [newListTitle, setNewListTitle] = useState('');
|
||||||
const [newListIcon, setNewListIcon] = useState('📋');
|
const [newListIcon, setNewListIcon] = useState('📋');
|
||||||
const [newListShareTarget, setNewListShareTarget] = useState('');
|
|
||||||
|
|
||||||
// Share TaskList modal state
|
// Share TaskList modal state
|
||||||
const [showShareListModal, setShowShareListModal] = useState(false);
|
const [showShareListModal, setShowShareListModal] = useState(false);
|
||||||
@@ -699,27 +698,16 @@ export const TasksView: React.FC<TasksViewProps> = ({
|
|||||||
const title = newListTitle.trim();
|
const title = newListTitle.trim();
|
||||||
if (!title) return;
|
if (!title) return;
|
||||||
try {
|
try {
|
||||||
let teamId: string | undefined = undefined;
|
|
||||||
let userId: string | undefined = undefined;
|
|
||||||
if (newListShareTarget.startsWith('team:')) {
|
|
||||||
teamId = newListShareTarget.replace('team:', '');
|
|
||||||
} else if (newListShareTarget.startsWith('user:')) {
|
|
||||||
userId = newListShareTarget.replace('user:', '');
|
|
||||||
}
|
|
||||||
const created = await api.createTaskList({
|
const created = await api.createTaskList({
|
||||||
title,
|
title,
|
||||||
icon: newListIcon,
|
icon: newListIcon,
|
||||||
teamId: teamId,
|
|
||||||
});
|
});
|
||||||
if (userId && created?.id) {
|
|
||||||
await api.addTaskListShare(created.id, { targetType: 'user', targetId: userId });
|
|
||||||
}
|
|
||||||
const freshLists = await api.getTaskLists();
|
const freshLists = await api.getTaskLists();
|
||||||
setTaskLists(freshLists);
|
setTaskLists(freshLists);
|
||||||
setSelectedListId(created.id);
|
setSelectedListId(created.id);
|
||||||
setShowNewListModal(false);
|
setShowNewListModal(false);
|
||||||
setNewListTitle('');
|
setNewListTitle('');
|
||||||
setNewListShareTarget('');
|
setNewListIcon('📋');
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
alert(err.message || 'Fehler beim Erstellen der Aufgabenliste');
|
alert(err.message || 'Fehler beim Erstellen der Aufgabenliste');
|
||||||
}
|
}
|
||||||
@@ -1374,37 +1362,6 @@ export const TasksView: React.FC<TasksViewProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs text-muted mb-1">
|
|
||||||
Freigabe (optional)
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
value={newListShareTarget}
|
|
||||||
onChange={(e) => setNewListShareTarget(e.target.value)}
|
|
||||||
className="w-full h-8 input-field px-2 text-xs"
|
|
||||||
>
|
|
||||||
<option value="">🔒 Privat (nur für mich)</option>
|
|
||||||
{safeTeams.length > 0 && (
|
|
||||||
<optgroup label="Teams & Gruppen">
|
|
||||||
{safeTeams.map((tm) => (
|
|
||||||
<option key={tm.id} value={`team:${tm.id}`}>
|
|
||||||
👥 {tm.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</optgroup>
|
|
||||||
)}
|
|
||||||
{safeCollaborators.length > 0 && (
|
|
||||||
<optgroup label="Einzelne Benutzer">
|
|
||||||
{safeCollaborators.map((u) => (
|
|
||||||
<option key={u.id} value={`user:${u.id}`}>
|
|
||||||
👤 {u.displayName || u.email}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</optgroup>
|
|
||||||
)}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center justify-end gap-2 pt-2 border-t border-border">
|
<div className="flex items-center justify-end gap-2 pt-2 border-t border-border">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
Reference in new issue
Block a user