fix: misc ui issues

(cherry picked from commit 8f4bd7afaf)
This commit is contained in:
Jannat Patel
2026-03-19 15:38:31 +05:30
committed by Mergify
parent 9d71915b7d
commit 6f0c695856
5 changed files with 31 additions and 27 deletions

View File

@@ -29,14 +29,12 @@
:label="__('Date')"
:required="true"
/>
<Tooltip :text="__('Duration of the live class in minutes')">
<FormControl
type="number"
v-model="liveClass.duration"
:label="__('Duration')"
:required="true"
/>
</Tooltip>
<FormControl
type="number"
v-model="liveClass.duration"
:label="__('Duration (in minutes)')"
:required="true"
/>
</div>
<div class="space-y-4">
<Tooltip
@@ -186,6 +184,7 @@ const submitLiveClass = (close) => {
},
onError(err) {
toast.error(err.messages?.[0] || err)
console.error(err)
},
})
}

View File

@@ -64,13 +64,13 @@
</template>
</Dropdown>
</div>
<div class="flex items-center mb-3">
<div class="flex items-center mb-2">
<Calendar class="w-4 h-4 stroke-1.5" />
<span class="ml-2">
{{ dayjs(evl.date).format('DD MMMM YYYY') }}
</span>
</div>
<div class="flex items-center mb-3">
<div class="flex items-center mb-2">
<Clock class="w-4 h-4 stroke-1.5" />
<span class="ml-2">
{{ formatTime(evl.start_time) }}

View File

@@ -419,9 +419,16 @@ watch(
() => batchDetail.doc,
() => {
if (!batchDetail.doc) return
getMetaInfo('batches', batchDetail.doc?.name, meta)
if (originalDoc.value) {
isDirty.value =
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
}
updateBatchData()
}
getMetaInfo('batches', batchDetail.doc?.name, meta)
},
{ deep: true }
)
const updateBatchData = () => {
@@ -499,17 +506,6 @@ const updateBatch = () => {
)
}
watch(
() => batchDetail.doc,
() => {
if (originalDoc.value) {
isDirty.value =
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
}
},
{ deep: true }
)
const deleteBatch = () => {
$dialog({
title: __('Confirm your action to delete'),

View File

@@ -180,10 +180,12 @@ const onInstructorCreated = (user: any) => {
const validateFields = () => {
batch.value.description = sanitizeHTML(batch.value.description)
batch.value.batch_details = sanitizeHTML(batch.value.batch_details)
Object.keys(batch.value).forEach((key) => {
if (
key != 'description' &&
key != 'batch_details' &&
typeof batch.value[key as keyof Batch] === 'string'
) {
batch.value[key as keyof Batch] = escapeHTML(

View File

@@ -149,6 +149,7 @@ import {
createResource,
TabButtons,
Tooltip,
toast,
usePageMeta,
} from 'frappe-ui'
import { computed, inject, watch, ref, onMounted, watchEffect } from 'vue'
@@ -279,11 +280,17 @@ const getTabButtons = () => {
}
const reloadUser = () => {
call('frappe.sessions.clear').then(() => {
$user.reload().then(() => {
profile.reload()
call('frappe.sessions.clear')
.then(() => {
$user.reload().then(() => {
profile.reload()
toast.success(__('Session refreshed successfully'))
})
})
.catch((err) => {
toast.error(__('Failed to refresh session'))
console.error(err)
})
})
}
const navigateTo = (url) => {