-
Notifications
You must be signed in to change notification settings - Fork 18
Feat/team-collaboration #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9d4d38c
feat: add activity logging and permission management utilities
JoachimLK cf90ba5
feat: implement settings layout with sidebar navigation and update pa…
JoachimLK 95f8722
feat: add error handling for creation failures in applications, candi…
JoachimLK 8a470bf
feat: centralize status transition rules for applications and jobs
JoachimLK fb02324
feat: enhance comment permissions to allow deletion for members and u…
JoachimLK e6851a8
feat: enhance settings and member management with error handling, sea…
JoachimLK 91b480d
feat: implement invitation management with email sending, resending, …
JoachimLK d08e1bd
feat: add schemas for invite links and join requests
JoachimLK 37cc33d
feat: implement invite link management with API integration for fetch…
JoachimLK 98add59
feat: add JobPipelineMini component for visualizing job application p…
JoachimLK 8d48fd7
refactor: redirect jobs view to main dashboard and update navigation …
JoachimLK 4bd4a70
feat: implement AppTopBar component and enhance layout with responsiv…
JoachimLK 6952bdf
feat: enhance styling and layout of candidate and pipeline components…
JoachimLK 7bb746b
feat: enhance candidate header with status indicators and improved la…
JoachimLK 656aa97
feat: implement scroll-to-section navigation for job detail tabs and …
JoachimLK a2dc75e
feat: enhance job detail page with sticky status transitions and impr…
JoachimLK 083886a
feat: update job creation and candidate application flows to redirect…
JoachimLK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| <script setup lang="ts"> | ||
| import { | ||
| Building2, Users, UserCircle, ChevronLeft, Settings, | ||
| } from 'lucide-vue-next' | ||
|
|
||
| const route = useRoute() | ||
| const localePath = useLocalePath() | ||
|
|
||
| const settingsNav = [ | ||
| { | ||
| label: 'General', | ||
| description: 'Organization profile', | ||
| to: '/dashboard/settings', | ||
| icon: Building2, | ||
| exact: true, | ||
| }, | ||
| { | ||
| label: 'Members', | ||
| description: 'Team & invitations', | ||
| to: '/dashboard/settings/members', | ||
| icon: Users, | ||
| exact: true, | ||
| }, | ||
| { | ||
| label: 'Account', | ||
| description: 'Profile & security', | ||
| to: '/dashboard/settings/account', | ||
| icon: UserCircle, | ||
| exact: true, | ||
| }, | ||
| ] | ||
|
|
||
| function isActive(to: string, exact: boolean) { | ||
| const localizedTo = localePath(to) | ||
| if (exact) return route.path === localizedTo | ||
| return route.path === localizedTo || route.path.startsWith(`${localizedTo}/`) | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <aside | ||
| class="flex h-full w-56 min-w-56 flex-col border-r border-surface-200 dark:border-surface-800 bg-white dark:bg-surface-900 overflow-y-auto" | ||
| > | ||
| <!-- Header --> | ||
| <div class="px-4 pt-5 pb-4"> | ||
| <NuxtLink | ||
| :to="$localePath('/dashboard')" | ||
| class="inline-flex items-center gap-1.5 text-xs font-medium text-surface-400 dark:text-surface-500 hover:text-surface-600 dark:hover:text-surface-300 transition-colors no-underline mb-3" | ||
| > | ||
| <ChevronLeft class="size-3.5" /> | ||
| Back to dashboard | ||
| </NuxtLink> | ||
| <div class="flex items-center gap-2.5"> | ||
| <div class="flex items-center justify-center size-8 rounded-lg bg-surface-100 dark:bg-surface-800 text-surface-500 dark:text-surface-400"> | ||
| <Settings class="size-4" /> | ||
| </div> | ||
| <h2 class="text-sm font-semibold text-surface-900 dark:text-surface-100"> | ||
| Settings | ||
| </h2> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Navigation --> | ||
| <nav class="flex-1 px-3 pb-5"> | ||
| <div class="flex flex-col gap-0.5"> | ||
| <NuxtLink | ||
| v-for="item in settingsNav" | ||
| :key="item.to" | ||
| :to="$localePath(item.to)" | ||
| class="group flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm transition-all no-underline" | ||
| :class="isActive(item.to, item.exact) | ||
| ? 'bg-brand-50 dark:bg-brand-950/40 text-brand-700 dark:text-brand-300 font-medium' | ||
| : 'text-surface-600 dark:text-surface-400 hover:bg-surface-50 dark:hover:bg-surface-800/60 hover:text-surface-900 dark:hover:text-surface-100'" | ||
| > | ||
| <div | ||
| class="flex items-center justify-center size-8 rounded-md transition-colors" | ||
| :class="isActive(item.to, item.exact) | ||
| ? 'bg-brand-100 dark:bg-brand-900/50 text-brand-600 dark:text-brand-400' | ||
| : 'bg-surface-100 dark:bg-surface-800 text-surface-400 dark:text-surface-500 group-hover:text-surface-600 dark:group-hover:text-surface-300'" | ||
| > | ||
| <component :is="item.icon" class="size-4" /> | ||
| </div> | ||
| <div class="min-w-0"> | ||
| <div class="truncate leading-tight">{{ item.label }}</div> | ||
| <div | ||
| class="text-[11px] leading-tight mt-0.5 truncate" | ||
| :class="isActive(item.to, item.exact) | ||
| ? 'text-brand-500/70 dark:text-brand-400/60' | ||
| : 'text-surface-400 dark:text-surface-500'" | ||
| > | ||
| {{ item.description }} | ||
| </div> | ||
| </div> | ||
| </NuxtLink> | ||
| </div> | ||
| </nav> | ||
| </aside> | ||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import type { statements } from '~~/shared/permissions' | ||
|
|
||
| /** | ||
| * Permission descriptor — same shape as the server-side PermissionRequest. | ||
| * Maps a resource to the actions being checked. | ||
| * | ||
| * Example: `{ job: ['create'] }` or `{ candidate: ['read', 'update'] }` | ||
| */ | ||
| type PermissionRequest = { | ||
| [K in keyof typeof statements]?: ReadonlyArray<(typeof statements)[K][number]> | ||
| } | ||
|
|
||
| /** | ||
| * ───────────────────────────────────────────── | ||
| * usePermission — client-side permission gating | ||
| * ───────────────────────────────────────────── | ||
| * | ||
| * Returns reactive `allowed` (boolean ref) indicating whether the | ||
| * current user's role satisfies the given permission set. | ||
| * | ||
| * Uses Better Auth's `checkRolePermission` which runs synchronously | ||
| * on the client against the AC config — no server roundtrip required. | ||
| * | ||
| * **Important:** client-side checks are cosmetic only. They control | ||
| * UI visibility (hide buttons, disable inputs). The real enforcement | ||
| * happens on the server via `requirePermission()`. | ||
| * | ||
| * Usage: | ||
| * ```vue | ||
| * <script setup> | ||
| * const { allowed: canCreateJob } = usePermission({ job: ['create'] }) | ||
| * </script> | ||
| * | ||
| * <template> | ||
| * <UButton v-if="canCreateJob" @click="createJob">New Job</UButton> | ||
| * </template> | ||
| * ``` | ||
| */ | ||
| export function usePermission(permissions: PermissionRequest) { | ||
| const role = ref<string | null>(null) | ||
|
|
||
| // Fetch the active member's role and re-fetch when org changes | ||
| const activeOrgState = authClient.useActiveOrganization() | ||
|
|
||
| async function fetchRole() { | ||
| const { data, error } = await authClient.organization.getActiveMemberRole() | ||
| if (!error) { | ||
| role.value = data?.role ?? null | ||
| } | ||
| } | ||
|
|
||
| // Fetch on mount and whenever the active org changes | ||
| watch( | ||
| () => activeOrgState.value.data?.id, | ||
| () => fetchRole(), | ||
| { immediate: true }, | ||
| ) | ||
|
|
||
| const allowed = computed(() => { | ||
| if (!role.value) return false | ||
|
|
||
| return authClient.organization.checkRolePermission({ | ||
| permissions: permissions as Record<string, string[]>, | ||
| role: role.value as 'owner' | 'admin' | 'member', | ||
| }) | ||
| }) | ||
|
|
||
| return { allowed, role: readonly(role) } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script setup lang="ts"> | ||
| definePageMeta({ | ||
| layout: 'dashboard', | ||
| middleware: ['auth', 'require-org'], | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="flex min-w-0 flex-1 -mx-6 -my-8"> | ||
| <div class="sticky -top-8 h-screen shrink-0"> | ||
| <SettingsSidebar /> | ||
| </div> | ||
| <div class="flex-1 min-w-0 px-8 py-8"> | ||
| <NuxtPage /> | ||
| </div> | ||
| </div> | ||
| </template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset and de-race role fetches on org changes.
Current logic can keep an old role on fetch failure and is vulnerable to out-of-order responses during fast org switches.
🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents