Apply linting fixes and update schema
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,5 @@ export {
|
||||
OrgSwitcher,
|
||||
UserMenu,
|
||||
} from "./dashboard/index.js";
|
||||
|
||||
// Settings layout components
|
||||
export { SettingsLayout } from "./settings/index.js";
|
||||
|
||||
@@ -206,9 +206,15 @@ function formatRelativeTime(date: Date): string {
|
||||
const diff = date.getTime() - now.getTime();
|
||||
const days = Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (days < 0) return "Expired";
|
||||
if (days === 0) return "Today";
|
||||
if (days === 1) return "Tomorrow";
|
||||
if (days < 0) {
|
||||
return "Expired";
|
||||
}
|
||||
if (days === 0) {
|
||||
return "Today";
|
||||
}
|
||||
if (days === 1) {
|
||||
return "Tomorrow";
|
||||
}
|
||||
return `${days} days`;
|
||||
}
|
||||
|
||||
@@ -216,9 +222,15 @@ function formatRelativeTime(date: Date): string {
|
||||
* Check if user can remove a member
|
||||
*/
|
||||
function canRemoveMember(memberRole: string, memberId: number): boolean {
|
||||
if (memberId === currentUserId) return false;
|
||||
if (isOwner) return true;
|
||||
if (currentUserRole === "admin" && memberRole === "member") return true;
|
||||
if (memberId === currentUserId) {
|
||||
return false;
|
||||
}
|
||||
if (isOwner) {
|
||||
return true;
|
||||
}
|
||||
if (currentUserRole === "admin" && memberRole === "member") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -226,8 +238,12 @@ function canRemoveMember(memberRole: string, memberId: number): boolean {
|
||||
* Get available roles for invite based on current user's role
|
||||
*/
|
||||
const availableInviteRoles = $derived.by(() => {
|
||||
if (isOwner) return ["member", "admin", "owner"] as const;
|
||||
if (currentUserRole === "admin") return ["member", "admin"] as const;
|
||||
if (isOwner) {
|
||||
return ["member", "admin", "owner"] as const;
|
||||
}
|
||||
if (currentUserRole === "admin") {
|
||||
return ["member", "admin"] as const;
|
||||
}
|
||||
return ["member"] as const;
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
\restrict CIj4ub2A9kD8NQM2nKa1cg31hNutT3jXdOch0DnJ2bT48qpQKbe9XxNtViPwfYR
|
||||
\restrict F9AizESreuRieL4inRcHWWg3hyNET0FgnBDFBBBU3cZGPEpHjb591l8S2iglpap
|
||||
|
||||
-- Dumped from database version 17.7
|
||||
-- Dumped by pg_dump version 17.7
|
||||
@@ -1084,7 +1084,7 @@ ALTER TABLE ONLY public.user_devices
|
||||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
||||
\unrestrict CIj4ub2A9kD8NQM2nKa1cg31hNutT3jXdOch0DnJ2bT48qpQKbe9XxNtViPwfYR
|
||||
\unrestrict F9AizESreuRieL4inRcHWWg3hyNET0FgnBDFBBBU3cZGPEpHjb591l8S2iglpap
|
||||
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user