fix: added update your password step in onboarding
(cherry picked from commit dd1db8f78249f1d06889387b67e6d38c7acae208)
This commit is contained in:
parent
3ea056d3df
commit
8b3cac75fb
1
frontend/components.d.ts
vendored
1
frontend/components.d.ts
vendored
@ -208,6 +208,7 @@ declare module 'vue' {
|
||||
SmileIcon: typeof import('./src/components/Icons/SmileIcon.vue')['default']
|
||||
SortBy: typeof import('./src/components/SortBy.vue')['default']
|
||||
SortIcon: typeof import('./src/components/Icons/SortIcon.vue')['default']
|
||||
SquareAsterisk: typeof import('./src/components/Icons/SquareAsterisk.vue')['default']
|
||||
StepsIcon: typeof import('./src/components/Icons/StepsIcon.vue')['default']
|
||||
SuccessIcon: typeof import('./src/components/Icons/SuccessIcon.vue')['default']
|
||||
TableMultiselectInput: typeof import('./src/components/Controls/TableMultiselectInput.vue')['default']
|
||||
|
||||
19
frontend/src/components/Icons/SquareAsterisk.vue
Normal file
19
frontend/src/components/Icons/SquareAsterisk.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="lucide lucide-square-asterisk-icon lucide-square-asterisk"
|
||||
>
|
||||
<rect width="18" height="18" x="3" y="3" rx="2" />
|
||||
<path d="M12 8v8" />
|
||||
<path d="m8.5 14 7-4" />
|
||||
<path d="m8.5 10 7 4" />
|
||||
</svg>
|
||||
</template>
|
||||
@ -150,6 +150,7 @@ import Section from '@/components/Section.vue'
|
||||
import Email2Icon from '@/components/Icons/Email2Icon.vue'
|
||||
import PinIcon from '@/components/Icons/PinIcon.vue'
|
||||
import UserDropdown from '@/components/UserDropdown.vue'
|
||||
import SquareAsterisk from '@/components/Icons/SquareAsterisk.vue'
|
||||
import LeadsIcon from '@/components/Icons/LeadsIcon.vue'
|
||||
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
||||
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
||||
@ -321,6 +322,17 @@ const showIntermediateModal = ref(false)
|
||||
const currentStep = ref({})
|
||||
|
||||
const steps = reactive([
|
||||
{
|
||||
name: 'setup_your_password',
|
||||
title: __('Setup your password'),
|
||||
icon: markRaw(SquareAsterisk),
|
||||
completed: false,
|
||||
onClick: () => {
|
||||
minimize.value = true
|
||||
showSettings.value = true
|
||||
activeSettingsPage.value = 'Profile'
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'create_first_lead',
|
||||
title: __('Create your first lead'),
|
||||
|
||||
@ -80,11 +80,12 @@
|
||||
import Password from '@/components/Controls/Password.vue'
|
||||
import ProfileImageEditor from '@/components/Settings/ProfileImageEditor.vue'
|
||||
import { usersStore } from '@/stores/users'
|
||||
import { createToast } from '@/utils'
|
||||
import { Dialog, Avatar, createResource, ErrorMessage } from 'frappe-ui'
|
||||
import { Dialog, Avatar, createResource, ErrorMessage, toast } from 'frappe-ui'
|
||||
import { useOnboarding } from 'frappe-ui/frappe'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
||||
const { getUser, users } = usersStore()
|
||||
const { updateOnboardingStep } = useOnboarding('frappecrm')
|
||||
|
||||
const user = computed(() => getUser() || {})
|
||||
|
||||
@ -96,6 +97,13 @@ const error = ref('')
|
||||
|
||||
function updateUser() {
|
||||
loading.value = true
|
||||
|
||||
let passwordUpdated = false
|
||||
|
||||
if (profile.value.new_password) {
|
||||
passwordUpdated = true
|
||||
}
|
||||
|
||||
const fieldname = {
|
||||
first_name: profile.value.first_name,
|
||||
last_name: profile.value.last_name,
|
||||
@ -112,6 +120,9 @@ function updateUser() {
|
||||
},
|
||||
auto: true,
|
||||
onSuccess: () => {
|
||||
if (passwordUpdated) {
|
||||
updateOnboardingStep('setup_your_password')
|
||||
}
|
||||
loading.value = false
|
||||
error.value = ''
|
||||
profile.value.new_password = ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user