Merge pull request #37467 from sokumon/workspace-editor
This commit is contained in:
commit
72cd685e33
1 changed files with 21 additions and 1 deletions
|
|
@ -493,6 +493,7 @@ frappe.views.Workspace = class Workspace {
|
|||
let blocks = [
|
||||
{
|
||||
type: "header",
|
||||
|
||||
data: { text: values.title },
|
||||
},
|
||||
];
|
||||
|
|
@ -666,7 +667,6 @@ frappe.views.Workspace = class Workspace {
|
|||
spacer: this.blocks["spacer"],
|
||||
HeaderSize: frappe.workspace_block.tunes["header_size"],
|
||||
};
|
||||
|
||||
this.editor = new EditorJS({
|
||||
data: {
|
||||
blocks: blocks || [],
|
||||
|
|
@ -676,6 +676,26 @@ frappe.views.Workspace = class Workspace {
|
|||
readOnly: true,
|
||||
logLevel: "ERROR",
|
||||
});
|
||||
if (blocks.length == 0) {
|
||||
let message = __("Welcome to the {0} workspace", [this.page.title]);
|
||||
let default_block = [
|
||||
{
|
||||
type: "header",
|
||||
data: { text: message },
|
||||
},
|
||||
];
|
||||
if (this.has_access) {
|
||||
default_block.push({
|
||||
type: "paragraph",
|
||||
data: {
|
||||
text: __("Click on {0} to edit", [frappe.utils.icon("ellipsis")]),
|
||||
},
|
||||
});
|
||||
}
|
||||
this.editor.isReady.then(() => {
|
||||
this.editor.render({ blocks: default_block });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
save_page(page) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue