feat: remove desk card doctype
This commit is contained in:
parent
30bc660fb5
commit
8b63df5be7
7 changed files with 1 additions and 108 deletions
|
|
@ -1,8 +0,0 @@
|
|||
// Copyright (c) 2020, Frappe Technologies and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Desk Card', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
{
|
||||
"actions": [],
|
||||
"creation": "2020-01-29 14:45:54.383089",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"label",
|
||||
"hidden",
|
||||
"column_break_2",
|
||||
"icon",
|
||||
"section_break_3",
|
||||
"links"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "links",
|
||||
"fieldtype": "Code",
|
||||
"label": "Links",
|
||||
"options": "JSON",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_3",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_2",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "hidden",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
"label": "Hidden"
|
||||
},
|
||||
{
|
||||
"fieldname": "label",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Label",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "icon",
|
||||
"fieldtype": "Data",
|
||||
"label": "Icon"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2020-09-07 15:20:41.201905",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Desk",
|
||||
"name": "Desk Card",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2020, Frappe Technologies and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class DeskCard(Document):
|
||||
pass
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2020, Frappe Technologies and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestDeskCard(unittest.TestCase):
|
||||
pass
|
||||
|
|
@ -31,7 +31,6 @@
|
|||
"shortcuts",
|
||||
"section_break_18",
|
||||
"cards_label",
|
||||
"cards",
|
||||
"links"
|
||||
],
|
||||
"fields": [
|
||||
|
|
@ -80,12 +79,6 @@
|
|||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "cards",
|
||||
"fieldtype": "Table",
|
||||
"label": "Cards",
|
||||
"options": "Desk Card"
|
||||
},
|
||||
{
|
||||
"fieldname": "category",
|
||||
"fieldtype": "Select",
|
||||
|
|
@ -213,7 +206,7 @@
|
|||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2020-11-17 12:14:48.950323",
|
||||
"modified": "2020-12-01 13:36:26.827062",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Desk",
|
||||
"name": "Desk Page",
|
||||
|
|
|
|||
|
|
@ -13,17 +13,9 @@ from json import loads, dumps
|
|||
|
||||
class DeskPage(Document):
|
||||
def validate(self):
|
||||
self.validate_cards_json()
|
||||
if (self.is_standard and not frappe.conf.developer_mode and not disable_saving_as_standard()):
|
||||
frappe.throw(_("You need to be in developer mode to edit this document"))
|
||||
|
||||
def validate_cards_json(self):
|
||||
for card in self.cards:
|
||||
try:
|
||||
validate_json_string(card.links)
|
||||
except frappe.ValidationError:
|
||||
frappe.throw(_("Invalid JSON in card links for {0}").format(frappe.bold(card.label)))
|
||||
|
||||
def on_update(self):
|
||||
if disable_saving_as_standard():
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue