fix: misc fixes in demo data
- Generate demo data field copy
- absolute imports
- remove whitelisting where it's not required
- telemetry
- banner copy
- move to background
- clear bootinfo after setup
diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js
index bcad6eb..ba200ef 100644
--- a/erpnext/public/js/setup_wizard.js
+++ b/erpnext/public/js/setup_wizard.js
@@ -40,7 +40,12 @@
{ fieldname: 'fy_start_date', label: __('Financial Year Begins On'), fieldtype: 'Date', reqd: 1 },
// end date should be hidden (auto calculated)
{ fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1, hidden: 1 },
- { fieldname: 'setup_demo', label: __('Generate dummy data for demo'), fieldtype: 'Check'},
+ { fieldtype: "Section Break" },
+ {
+ fieldname: 'setup_demo',
+ label: __('Generate Demo Data for Exploration'),
+ fieldtype: 'Check',
+ description: 'If checked, we will create demo data for you to explore the system. This demo data can be erased later.'},
],
onload: function (slide) {
diff --git a/erpnext/public/js/utils/demo.js b/erpnext/public/js/utils/demo.js
index 22d78d8..e810c37 100644
--- a/erpnext/public/js/utils/demo.js
+++ b/erpnext/public/js/utils/demo.js
@@ -2,15 +2,19 @@
if (frappe.boot.sysdefaults.demo_company) {
erpnext.setup_clear_button();
}
+
+ // for first load
+ frappe.realtime.on("demo_data_complete", () => {
+ erpnext.setup_clear_button();
+ })
});
erpnext.setup_clear_button = function() {
- let message_string = __('Demo data is setup, use this button to clear before starting actual transactions');
+ let message_string = __("Demo data is present on the system, erase data before starting real usage.");
let $floatingBar = $(`
<div class="flex justify-content-center" style="width: 100%;">
<div class="flex justify-content-center flex-col shadow rounded p-2"
style="
- width: 50%;
background-color: #e0f2fe;
position: fixed;
bottom: 20px;
@@ -34,7 +38,7 @@
margin-right: 10px
"
>
- Clear
+ Clear Demo Data
</button>
</div>
</div>
@@ -54,4 +58,4 @@
}
})
});
-}
\ No newline at end of file
+}