fix: client file sharing access denied + task/project default tabs

- FileSharing: rootPath for clients strips /Clients/ prefix — API resolveClientPath expects /{company} not /Clients/{company}
- Tasks: default to To Do tab (not_started) instead of All Tasks
- Projects: default to Active tab instead of All Projects

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-06-01 20:35:13 -04:00
parent 986d831186
commit 958f451836
2 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -270,12 +270,16 @@ async function fbqProxy(op, path, extra = {}) {
throw new Error(`Unsupported operation: ${op}`);
}
function safeName(v) {
return String(v || '').trim().replace(/[\\/:*?"<>|#%{}^~[\]`]+/g, '-').replace(/\s+/g, ' ').replace(/^-+|-+$/g, '');
}
function rootPath(user) {
if (!user || user.role === 'team' || user.role === 'external') return '/';
const companies = user.companies?.filter(Boolean) ?? [];
if (companies.length > 1) return '/Clients';
if (companies.length > 1) return '/';
const name = companies[0]?.name ?? user.company?.name;
return name ? `/Clients/${name}` : '/';
return name ? `/${safeName(name)}` : '/';
}
function parsePath(path) {