Kaynağa Gözat

Merge pull request #18110 from frappe/mergify/bp/version-14-hotfix/pr-18109

version-14
Shariq Ansari 2 yıl önce
committed by GitHub
ebeveyn
işleme
c54e2d0592
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
2 değiştirilmiş dosya ile 19 ekleme ve 17 silme
  1. +1
    -0
      frappe/desk/doctype/workspace/workspace.py
  2. +18
    -17
      frappe/public/js/frappe/views/workspace/workspace.js

+ 1
- 0
frappe/desk/doctype/workspace/workspace.py Dosyayı Görüntüle

@@ -266,6 +266,7 @@ def duplicate_page(page_name, new_page):
doc.public = new_page.get("is_public")
doc.for_user = ""
doc.label = doc.title
doc.module = ""
if not doc.public:
doc.for_user = doc.for_user or frappe.session.user
doc.label = f"{doc.title}-{doc.for_user}"


+ 18
- 17
frappe/public/js/frappe/views/workspace/workspace.js Dosyayı Görüntüle

@@ -390,18 +390,17 @@ frappe.views.Workspace = class Workspace {

this.clear_page_actions();

current_page.is_editable &&
this.page.set_secondary_action(__("Edit"), async () => {
if (!this.editor || !this.editor.readOnly) return;
this.is_read_only = false;
await this.editor.readOnly.toggle();
this.editor.isReady.then(() => {
this.initialize_editorjs_undo();
this.setup_customization_buttons(current_page);
this.show_sidebar_actions();
this.make_blocks_sortable();
});
this.page.set_secondary_action(__("Edit"), async () => {
if (!this.editor || !this.editor.readOnly) return;
this.is_read_only = false;
await this.editor.readOnly.toggle();
this.editor.isReady.then(() => {
this.initialize_editorjs_undo();
this.setup_customization_buttons(current_page);
this.show_sidebar_actions();
this.make_blocks_sortable();
});
});

this.page.add_inner_button(__("Create Workspace"), () => {
this.initialize_new_page();
@@ -794,7 +793,11 @@ frappe.views.Workspace = class Workspace {

duplicate_page(page) {
var me = this;
let parent_pages = this.get_parent_pages(page);
let new_page = { ...page };
if (!this.has_access && new_page.public) {
new_page.public = 0;
}
let parent_pages = this.get_parent_pages({ public: new_page.public });
const d = new frappe.ui.Dialog({
title: __("Create Duplicate"),
fields: [
@@ -809,14 +812,14 @@ frappe.views.Workspace = class Workspace {
fieldtype: "Select",
fieldname: "parent",
options: parent_pages,
default: page.parent_page,
default: new_page.parent_page,
},
{
label: __("Public"),
fieldtype: "Check",
fieldname: "is_public",
depends_on: `eval:${this.has_access}`,
default: page.public,
default: new_page.public,
onchange: function () {
d.set_df_property(
"parent",
@@ -832,7 +835,7 @@ frappe.views.Workspace = class Workspace {
label: __("Icon"),
fieldtype: "Icon",
fieldname: "icon",
default: page.icon,
default: new_page.icon,
},
],
primary_action_label: __("Duplicate"),
@@ -854,8 +857,6 @@ frappe.views.Workspace = class Workspace {
},
});

let new_page = { ...page };

new_page.title = values.title;
new_page.public = values.is_public || 0;
new_page.name = values.title + (new_page.public ? "" : "-" + frappe.session.user);


Yükleniyor…
İptal
Kaydet