From 0e9fdcb0a32321699384a7a802147de975478359 Mon Sep 17 00:00:00 2001 From: Tyler Matteson Date: Fri, 25 Jul 2025 15:12:15 -0400 Subject: [PATCH] fix: light refactor, add code quality tooling --- .pre-commit-config.yaml | 20 + .../dashboard_icon/dashboard_icon.json | 2 +- .../doctype/dashboard_icon/dashboard_icon.py | 11 + dashboard/fixtures/custom_field.json | 1 - dashboard/fixtures/property_setter.json | 1602 ----------------- dashboard/hooks.py | 23 +- dashboard/www/__init__.py | 3 + dashboard/www/dashboard/__init__.py | 0 dashboard/www/dashboard/index.html | 131 +- dashboard/www/dashboard/index.py | 23 +- 10 files changed, 127 insertions(+), 1689 deletions(-) create mode 100644 dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.py delete mode 100644 dashboard/fixtures/custom_field.json delete mode 100644 dashboard/fixtures/property_setter.json create mode 100644 dashboard/www/__init__.py delete mode 100644 dashboard/www/dashboard/__init__.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0eb0dca..4e5bca5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,6 +63,26 @@ repos: dashboard/public/js/lib/.* )$ + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + additional_dependencies: + - tomli + args: ['-L', ''] + + - repo: https://github.com/agritheory/test_utils/ + rev: v0.17.0 + hooks: + - id: update_pre_commit_config + - id: validate_customizations + always_run: true + - id: validate_copyright + files: '\.(js|ts|py|md)$' + args: ['--app', 'dashboard'] + - id: clean_customized_doctypes + args: ['--app', 'dashboard'] + ci: autoupdate_schedule: weekly skip: [] diff --git a/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.json b/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.json index 499d1eb..b5622e5 100644 --- a/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.json +++ b/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.json @@ -46,7 +46,7 @@ "modified_by": "Administrator", "module": "Dashboard", "name": "Dashboard Icon", - "owner": "adam@seahavenind.com", + "owner": "Administrator", "permissions": [ { "create": 1, diff --git a/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.py b/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.py new file mode 100644 index 0000000..d2109ef --- /dev/null +++ b/dashboard/dashboard/doctype/dashboard_icon/dashboard_icon.py @@ -0,0 +1,11 @@ +# Copyright (c) 2025, Adam Moussa and contributors +# For license information, please see license.txt + +import frappe +from frappe.model.document import Document +from frappe.website.utils import clear_cache + + +class DashboardIcon(Document): + def validate(self): + clear_cache("/dashboard") diff --git a/dashboard/fixtures/custom_field.json b/dashboard/fixtures/custom_field.json deleted file mode 100644 index 0637a08..0000000 --- a/dashboard/fixtures/custom_field.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/dashboard/fixtures/property_setter.json b/dashboard/fixtures/property_setter.json deleted file mode 100644 index 6f201e8..0000000 --- a/dashboard/fixtures/property_setter.json +++ /dev/null @@ -1,1602 +0,0 @@ -[ - { - "default_value": null, - "doc_type": "Supplier", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.421244", - "module": null, - "name": "Supplier-naming_series-reqd", - "property": "reqd", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.512734", - "module": null, - "name": "Supplier-naming_series-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Customer", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.701635", - "module": null, - "name": "Customer-naming_series-reqd", - "property": "reqd", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Customer", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.792270", - "module": null, - "name": "Customer-naming_series-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.798307", - "module": null, - "name": "Sales Order-tax_id-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.802147", - "module": null, - "name": "Sales Order-tax_id-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.805917", - "module": null, - "name": "Sales Invoice-tax_id-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.808543", - "module": null, - "name": "Sales Invoice-tax_id-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.813404", - "module": null, - "name": "Delivery Note-tax_id-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.816854", - "module": null, - "name": "Delivery Note-tax_id-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Packed Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rate", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.820159", - "module": null, - "name": "Packed Item-rate-read_only", - "property": "read_only", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "discount_account", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.828011", - "module": null, - "name": "Sales Invoice Item-discount_account-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "discount_account", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.832425", - "module": null, - "name": "Sales Invoice Item-discount_account-mandatory_depends_on", - "property": "mandatory_depends_on", - "property_type": "Code", - "row_name": null, - "value": "" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "additional_discount_account", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.837321", - "module": null, - "name": "Sales Invoice-additional_discount_account-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "additional_discount_account", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.840201", - "module": null, - "name": "Sales Invoice-additional_discount_account-mandatory_depends_on", - "property": "mandatory_depends_on", - "property_type": "Code", - "row_name": null, - "value": "" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:40.943514", - "module": null, - "name": "Quotation-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.011199", - "module": null, - "name": "Quotation-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.014456", - "module": null, - "name": "Quotation-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.017486", - "module": null, - "name": "Quotation-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.020401", - "module": null, - "name": "Quotation-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.023669", - "module": null, - "name": "Sales Order-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.026905", - "module": null, - "name": "Sales Order-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.030136", - "module": null, - "name": "Sales Order-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.033333", - "module": null, - "name": "Sales Order-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.036382", - "module": null, - "name": "Sales Order-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.039417", - "module": null, - "name": "Sales Invoice-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.042919", - "module": null, - "name": "Sales Invoice-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.046106", - "module": null, - "name": "Sales Invoice-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.049213", - "module": null, - "name": "Sales Invoice-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.052366", - "module": null, - "name": "Sales Invoice-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.055466", - "module": null, - "name": "Delivery Note-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.058809", - "module": null, - "name": "Delivery Note-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.061949", - "module": null, - "name": "Delivery Note-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.065381", - "module": null, - "name": "Delivery Note-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.068544", - "module": null, - "name": "Delivery Note-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.071675", - "module": null, - "name": "Supplier Quotation-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.074946", - "module": null, - "name": "Supplier Quotation-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.078152", - "module": null, - "name": "Supplier Quotation-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.081167", - "module": null, - "name": "Supplier Quotation-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.083922", - "module": null, - "name": "Supplier Quotation-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.086899", - "module": null, - "name": "Purchase Order-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.090001", - "module": null, - "name": "Purchase Order-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.092904", - "module": null, - "name": "Purchase Order-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.095901", - "module": null, - "name": "Purchase Order-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.098911", - "module": null, - "name": "Purchase Order-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.102082", - "module": null, - "name": "Purchase Invoice-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.105218", - "module": null, - "name": "Purchase Invoice-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.108388", - "module": null, - "name": "Purchase Invoice-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.111513", - "module": null, - "name": "Purchase Invoice-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.114774", - "module": null, - "name": "Purchase Invoice-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.117974", - "module": null, - "name": "Purchase Receipt-base_rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "base_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.122520", - "module": null, - "name": "Purchase Receipt-base_rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.125908", - "module": null, - "name": "Purchase Receipt-rounded_total-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.129063", - "module": null, - "name": "Purchase Receipt-rounded_total-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "disable_rounded_total", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.132200", - "module": null, - "name": "Purchase Receipt-disable_rounded_total-default", - "property": "default", - "property_type": "Text", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.135333", - "module": null, - "name": "Quotation-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.138455", - "module": null, - "name": "Quotation-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.141683", - "module": null, - "name": "Sales Order-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.144935", - "module": null, - "name": "Sales Order-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.148156", - "module": null, - "name": "Sales Invoice-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.151291", - "module": null, - "name": "Sales Invoice-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.154448", - "module": null, - "name": "Delivery Note-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.157658", - "module": null, - "name": "Delivery Note-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.160787", - "module": null, - "name": "Supplier Quotation-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Supplier Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.163897", - "module": null, - "name": "Supplier Quotation-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.167100", - "module": null, - "name": "Purchase Order-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.170164", - "module": null, - "name": "Purchase Order-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.173133", - "module": null, - "name": "Purchase Invoice-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.176345", - "module": null, - "name": "Purchase Invoice-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.179153", - "module": null, - "name": "Purchase Receipt-in_words-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "in_words", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.182276", - "module": null, - "name": "Purchase Receipt-in_words-print_hide", - "property": "print_hide", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.556305", - "module": null, - "name": "Item-naming_series-reqd", - "property": "reqd", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "naming_series", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.643764", - "module": null, - "name": "Item-naming_series-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "item_code", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.649100", - "module": null, - "name": "Item-item_code-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "item_code", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.652020", - "module": null, - "name": "Item-item_code-reqd", - "property": "reqd", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Sales Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.655714", - "module": null, - "name": "Sales Invoice Item-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "POS Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.661399", - "module": null, - "name": "POS Invoice Item-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Job Card", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.665480", - "module": null, - "name": "Job Card-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Stock Entry Detail", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.668880", - "module": null, - "name": "Stock Entry Detail-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.674774", - "module": null, - "name": "Purchase Receipt Item-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.678829", - "module": null, - "name": "Delivery Note Item-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Stock Reconciliation Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.684903", - "module": null, - "name": "Stock Reconciliation Item-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Item Barcode", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.689115", - "module": null, - "name": "Item Barcode-barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "barcodes", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.693893", - "module": null, - "name": "Item-barcodes-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.699335", - "module": null, - "name": "Purchase Invoice-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "POS Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.702629", - "module": null, - "name": "POS Invoice-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.707382", - "module": null, - "name": "Sales Invoice-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.711207", - "module": null, - "name": "Purchase Order-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.714529", - "module": null, - "name": "Sales Order-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.719800", - "module": null, - "name": "Quotation-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.722918", - "module": null, - "name": "Purchase Receipt-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Stock Reconciliation", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.726133", - "module": null, - "name": "Stock Reconciliation-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Material Request", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.730448", - "module": null, - "name": "Material Request-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Pick List", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.734546", - "module": null, - "name": "Pick List-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Stock Entry", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.737650", - "module": null, - "name": "Stock Entry-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "scan_barcode", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.741813", - "module": null, - "name": "Delivery Note-scan_barcode-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "0" - }, - { - "default_value": null, - "doc_type": "Sales Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "target_warehouse", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.751283", - "module": null, - "name": "Sales Invoice Item-target_warehouse-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Delivery Note Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "target_warehouse", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.755380", - "module": null, - "name": "Delivery Note Item-target_warehouse-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Purchase Invoice Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "from_warehouse", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.761012", - "module": null, - "name": "Purchase Invoice Item-from_warehouse-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "default_value": null, - "doc_type": "Purchase Receipt Item", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "from_warehouse", - "is_system_generated": 1, - "modified": "2025-07-18 16:15:41.765225", - "module": null, - "name": "Purchase Receipt Item-from_warehouse-hidden", - "property": "hidden", - "property_type": "Check", - "row_name": null, - "value": "1" - } -] \ No newline at end of file diff --git a/dashboard/hooks.py b/dashboard/hooks.py index a360d8e..fe5cb44 100644 --- a/dashboard/hooks.py +++ b/dashboard/hooks.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025, Adam Moussa and contributors +# For license information, please see license.txt + app_name = "dashboard" app_title = "Dashboard" app_publisher = "Adam Moussa" @@ -243,23 +246,5 @@ app_license = "mit" # } fixtures = [ - { - "dt": "Custom Field", - "filters": [ - ["dt", "in", ["Dashboard Icon"]] - ] - }, - { - "dt": "Property Setter" - }, - "Dashboard Icon" # export the entire custom DocType + "Dashboard Icon", ] - -doc_events = { - "Dashboard Icon": { - "after_insert": "dashboard.utils.cache.clear_dashboard_cache", - "on_update": "dashboard.utils.cache.clear_dashboard_cache", - "on_trash": "dashboard.utils.cache.clear_dashboard_cache", - } -} - diff --git a/dashboard/www/__init__.py b/dashboard/www/__init__.py new file mode 100644 index 0000000..bc81a7b --- /dev/null +++ b/dashboard/www/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2025, Adam Moussa and contributors +# For license information, please see license.txt + diff --git a/dashboard/www/dashboard/__init__.py b/dashboard/www/dashboard/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dashboard/www/dashboard/index.html b/dashboard/www/dashboard/index.html index 094112e..75e4462 100644 --- a/dashboard/www/dashboard/index.html +++ b/dashboard/www/dashboard/index.html @@ -1,57 +1,74 @@ -
-

Sea Haven Portal

-
- {% for icon in icons %} - - -
{{ icon.label }}
-
- {% endfor %} -
-
- - - - +{% extends "templates/web.html" %} +{% block content %} +
+

Sea Haven Portal

+
+ {% for icon in icons %} + + +
{{ icon.label }}
+
+ {% endfor %} +
+
+ +{% endblock %} +{%- block style -%} + + + +{% endblock %} \ No newline at end of file diff --git a/dashboard/www/dashboard/index.py b/dashboard/www/dashboard/index.py index b7a2a47..a62244e 100644 --- a/dashboard/www/dashboard/index.py +++ b/dashboard/www/dashboard/index.py @@ -1,17 +1,22 @@ +# Copyright (c) 2025, Adam Moussa and contributors +# For license information, please see license.txt + import frappe no_cache = 1 + def get_context(context): - user = frappe.session.user - user_roles = frappe.get_roles(user) + user = frappe.session.user + user_roles = frappe.get_roles(user) - icons = frappe.get_all("Dashboard Icon", fields=["label", "icon", "url", "role"]) - visible_icons = [] + icons = frappe.get_all("Dashboard Icon", fields=["label", "icon", "url", "role"]) + print(icons) + visible_icons = [] - for icon in icons: - if not icon.role or icon.role in user_roles: - visible_icons.append(icon) + for icon in icons: + if not icon.role or icon.role in user_roles: + visible_icons.append(icon) - context.icons = visible_icons - return context + context.icons = visible_icons + return context