Compare commits

..

No commits in common. "4ce2603b4dec23fa33e3f909e1105efd16712aed" and "d09e93c317a1cf630f8cccc8380c3a5307f3fb05" have entirely different histories.

4 changed files with 169 additions and 30 deletions

View File

@ -359,7 +359,6 @@
"requiredLastName": true, "requiredLastName": true,
"requiredEmail": true, "requiredEmail": true,
"requiredExcelValidator": true, "requiredExcelValidator": true,
"requiredImageValidator": true, "requiredImageValidator": true
"requiredName": true
} }
} }

3
auto-imports.d.ts vendored
View File

@ -126,7 +126,6 @@ declare global {
const requiredFirstName: typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName'] const requiredFirstName: typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName']
const requiredImageValidator: typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator'] const requiredImageValidator: typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator']
const requiredLastName: typeof import('./resources/js/@core/utils/validators.js')['requiredLastName'] const requiredLastName: typeof import('./resources/js/@core/utils/validators.js')['requiredLastName']
const requiredName: typeof import('./resources/js/@core/utils/validators.js')['requiredName']
const requiredPhone: typeof import('./resources/js/@core/utils/validators.js')['requiredPhone'] const requiredPhone: typeof import('./resources/js/@core/utils/validators.js')['requiredPhone']
const requiredValidator: typeof import('./resources/js/@core/utils/validators.js')['requiredValidator'] const requiredValidator: typeof import('./resources/js/@core/utils/validators.js')['requiredValidator']
const resolveComponent: typeof import('vue')['resolveComponent'] const resolveComponent: typeof import('vue')['resolveComponent']
@ -488,7 +487,6 @@ declare module 'vue' {
readonly requiredFirstName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName']> readonly requiredFirstName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName']>
readonly requiredImageValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator']> readonly requiredImageValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator']>
readonly requiredLastName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredLastName']> readonly requiredLastName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredLastName']>
readonly requiredName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredName']>
readonly requiredPhone: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredPhone']> readonly requiredPhone: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredPhone']>
readonly requiredValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredValidator']> readonly requiredValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredValidator']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']> readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
@ -843,7 +841,6 @@ declare module '@vue/runtime-core' {
readonly requiredFirstName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName']> readonly requiredFirstName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredFirstName']>
readonly requiredImageValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator']> readonly requiredImageValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredImageValidator']>
readonly requiredLastName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredLastName']> readonly requiredLastName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredLastName']>
readonly requiredName: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredName']>
readonly requiredPhone: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredPhone']> readonly requiredPhone: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredPhone']>
readonly requiredValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredValidator']> readonly requiredValidator: UnwrapRef<typeof import('./resources/js/@core/utils/validators.js')['requiredValidator']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']> readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>

View File

@ -636,13 +636,12 @@ export default createStore({
async profileUpdate({ commit }, payload) { async profileUpdate({ commit }, payload) {
commit('setLoading', true) commit('setLoading', true)
await axios.post(PROFILE_UPDATE_API, { await axios.post(PROFILE_UPDATE_API, {
first_name: payload.name, name: payload.first_name,
last_name:payload.last_name, last_name:payload.last_name,
phone_no: payload.phone_no, phone: payload.phone,
image:payload.image image:payload.image
}, { }, {
headers: { headers: {
'Content-Type': 'multipart/form-data',
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`, 'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
} }
}) .then(response => { }) .then(response => {

View File

@ -15,14 +15,14 @@ const profileData = ref([]);
const errors = ref({ const errors = ref({
name: undefined, name: undefined,
email: undefined, email: undefined,
phone_no:undefined, phone:undefined,
}) })
const accountData = { const accountData = {
avatarImg: avatar1, avatarImg: avatar1,
name: '', name: '',
last_name: '', last_name: '',
email: '', email: '',
phone_no: '', phone: '',
} }
const refVForm = ref() const refVForm = ref()
@ -37,6 +37,18 @@ const resetForm = () => {
accountDataLocal.value = structuredClone(accountData) accountDataLocal.value = structuredClone(accountData)
} }
// const changeAvatar = file => {
// const fileReader = new FileReader()
// const { files } = file.target
// if (files && files.length) {
// fileReader.readAsDataURL(files[0])
// fileReader.onload = () => {
// if (typeof fileReader.result === 'string')
// accountDataLocal.value.avatarImg = fileReader.result
// console.log("daas",accountDataLocal.value.avatarImg);
// }
// }
// }
const changeAvatar = file => { const changeAvatar = file => {
const fileReader = new FileReader() const fileReader = new FileReader()
const { files } = file.target const { files } = file.target
@ -53,11 +65,16 @@ const changeAvatar = file => {
} }
onMounted(async () => { onMounted(async () => {
await store.dispatch('adminDetial'); await store.dispatch('adminDetial');
// profileData.value =
let list = await store.getters.getAdminDetail let list = await store.getters.getAdminDetail
accountDataLocal.value.email = list.email accountDataLocal.value.email = list.email
// accountData.name = profileData.value.name;
accountDataLocal.value.name = list.name accountDataLocal.value.name = list.name
// accountData.lastName = profileData.value.last_name;
accountDataLocal.value.lastName = list.last_name; accountDataLocal.value.lastName = list.last_name;
accountDataLocal.value.phone_no = list.phone_no // accountData.phone = profileData.value.phone_no;
accountDataLocal.value.phone = list.phone_no
// accountData.avatarImg = profileData.value.profile_image ? profileData.value.profile_image : avatar1;
if(!list.image_path){ if(!list.image_path){
accountDataLocal.value.avatarImg = avatar1; accountDataLocal.value.avatarImg = avatar1;
}else{ }else{
@ -137,19 +154,19 @@ const onSubmit = async () => {
await store.dispatch('profileUpdate',{ await store.dispatch('profileUpdate',{
name: accountDataLocal.value.name, name: accountDataLocal.value.name,
last_name: accountDataLocal.value.last_name, last_name: accountDataLocal.value.last_name,
phone_no: accountDataLocal.value.phone_no, phone: accountDataLocal.value.phone,
image: ImageBase64.value, //ecelData, image: ImageBase64.value, //ecelData,
}) })
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
await store.dispatch('adminDetial'); await store.dispatch('siteSetting');
let list = await store.getters.getAdminDetail let list = await store.getters.getSiteSetting
console.log('list',list) console.log('list',list)
accountDataLocal.value.avatarImg = list.image_path accountDataLocal.value.avatarImg = list.logo
accountDataLocal.value.name = list.name accountDataLocal.value.name = list.first_name
accountDataLocal.value.last_name = list.last_name accountDataLocal.value.last_name = list.last_name
accountDataLocal.value.phone_no = list.phone_no accountDataLocal.value.phone = list.phone
} }
} }
@ -157,23 +174,21 @@ console.log('list',list)
const formatPhoneNumber = () => { const formatPhoneNumber = () => {
// Remove non-numeric characters from the input // Remove non-numeric characters from the input
const numericValue = accountDataLocal.value.phone_no.replace(/\D/g, ''); const numericValue = accountDataLocal.value.phone.replace(/\D/g, '');
// Apply formatting logic // Apply formatting logic
if (numericValue.length <= 10) { if (numericValue.length <= 10) {
accountDataLocal.value.phone_no = numericValue.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3'); accountDataLocal.value.phone = numericValue.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3');
} else { } else {
// Limit the input to a maximum of 14 characters // Limit the input to a maximum of 14 characters
const truncatedValue = numericValue.slice(0, 10); const truncatedValue = numericValue.slice(0, 10);
accountDataLocal.value.phone_no = truncatedValue.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3'); accountDataLocal.value.phone = truncatedValue.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3');
} }
}; };
</script> </script>
<template> <template>
<VRow> <VRow>
<VCol cols="12"> <VCol cols="12">
<VCard> <VCard>
<VCardText> <VCardText>
@ -221,7 +236,7 @@ const formatPhoneNumber = () => {
</div> </div>
<!-- 👉 Form --> <!-- 👉 Form -->
<VForm ref="refVForm"> <VForm ref="refVForm" @submit.prevent="onSubmit">
<VRow> <VRow>
<!-- 👉 First Name --> <!-- 👉 First Name -->
<VCol <VCol
@ -242,7 +257,7 @@ const formatPhoneNumber = () => {
cols="12" cols="12"
> >
<VTextField <VTextField
v-model="accountDataLocal.last_name" v-model="accountDataLocal.lastName"
placeholder="Doe" placeholder="Doe"
label="Last Name" label="Last Name"
/> />
@ -264,7 +279,18 @@ const formatPhoneNumber = () => {
</VCol> </VCol>
<!-- 👉 Organization --> <!-- 👉 Organization -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VTextField
v-model="accountDataLocal.org"
label="Organization"
placeholder="ThemeSelection"
/>
</VCol>
<!-- 👉 Phone --> <!-- 👉 Phone -->
<VCol <VCol
@ -272,7 +298,7 @@ const formatPhoneNumber = () => {
md="6" md="6"
> >
<VTextField <VTextField
v-model="accountDataLocal.phone_no" v-model="accountDataLocal.phone"
label="Phone Number" label="Phone Number"
placeholder="+1 (917) 543-9876" placeholder="+1 (917) 543-9876"
:rules="[requiredPhone, validUSAPhone]" :rules="[requiredPhone, validUSAPhone]"
@ -283,21 +309,115 @@ const formatPhoneNumber = () => {
/> />
</VCol> </VCol>
<!-- 👉 Address -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VTextField
v-model="accountDataLocal.address"
label="Address"
placeholder="123 Main St, New York, NY 10001"
/>
</VCol>
<!-- 👉 State -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VTextField
v-model="accountDataLocal.state"
label="State"
placeholder="New York"
/>
</VCol>
<!-- 👉 Zip Code -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VTextField
v-model="accountDataLocal.zip"
label="Zip Code"
placeholder="10001"
/>
</VCol>
<!-- 👉 Country -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VSelect
v-model="accountDataLocal.country"
multiple
chips
closable-chips
label="Country"
:items="['USA', 'Canada', 'UK', 'India', 'Australia']"
placeholder="Select Country"
/>
</VCol>
<!-- 👉 Language -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VSelect
v-model="accountDataLocal.language"
label="Language"
multiple
chips
closable-chips
placeholder="Select Language"
:items="['English', 'Spanish', 'Arabic', 'Hindi', 'Urdu']"
/>
</VCol>
<!-- 👉 Timezone -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VSelect
v-model="accountDataLocal.timezone"
label="Timezone"
placeholder="Select Timezone"
:items="timezones"
:menu-props="{ maxHeight: 200 }"
/>
</VCol>
<!-- 👉 Currency -->
<VCol
cols="12"
md="6"
style="display: none;"
>
<VSelect
v-model="accountDataLocal.currency"
label="Currency"
placeholder="Select Currency"
:items="currencies"
:menu-props="{ maxHeight: 200 }"
/>
</VCol>
<!-- 👉 Form Actions --> <!-- 👉 Form Actions -->
<VCol <VCol
cols="12" cols="12"
class="d-flex flex-wrap gap-4" class="d-flex flex-wrap gap-4"
> >
<VBtn @click.prevent="onSubmit">Save changes</VBtn> <VBtn type="submit">Save changes</VBtn>
</VCol> </VCol>
</VRow> </VRow>
</VForm> </VForm>
@ -305,6 +425,30 @@ const formatPhoneNumber = () => {
</VCard> </VCard>
</VCol> </VCol>
<VCol cols="12" style="display: none;">
<!-- 👉 Delete Account -->
<VCard title="Delete Account">
<VCardText>
<!-- 👉 Checkbox and Button -->
<div>
<VCheckbox
v-model="isAccountDeactivated"
:rules="validateAccountDeactivation"
label="I confirm my account deactivation"
/>
</div>
<VBtn
:disabled="!isAccountDeactivated"
color="error"
class="mt-3"
@click="isConfirmDialogOpen = true"
>
Deactivate Account
</VBtn>
</VCardText>
</VCard>
</VCol>
</VRow> </VRow>
<!-- Confirm Dialog --> <!-- Confirm Dialog -->