chore: fixed settings

This commit is contained in:
Jannat Patel
2025-04-22 16:17:29 +05:30
parent 66d4798db3
commit 470123c77a
7 changed files with 37 additions and 11 deletions

View File

@@ -100,6 +100,7 @@ jobs:
bench --site lms.test execute frappe.utils.install.complete_setup_wizard bench --site lms.test execute frappe.utils.install.complete_setup_wizard
bench --site lms.test execute frappe.tests.ui_test_helpers.create_test_user bench --site lms.test execute frappe.tests.ui_test_helpers.create_test_user
bench --site lms.test set-password frappe@example.com admin bench --site lms.test set-password frappe@example.com admin
bench --site lms.test execute lms.lms.utils.persona_captured
- name: cypress pre-requisites - name: cypress pre-requisites
run: | run: |

View File

@@ -13,6 +13,6 @@ module.exports = defineConfig({
openMode: 0, openMode: 0,
}, },
e2e: { e2e: {
baseUrl: "http://testui:8000", baseUrl: "http://pertest:8000",
}, },
}); });

View File

@@ -2,10 +2,7 @@ describe("Course Creation", () => {
it("creates a new course", () => { it("creates a new course", () => {
cy.login(); cy.login();
cy.wait(1000); cy.wait(1000);
cy.visit("/lms"); cy.visit("/lms/courses");
cy.wait(1000);
cy.get("div").contains("Skip").click();
cy.wait(1000);
// Create a course // Create a course
cy.get("button").contains("New").click(); cy.get("button").contains("New").click();

View File

@@ -322,11 +322,11 @@ const tabsStructure = computed(() => {
icon: 'LogIn', icon: 'LogIn',
fields: [ fields: [
{ {
label: 'Identify User Persona', label: 'Identify User Category',
name: 'user_category', name: 'user_category',
type: 'checkbox', type: 'checkbox',
description: description:
'Enable this option to identify the user persona during signup.', 'Enable this option to identify the user category during signup.',
}, },
{ {
label: 'Disable signup', label: 'Disable signup',

View File

@@ -172,6 +172,11 @@ const isPersonaCaptured = async () => {
const identifyUserPersona = async () => { const identifyUserPersona = async () => {
let personaCaptured = await isPersonaCaptured() let personaCaptured = await isPersonaCaptured()
debugger
console.log('personaCaptured', personaCaptured)
console.log('user.data?.is_system_manager', user.data?.is_system_manager)
console.log('user.data?.developer_mode', user.data?.developer_mode)
if ( if (
user.data?.is_system_manager && user.data?.is_system_manager &&
!user.data?.developer_mode && !user.data?.developer_mode &&

View File

@@ -61,7 +61,10 @@
"column_break_uwsp", "column_break_uwsp",
"payment_reminder_template", "payment_reminder_template",
"seo_tab", "seo_tab",
"meta_description" "meta_description",
"meta_image",
"column_break_xijv",
"meta_keywords"
], ],
"fields": [ "fields": [
{ {
@@ -106,7 +109,7 @@
"default": "0", "default": "0",
"fieldname": "user_category", "fieldname": "user_category",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Identify User Persona" "label": "Identify User Category"
}, },
{ {
"default": "0", "default": "0",
@@ -372,6 +375,22 @@
"fieldtype": "Small Text", "fieldtype": "Small Text",
"label": "Meta Description" "label": "Meta Description"
}, },
{
"description": "This image will be shown on lists and pages that don't have an image by default",
"fieldname": "meta_image",
"fieldtype": "Attach Image",
"label": "Meta Image"
},
{
"fieldname": "column_break_xijv",
"fieldtype": "Column Break"
},
{
"description": "Common keywords that will be used for all pages",
"fieldname": "meta_keywords",
"fieldtype": "Small Text",
"label": "Meta Keywords"
},
{ {
"default": "0", "default": "0",
"fieldname": "persona_captured", "fieldname": "persona_captured",
@@ -384,8 +403,8 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2025-04-22 14:34:19.656896", "modified": "2025-04-22 16:05:27.914422",
"modified_by": "Administrator", "modified_by": "sayali@frappe.io",
"module": "LMS", "module": "LMS",
"name": "LMS Settings", "name": "LMS Settings",
"owner": "Administrator", "owner": "Administrator",

View File

@@ -2167,3 +2167,7 @@ def get_palette(full_name):
hash_name = hashlib.md5(encoded_name).hexdigest() hash_name = hashlib.md5(encoded_name).hexdigest()
idx = cint((int(hash_name[4:6], 16) + 1) / 5.33) idx = cint((int(hash_name[4:6], 16) + 1) / 5.33)
return palette[idx % 8] return palette[idx % 8]
def persona_captured():
frappe.db.set_single_value("LMS Settings", "persona_captured", 1)