mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-17 22:35:19 +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.
125 lines
3.8 KiB
Vue
125 lines
3.8 KiB
Vue
<template>
|
|
<div class="pt-6 mt-5 border-t border-solid lg:pt-8 md:pt-4 border-line-default">
|
|
<!-- Basic Info -->
|
|
<BaseHeading>
|
|
{{ $t('customers.basic_info') }}
|
|
</BaseHeading>
|
|
|
|
<BaseDescriptionList>
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.name"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.display_name')"
|
|
:value="selectedViewCustomer?.name"
|
|
/>
|
|
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.contact_name"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.primary_contact_name')"
|
|
:value="selectedViewCustomer?.contact_name"
|
|
/>
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.email"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.email')"
|
|
:value="selectedViewCustomer?.email"
|
|
/>
|
|
</BaseDescriptionList>
|
|
|
|
<BaseDescriptionList class="mt-5">
|
|
<BaseDescriptionListItem
|
|
:content-loading="contentLoading"
|
|
:label="$t('wizard.currency')"
|
|
:value="
|
|
selectedViewCustomer?.currency
|
|
? `${selectedViewCustomer?.currency?.code} (${selectedViewCustomer?.currency?.symbol})`
|
|
: ''
|
|
"
|
|
/>
|
|
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.phone"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.phone_number')"
|
|
:value="selectedViewCustomer?.phone"
|
|
/>
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.website"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.website')"
|
|
:value="selectedViewCustomer?.website"
|
|
/>
|
|
</BaseDescriptionList>
|
|
|
|
<!-- Address -->
|
|
<BaseHeading
|
|
v-if="selectedViewCustomer.billing || selectedViewCustomer.shipping"
|
|
class="mt-8"
|
|
>
|
|
{{ $t('customers.address') }}
|
|
</BaseHeading>
|
|
|
|
<BaseDescriptionList class="mt-5">
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.billing"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.billing_address')"
|
|
>
|
|
<BaseCustomerAddressDisplay :address="selectedViewCustomer.billing" />
|
|
</BaseDescriptionListItem>
|
|
|
|
<BaseDescriptionListItem
|
|
v-if="selectedViewCustomer.shipping"
|
|
:content-loading="contentLoading"
|
|
:label="$t('customers.shipping_address')"
|
|
>
|
|
<BaseCustomerAddressDisplay :address="selectedViewCustomer.shipping" />
|
|
</BaseDescriptionListItem>
|
|
</BaseDescriptionList>
|
|
|
|
<!-- Custom Fields -->
|
|
<BaseHeading v-if="customerCustomFields.length > 0" class="mt-8">
|
|
{{ $t('settings.custom_fields.title') }}
|
|
</BaseHeading>
|
|
|
|
<BaseDescriptionList class="mt-5">
|
|
<BaseDescriptionListItem
|
|
v-for="(field, index) in customerCustomFields"
|
|
:key="index"
|
|
:content-loading="contentLoading"
|
|
:label="field.custom_field.label"
|
|
>
|
|
<p
|
|
v-if="field.type === 'Switch'"
|
|
class="text-sm font-bold leading-5 text-heading non-italic"
|
|
>
|
|
<span v-if="field.default_answer === 1"> {{ $t('general.yes') }} </span>
|
|
<span v-else> {{ $t('general.no') }} </span>
|
|
</p>
|
|
<p v-else class="text-sm font-bold leading-5 text-heading non-italic">
|
|
{{ field.default_answer }}
|
|
</p>
|
|
</BaseDescriptionListItem>
|
|
</BaseDescriptionList>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useCustomerStore } from '../store'
|
|
|
|
const customerStore = useCustomerStore()
|
|
|
|
const selectedViewCustomer = computed(() => customerStore.selectedViewCustomer)
|
|
|
|
const contentLoading = computed(() => customerStore.isFetchingViewData)
|
|
|
|
const customerCustomFields = computed(() => {
|
|
if (selectedViewCustomer?.value?.fields) {
|
|
return selectedViewCustomer?.value?.fields
|
|
}
|
|
return []
|
|
})
|
|
</script>
|