fix(minor): Onboarding: add option to view list view in create action

This commit is contained in:
Rushabh Mehta 2022-06-14 12:54:10 +05:30
parent 2058b0cbea
commit 80334698a7

View file

@ -99,12 +99,7 @@ export default class OnboardingWidget extends Widget {
const toggle_content = () => {
this.step_body.empty();
this.step_footer.empty();
this.step_body.html(
step.description ?
frappe.markdown(step.description)
: `<h1>${step.title}</h1>`
);
set_description();
if (step.intro_video_url) {
$(`<button class="btn btn-primary btn-sm">${__('Watch Tutorial')}</button>`)
@ -117,6 +112,22 @@ export default class OnboardingWidget extends Widget {
}
};
const set_description = () => {
let content = step.description ?
frappe.markdown(step.description)
: `<h1>${step.title}</h1>`
if (step.action === 'Create Entry') {
// add a secondary action to view list
content += `<p>
<a href='/app/${frappe.router.slug(step.reference_document)}'>
${ __('Show {0} List', [step.reference_document])}</a>
</p>`
}
this.step_body.html(content);
}
const toggle_video = () => {
this.step_body.empty();
this.step_footer.empty();