@@ -6,7 +6,9 @@ const props = defineProps<{
6
6
variables: Variable []
7
7
}>()
8
8
9
- const selectedVariables = defineModel <Variable []>({ required: true })
9
+ const route = useRoute ()
10
+ const projectId = route .params .projectId as string
11
+ const selectedVariables = useSelectedVariables (projectId )
10
12
11
13
const { deleteVariables } = useVariablesService ()
12
14
@@ -46,40 +48,38 @@ function openDeleteModal() {
46
48
</script >
47
49
48
50
<template >
49
- <div >
50
- <Transition name =" bezier" mode =" out-in" >
51
- <div v-if =" selectedVariables.length > 0" class =" absolute bottom-4 left-1/2 z-20 -translate-x-1/2" >
52
- <div class =" dark flex items-center text-(--ui-text-highlighted) gap-4 rounded-md border px-5 py-1.5 border-(--ui-border) bg-(--ui-bg) shadow-lg" >
53
- <span class =" text-nowrap text-sm font-semibold" >
54
- {{ selectedVariables.length }} variable{{ selectedVariables.length > 1 ? 's' : '' }} selected
55
- </span >
56
- <div class =" flex gap-2" >
57
- <VariableGithubSync :selected-variables />
58
- <UPopover mode =" hover" arrow >
59
- <UButton icon =" lucide:clipboard-plus" variant =" ghost" />
60
- <template #content >
61
- <UCard >
62
- <div class =" flex flex-col gap-2" >
63
- <UTooltip v-for =" env in teamEnv" :key =" env.id" :text =" `Copy variables for ${env.name}`" :content =" { side: 'right' }" >
64
- <UButton :disabled =" loading" :label =" capitalize(env.name)" variant =" soft" @click =" copyEnv(selectedVariables, env.id)" />
65
- </UTooltip >
66
- </div >
67
- </UCard >
68
- </template >
69
- </UPopover >
70
- <UTooltip text =" Select all visible variables" >
71
- <UButton variant =" ghost" icon =" lucide:text-select" @click =" selectAllVisible" />
72
- </UTooltip >
73
- <UTooltip text =" Clear selection" >
74
- <UButton variant =" ghost" icon =" lucide:x" @click =" selectedVariables = []" />
75
- </UTooltip >
76
- <USeparator orientation =" vertical" class =" h-auto" />
77
- <UTooltip text =" Delete selected variables" >
78
- <UButton color =" error" variant =" ghost" icon =" heroicons:trash" :loading @click =" openDeleteModal" />
79
- </UTooltip >
80
- </div >
51
+ <Transition name =" bezier" mode =" out-in" >
52
+ <div v-if =" selectedVariables.length > 0" class =" absolute bottom-4 left-1/2 z-20 -translate-x-1/2" >
53
+ <div class =" dark flex items-center text-(--ui-text-highlighted) gap-4 rounded-md border px-5 py-1.5 border-(--ui-border) bg-(--ui-bg) shadow-lg" >
54
+ <span class =" text-nowrap text-sm font-semibold" >
55
+ {{ selectedVariables.length }} variable{{ selectedVariables.length > 1 ? 's' : '' }} selected
56
+ </span >
57
+ <div class =" flex gap-2" >
58
+ <VariableGithubSync :selected-variables />
59
+ <UPopover mode =" hover" arrow >
60
+ <UButton icon =" lucide:clipboard-plus" variant =" ghost" />
61
+ <template #content >
62
+ <UCard >
63
+ <div class =" flex flex-col gap-2" >
64
+ <UTooltip v-for =" env in teamEnv" :key =" env.id" :text =" `Copy variables for ${env.name}`" :content =" { side: 'right' }" >
65
+ <UButton :disabled =" loading" :label =" capitalize(env.name)" variant =" soft" @click =" copyEnv(selectedVariables, env.id)" />
66
+ </UTooltip >
67
+ </div >
68
+ </UCard >
69
+ </template >
70
+ </UPopover >
71
+ <UTooltip text =" Select all visible variables" >
72
+ <UButton variant =" ghost" icon =" lucide:text-select" @click =" selectAllVisible" />
73
+ </UTooltip >
74
+ <UTooltip text =" Clear selection" >
75
+ <UButton variant =" ghost" icon =" lucide:x" @click =" selectedVariables = []" />
76
+ </UTooltip >
77
+ <USeparator orientation =" vertical" class =" h-auto" />
78
+ <UTooltip text =" Delete selected variables" >
79
+ <UButton color =" error" variant =" ghost" icon =" heroicons:trash" :loading @click =" openDeleteModal" />
80
+ </UTooltip >
81
81
</div >
82
82
</div >
83
- </Transition >
84
- </div >
83
+ </div >
84
+ </Transition >
85
85
</template >
0 commit comments