mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 17:24:10 +00:00
Now that the legacy v1 frontend (commit 064bdf53) is gone, the v2 directory is the only frontend and the v2 suffix is just noise. Renames resources/scripts-v2 to resources/scripts via git mv (so git records the move as renames, preserving blame and log --follow), then bulk-rewrites the 152 files that imported via @v2/... to use @/scripts/... instead. The existing @ alias (resources/) covers the new path with no extra config needed.
Drops the now-unused @v2 alias from vite.config.js and points the laravel-vite-plugin entry at resources/scripts/main.ts. Updates the only blade reference (resources/views/app.blade.php) to match. The package.json test script (eslint ./resources/scripts) automatically targets the right place after the rename without any edit.
Verified: npm run build exits clean and the Vite warning lines now reference resources/scripts/plugins/i18n.ts, confirming every import resolved through the new path. git log --follow on any moved file walks back through its scripts-v2 history.
100 lines
2.5 KiB
Vue
100 lines
2.5 KiB
Vue
<template>
|
|
<BaseWizardStep
|
|
:title="$t('wizard.permissions.permissions')"
|
|
:description="$t('wizard.permissions.permission_desc')"
|
|
>
|
|
<!-- Placeholders -->
|
|
<BaseContentPlaceholders v-if="isFetchingInitialData">
|
|
<div
|
|
v-for="n in 3"
|
|
:key="n"
|
|
class="grid grid-flow-row grid-cols-3 lg:gap-24 sm:gap-4 border border-line-default"
|
|
>
|
|
<BaseContentPlaceholdersText :lines="1" class="col-span-4 p-3" />
|
|
</div>
|
|
<BaseContentPlaceholdersBox
|
|
:rounded="true"
|
|
class="mt-10"
|
|
style="width: 96px; height: 42px"
|
|
/>
|
|
</BaseContentPlaceholders>
|
|
|
|
<div v-else class="relative">
|
|
<div
|
|
v-for="(permission, index) in permissions"
|
|
:key="index"
|
|
class="border border-line-default"
|
|
>
|
|
<div class="grid grid-flow-row grid-cols-3 lg:gap-24 sm:gap-4">
|
|
<div class="col-span-2 p-3">{{ permission.folder }}</div>
|
|
<div class="p-3 text-right">
|
|
<span
|
|
v-if="permission.isSet"
|
|
class="inline-block w-4 h-4 ml-3 mr-2 rounded-full bg-green-500"
|
|
/>
|
|
<span
|
|
v-else
|
|
class="inline-block w-4 h-4 ml-3 mr-2 rounded-full bg-red-500"
|
|
/>
|
|
<span>{{ permission.permission }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<BaseButton
|
|
v-show="!isFetchingInitialData"
|
|
class="mt-10"
|
|
:loading="isSaving"
|
|
:disabled="isSaving"
|
|
@click="next"
|
|
>
|
|
<template #left="slotProps">
|
|
<BaseIcon name="ArrowRightIcon" :class="slotProps.class" />
|
|
</template>
|
|
{{ $t('wizard.continue') }}
|
|
</BaseButton>
|
|
</div>
|
|
</BaseWizardStep>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, onMounted } from 'vue'
|
|
import { client } from '../../../api/client'
|
|
|
|
interface Permission {
|
|
folder: string
|
|
permission: string
|
|
isSet: boolean
|
|
}
|
|
|
|
interface Emits {
|
|
(e: 'next'): void
|
|
}
|
|
|
|
const emit = defineEmits<Emits>()
|
|
|
|
const isFetchingInitialData = ref<boolean>(false)
|
|
const isSaving = ref<boolean>(false)
|
|
const permissions = ref<Permission[]>([])
|
|
|
|
onMounted(() => {
|
|
getPermissions()
|
|
})
|
|
|
|
async function getPermissions(): Promise<void> {
|
|
isFetchingInitialData.value = true
|
|
try {
|
|
const { data } = await client.get('/api/v1/installation/permissions')
|
|
permissions.value = data.permissions?.permissions ?? []
|
|
} finally {
|
|
isFetchingInitialData.value = false
|
|
}
|
|
}
|
|
|
|
function next(): void {
|
|
isSaving.value = true
|
|
emit('next')
|
|
isSaving.value = false
|
|
}
|
|
</script>
|