diff --git a/e2e/course_creation.spec.ts b/e2e/course_creation.spec.ts index 2c1fb8afdd..256f0fb7f7 100644 --- a/e2e/course_creation.spec.ts +++ b/e2e/course_creation.spec.ts @@ -119,13 +119,10 @@ test.describe("Course Creation", () => { // Configure settings await settingsTab(page).click(); - // Preview video: the redesigned field has a URL input (plus a hidden - // file input), so target the YouTube URL input by its placeholder. + // Preview video: the field has a URL input beside a hidden file input, + // so target the URL input by its accessible name. await page - .locator("label") - .filter({ hasText: "Preview video" }) - .locator("xpath=..") - .getByPlaceholder("Paste a YouTube link") + .getByRole("textbox", { name: "YouTube link" }) .fill("https://www.youtube.com/embed/-LPmw2Znl2c"); // Tags. A new tag is the `Create ""` option CourseDetailsSection diff --git a/frontend/src/components/ContactUsEmail.vue b/frontend/src/components/ContactUsEmail.vue index 0c507d4b25..90b1b3c713 100644 --- a/frontend/src/components/ContactUsEmail.vue +++ b/frontend/src/components/ContactUsEmail.vue @@ -24,7 +24,11 @@ diff --git a/frontend/src/components/Controls/Uploader.vue b/frontend/src/components/Controls/Uploader.vue index 631a3360c3..df4fc25b2f 100644 --- a/frontend/src/components/Controls/Uploader.vue +++ b/frontend/src/components/Controls/Uploader.vue @@ -95,7 +95,7 @@ diff --git a/frontend/src/components/Modals/DiscussionModal.vue b/frontend/src/components/Modals/DiscussionModal.vue index 5c08a41db8..4b9338bb5c 100644 --- a/frontend/src/components/Modals/DiscussionModal.vue +++ b/frontend/src/components/Modals/DiscussionModal.vue @@ -83,7 +83,9 @@ const submitTopic = (close) => { toast.error(__('Details cannot be empty.')) return } - call('frappe.client.insert', { + // Returned so the Dialog keeps Post loading, and so disabled, until the + // topic and its first reply are saved. + return call('frappe.client.insert', { doc: { doctype: 'Discussion Topic', reference_doctype: props.doctype, @@ -91,9 +93,7 @@ const submitTopic = (close) => { title: topic.title, }, }) - .then((data) => { - createReply(data.name, close) - }) + .then((data) => createReply(data.name, close)) .catch((err) => { toast.error(err.messages?.[0] || err) console.error(err) @@ -101,7 +101,7 @@ const submitTopic = (close) => { } const createReply = (topicName, close) => { - call('frappe.client.insert', { + return call('frappe.client.insert', { doc: { doctype: 'Discussion Reply', topic: topicName, diff --git a/frontend/src/components/Modals/EvaluationModal.vue b/frontend/src/components/Modals/EvaluationModal.vue index aa3be9e5c6..0acc18bfda 100644 --- a/frontend/src/components/Modals/EvaluationModal.vue +++ b/frontend/src/components/Modals/EvaluationModal.vue @@ -80,6 +80,7 @@ +
{{ __('Please select a course to view available slots.') }}
@@ -91,6 +92,7 @@ diff --git a/frontend/src/components/Settings/Raven/RavenSettings.vue b/frontend/src/components/Settings/Raven/RavenSettings.vue index 1c8dcbd712..3e88e88ad7 100644 --- a/frontend/src/components/Settings/Raven/RavenSettings.vue +++ b/frontend/src/components/Settings/Raven/RavenSettings.vue @@ -57,7 +57,7 @@ v-else :missing="missingApp" :loading="enableIntegration.loading" - @enable="enableIntegration.submit()" + @enable="enable" /> @@ -136,6 +136,11 @@ const enableIntegration = createResource({ }, }) +function enable(): void { + if (enableIntegration.loading) return + enableIntegration.submit() +} + /** Which of the three screens is showing. A channel always has a workspace behind it. */ type Screen = 'list' | 'workspace' | 'channel' diff --git a/frontend/src/components/Settings/Transactions/AddressModal.vue b/frontend/src/components/Settings/Transactions/AddressModal.vue index ce54317e33..fa909e399c 100644 --- a/frontend/src/components/Settings/Transactions/AddressModal.vue +++ b/frontend/src/components/Settings/Transactions/AddressModal.vue @@ -136,7 +136,7 @@ const createAddress = (close: () => void) => { ) return } - call('frappe.client.insert', { + return call('frappe.client.insert', { doc: { doctype: 'Address', ...address, diff --git a/frontend/src/components/Sidebar/UserDropdown.vue b/frontend/src/components/Sidebar/UserDropdown.vue index 8a82aeca7f..afd67f80da 100644 --- a/frontend/src/components/Sidebar/UserDropdown.vue +++ b/frontend/src/components/Sidebar/UserDropdown.vue @@ -323,25 +323,24 @@ const clearDemoDataConfirmation = () => { theme: 'red', variant: 'solid', onClick({ close }) { - clearDemoData() - close() + return clearDemoData(close) }, }, ], }) } -const clearDemoData = () => { +const clearDemoData = (close) => call('lms.lms.api.clear_demo_data') .then(() => { window.location.href = '/lms' toast.success(__('Demo data cleared successfully')) }) .catch((error) => { + close() toast.error(__(error.message || 'Error clearing demo data')) console.error('Error clearing demo data:', error) }) -}