Merge pull request #1561 from pateljannat/evaluator-link-in-batch
fix batch instructor should be linked to evaluator
This commit is contained in:
@@ -3,8 +3,47 @@ describe("Batch Creation", () => {
|
|||||||
cy.login();
|
cy.login();
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.visit("/lms/batches");
|
cy.visit("/lms/batches");
|
||||||
|
cy.closeOnboardingModal();
|
||||||
|
|
||||||
// Close onboarding modal
|
// Open Settings
|
||||||
|
cy.get("span").contains("Learning").click();
|
||||||
|
cy.get("span").contains("Settings").click();
|
||||||
|
|
||||||
|
// Add a new member
|
||||||
|
cy.get('[id^="headlessui-dialog-panel-v-"]')
|
||||||
|
.find("span")
|
||||||
|
.contains(/^Members$/)
|
||||||
|
.click();
|
||||||
|
cy.get('[id^="headlessui-dialog-panel-v-"]')
|
||||||
|
.find("button")
|
||||||
|
.contains("New")
|
||||||
|
.click();
|
||||||
|
|
||||||
|
const dateNow = Date.now();
|
||||||
|
const randomEmail = `testuser_${dateNow}@example.com`;
|
||||||
|
const randomName = `Test User ${dateNow}`;
|
||||||
|
|
||||||
|
cy.get("input[placeholder='Email']").type(randomEmail);
|
||||||
|
cy.get("input[placeholder='First Name']").type(randomName);
|
||||||
|
cy.get("button").contains("Add").click();
|
||||||
|
|
||||||
|
// Add evaluator
|
||||||
|
cy.get('[id^="headlessui-dialog-panel-v-"]')
|
||||||
|
.find("span")
|
||||||
|
.contains(/^Evaluators$/)
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.get('[id^="headlessui-dialog-panel-v-"]')
|
||||||
|
.find("button")
|
||||||
|
.contains("New")
|
||||||
|
.click();
|
||||||
|
const randomEvaluator = `evaluator${dateNow}@example.com`;
|
||||||
|
|
||||||
|
cy.get("input[placeholder='Email']").type(randomEvaluator);
|
||||||
|
cy.get("button").contains("Add").click();
|
||||||
|
cy.get("div").contains(randomEvaluator).should("be.visible").click();
|
||||||
|
|
||||||
|
cy.visit("/lms/batches");
|
||||||
cy.closeOnboardingModal();
|
cy.closeOnboardingModal();
|
||||||
|
|
||||||
// Create a batch
|
// Create a batch
|
||||||
@@ -34,7 +73,7 @@ describe("Batch Creation", () => {
|
|||||||
.contains("Instructors")
|
.contains("Instructors")
|
||||||
.parent()
|
.parent()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get("input").click().type("frappe");
|
cy.get("input").click().type("evaluator");
|
||||||
cy.get("input")
|
cy.get("input")
|
||||||
.invoke("attr", "aria-controls")
|
.invoke("attr", "aria-controls")
|
||||||
.as("instructor_list_id");
|
.as("instructor_list_id");
|
||||||
@@ -57,26 +96,6 @@ describe("Batch Creation", () => {
|
|||||||
});
|
});
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
|
|
||||||
// Add Student to system
|
|
||||||
|
|
||||||
cy.get("span").contains("Learning").click();
|
|
||||||
cy.get("span").contains("Settings").click();
|
|
||||||
cy.get('[id^="headlessui-dialog-panel-v-"]')
|
|
||||||
.find("span")
|
|
||||||
.contains(/^Members$/)
|
|
||||||
.should("have.text", "Members")
|
|
||||||
.click();
|
|
||||||
cy.get("button").contains("New").click();
|
|
||||||
|
|
||||||
const dateNow = Date.now();
|
|
||||||
const randomEmail = `testuser_${dateNow}@example.com`;
|
|
||||||
const randomName = `Test User ${dateNow}`;
|
|
||||||
|
|
||||||
cy.get("input[placeholder='Email']").type(randomEmail);
|
|
||||||
cy.get("input[placeholder='First Name']").type(randomName);
|
|
||||||
cy.get("button").contains("Add").click();
|
|
||||||
cy.get("div").contains(randomName).should("be.visible").click();
|
|
||||||
|
|
||||||
// View Batch
|
// View Batch
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.visit("/lms/batches");
|
cy.visit("/lms/batches");
|
||||||
@@ -103,7 +122,7 @@ describe("Batch Creation", () => {
|
|||||||
.contains("10:00 AM - 11:00 AM")
|
.contains("10:00 AM - 11:00 AM")
|
||||||
.should("be.visible");
|
.should("be.visible");
|
||||||
cy.get("span").contains("IST").should("be.visible");
|
cy.get("span").contains("IST").should("be.visible");
|
||||||
cy.get("a").contains("Frappe").should("be.visible");
|
cy.get("a").contains("Evaluator").should("be.visible");
|
||||||
cy.get("div")
|
cy.get("div")
|
||||||
.contains("10")
|
.contains("10")
|
||||||
.should("be.visible")
|
.should("be.visible")
|
||||||
@@ -118,7 +137,7 @@ describe("Batch Creation", () => {
|
|||||||
cy.get("div")
|
cy.get("div")
|
||||||
.contains("Test Batch Short Description to test the UI")
|
.contains("Test Batch Short Description to test the UI")
|
||||||
.should("be.visible");
|
.should("be.visible");
|
||||||
cy.get("a").contains("Frappe").should("be.visible");
|
cy.get("a").contains("Evaluator").should("be.visible");
|
||||||
cy.get("span")
|
cy.get("span")
|
||||||
.contains("01 Oct 2030 - 31 Oct 2030")
|
.contains("01 Oct 2030 - 31 Oct 2030")
|
||||||
.should("be.visible");
|
.should("be.visible");
|
||||||
|
|||||||
@@ -55,9 +55,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
|
<div class="h-10"></div>
|
||||||
<div
|
<div
|
||||||
v-if="attrs.onCreate"
|
v-if="attrs.onCreate"
|
||||||
class="absolute bottom-2 left-1 w-[98%] pt-2 bg-white border-t"
|
class="absolute bottom-2 left-1 w-[99%] pt-2 bg-white border-t"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
:placeholder="__('Email')"
|
:placeholder="__('Email')"
|
||||||
type="email"
|
type="email"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
|
@keydown.enter="addEvaluator"
|
||||||
/>
|
/>
|
||||||
<Button @click="addEvaluator()" variant="subtle">
|
<Button @click="addEvaluator()" variant="subtle">
|
||||||
{{ __('Add') }}
|
{{ __('Add') }}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
/>
|
/>
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
v-model="instructors"
|
v-model="instructors"
|
||||||
doctype="User"
|
doctype="Course Evaluator"
|
||||||
:label="__('Instructors')"
|
:label="__('Instructors')"
|
||||||
:required="true"
|
:required="true"
|
||||||
:onCreate="(close) => openSettings('Members', close)"
|
:onCreate="(close) => openSettings('Evaluators', close)"
|
||||||
:filters="{ ignore_user_type: 1 }"
|
:filters="{ ignore_user_type: 1 }"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,8 +86,8 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-03-26 14:02:46.588721",
|
"modified": "2025-06-05 11:04:32.475711",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "sayali@frappe.io",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Course Evaluator",
|
"name": "Course Evaluator",
|
||||||
"naming_rule": "By fieldname",
|
"naming_rule": "By fieldname",
|
||||||
@@ -133,5 +133,6 @@
|
|||||||
"row_format": "Dynamic",
|
"row_format": "Dynamic",
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"title_field": "full_name"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,4 +107,5 @@ lms.patches.v2_0.update_course_evaluator_data
|
|||||||
lms.patches.v2_0.move_zoom_settings #20-05-2025
|
lms.patches.v2_0.move_zoom_settings #20-05-2025
|
||||||
lms.patches.v2_0.link_zoom_account_to_live_class
|
lms.patches.v2_0.link_zoom_account_to_live_class
|
||||||
lms.patches.v2_0.link_zoom_account_to_batch
|
lms.patches.v2_0.link_zoom_account_to_batch
|
||||||
lms.patches.v2_0.sidebar_for_certified_members
|
lms.patches.v2_0.sidebar_for_certified_members
|
||||||
|
lms.patches.v2_0.move_batch_instructors_to_evaluators
|
||||||
22
lms/patches/v2_0/move_batch_instructors_to_evaluators.py
Normal file
22
lms/patches/v2_0/move_batch_instructors_to_evaluators.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
batch_instructors = frappe.get_all(
|
||||||
|
"Course Instructor",
|
||||||
|
{
|
||||||
|
"parenttype": "LMS Batch",
|
||||||
|
},
|
||||||
|
["name", "instructor", "parent"],
|
||||||
|
)
|
||||||
|
|
||||||
|
for instructor in batch_instructors:
|
||||||
|
if not frappe.db.exists(
|
||||||
|
"Course Evaluator",
|
||||||
|
{
|
||||||
|
"evaluator": instructor.instructor,
|
||||||
|
},
|
||||||
|
):
|
||||||
|
doc = frappe.new_doc("Course Evaluator")
|
||||||
|
doc.evaluator = instructor.instructor
|
||||||
|
doc.insert()
|
||||||
Reference in New Issue
Block a user