From 4a745d93ba7fc17589fba746cca9e7be23f5f28d Mon Sep 17 00:00:00 2001 From: frappe Date: Fri, 2 May 2025 19:30:29 +0000 Subject: [PATCH] feat: Initialize App --- .gitignore | 7 + README.md | 7 + license.txt | 1 + portal_dashboard/__init__.py | 1 + portal_dashboard/config/__init__.py | 0 portal_dashboard/config/desktop.py | 10 + portal_dashboard/config/docs.py | 10 + portal_dashboard/hooks.py | 215 ++++++++++++++++++ portal_dashboard/modules.txt | 1 + portal_dashboard/patches.txt | 0 portal_dashboard/portal_dashboard/__init__.py | 0 portal_dashboard/public/.gitkeep | 0 portal_dashboard/templates/__init__.py | 0 portal_dashboard/templates/pages/__init__.py | 0 pyproject.toml | 20 ++ 15 files changed, 272 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 license.txt create mode 100644 portal_dashboard/__init__.py create mode 100644 portal_dashboard/config/__init__.py create mode 100644 portal_dashboard/config/desktop.py create mode 100644 portal_dashboard/config/docs.py create mode 100644 portal_dashboard/hooks.py create mode 100644 portal_dashboard/modules.txt create mode 100644 portal_dashboard/patches.txt create mode 100644 portal_dashboard/portal_dashboard/__init__.py create mode 100644 portal_dashboard/public/.gitkeep create mode 100644 portal_dashboard/templates/__init__.py create mode 100644 portal_dashboard/templates/pages/__init__.py create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b44391 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +*.pyc +*.egg-info +*.swp +tags +portal_dashboard/docs/current +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..505c996 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## Portal Dashboard + +A role based tile dashboard for navigation to internal resources + +#### License + +MIT \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..2fdf7c7 --- /dev/null +++ b/license.txt @@ -0,0 +1 @@ +License: MIT \ No newline at end of file diff --git a/portal_dashboard/__init__.py b/portal_dashboard/__init__.py new file mode 100644 index 0000000..f102a9c --- /dev/null +++ b/portal_dashboard/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.1" diff --git a/portal_dashboard/config/__init__.py b/portal_dashboard/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/portal_dashboard/config/desktop.py b/portal_dashboard/config/desktop.py new file mode 100644 index 0000000..0054982 --- /dev/null +++ b/portal_dashboard/config/desktop.py @@ -0,0 +1,10 @@ +from frappe import _ + +def get_data(): + return [ + { + "module_name": "Portal Dashboard", + "type": "module", + "label": _("Portal Dashboard") + } + ] diff --git a/portal_dashboard/config/docs.py b/portal_dashboard/config/docs.py new file mode 100644 index 0000000..29b9d2e --- /dev/null +++ b/portal_dashboard/config/docs.py @@ -0,0 +1,10 @@ +""" +Configuration for docs +""" + +# source_link = "https://github.com/[org_name]/portal_dashboard" +# headline = "App that does everything" +# sub_heading = "Yes, you got that right the first time, everything" + +def get_context(context): + context.brand_html = "Portal Dashboard" diff --git a/portal_dashboard/hooks.py b/portal_dashboard/hooks.py new file mode 100644 index 0000000..7f11472 --- /dev/null +++ b/portal_dashboard/hooks.py @@ -0,0 +1,215 @@ +app_name = "portal_dashboard" +app_title = "Portal Dashboard" +app_publisher = "Adam Moussa" +app_description = "A role based tile dashboard for navigation to internal resources" +app_email = "adam@seahaven.com" +app_license = "MIT" + +# Includes in +# ------------------ + +# include js, css files in header of desk.html +# app_include_css = "/assets/portal_dashboard/css/portal_dashboard.css" +# app_include_js = "/assets/portal_dashboard/js/portal_dashboard.js" + +# include js, css files in header of web template +# web_include_css = "/assets/portal_dashboard/css/portal_dashboard.css" +# web_include_js = "/assets/portal_dashboard/js/portal_dashboard.js" + +# include custom scss in every website theme (without file extension ".scss") +# website_theme_scss = "portal_dashboard/public/scss/website" + +# include js, css files in header of web form +# webform_include_js = {"doctype": "public/js/doctype.js"} +# webform_include_css = {"doctype": "public/css/doctype.css"} + +# include js in page +# page_js = {"page" : "public/js/file.js"} + +# include js in doctype views +# doctype_js = {"doctype" : "public/js/doctype.js"} +# doctype_list_js = {"doctype" : "public/js/doctype_list.js"} +# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} +# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} + +# Home Pages +# ---------- + +# application home page (will override Website Settings) +# home_page = "login" + +# website user home page (by Role) +# role_home_page = { +# "Role": "home_page" +# } + +# Generators +# ---------- + +# automatically create page for each record of this doctype +# website_generators = ["Web Page"] + +# Jinja +# ---------- + +# add methods and filters to jinja environment +# jinja = { +# "methods": "portal_dashboard.utils.jinja_methods", +# "filters": "portal_dashboard.utils.jinja_filters" +# } + +# Installation +# ------------ + +# before_install = "portal_dashboard.install.before_install" +# after_install = "portal_dashboard.install.after_install" + +# Uninstallation +# ------------ + +# before_uninstall = "portal_dashboard.uninstall.before_uninstall" +# after_uninstall = "portal_dashboard.uninstall.after_uninstall" + +# Integration Setup +# ------------------ +# To set up dependencies/integrations with other apps +# Name of the app being installed is passed as an argument + +# before_app_install = "portal_dashboard.utils.before_app_install" +# after_app_install = "portal_dashboard.utils.after_app_install" + +# Integration Cleanup +# ------------------- +# To clean up dependencies/integrations with other apps +# Name of the app being uninstalled is passed as an argument + +# before_app_uninstall = "portal_dashboard.utils.before_app_uninstall" +# after_app_uninstall = "portal_dashboard.utils.after_app_uninstall" + +# Desk Notifications +# ------------------ +# See frappe.core.notifications.get_notification_config + +# notification_config = "portal_dashboard.notifications.get_notification_config" + +# Permissions +# ----------- +# Permissions evaluated in scripted ways + +# permission_query_conditions = { +# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", +# } +# +# has_permission = { +# "Event": "frappe.desk.doctype.event.event.has_permission", +# } + +# DocType Class +# --------------- +# Override standard doctype classes + +# override_doctype_class = { +# "ToDo": "custom_app.overrides.CustomToDo" +# } + +# Document Events +# --------------- +# Hook on document methods and events + +# doc_events = { +# "*": { +# "on_update": "method", +# "on_cancel": "method", +# "on_trash": "method" +# } +# } + +# Scheduled Tasks +# --------------- + +# scheduler_events = { +# "all": [ +# "portal_dashboard.tasks.all" +# ], +# "daily": [ +# "portal_dashboard.tasks.daily" +# ], +# "hourly": [ +# "portal_dashboard.tasks.hourly" +# ], +# "weekly": [ +# "portal_dashboard.tasks.weekly" +# ], +# "monthly": [ +# "portal_dashboard.tasks.monthly" +# ], +# } + +# Testing +# ------- + +# before_tests = "portal_dashboard.install.before_tests" + +# Overriding Methods +# ------------------------------ +# +# override_whitelisted_methods = { +# "frappe.desk.doctype.event.event.get_events": "portal_dashboard.event.get_events" +# } +# +# each overriding function accepts a `data` argument; +# generated from the base implementation of the doctype dashboard, +# along with any modifications made in other Frappe apps +# override_doctype_dashboards = { +# "Task": "portal_dashboard.task.get_dashboard_data" +# } + +# exempt linked doctypes from being automatically cancelled +# +# auto_cancel_exempted_doctypes = ["Auto Repeat"] + +# Ignore links to specified DocTypes when deleting documents +# ----------------------------------------------------------- + +# ignore_links_on_delete = ["Communication", "ToDo"] + +# Request Events +# ---------------- +# before_request = ["portal_dashboard.utils.before_request"] +# after_request = ["portal_dashboard.utils.after_request"] + +# Job Events +# ---------- +# before_job = ["portal_dashboard.utils.before_job"] +# after_job = ["portal_dashboard.utils.after_job"] + +# User Data Protection +# -------------------- + +# user_data_fields = [ +# { +# "doctype": "{doctype_1}", +# "filter_by": "{filter_by}", +# "redact_fields": ["{field_1}", "{field_2}"], +# "partial": 1, +# }, +# { +# "doctype": "{doctype_2}", +# "filter_by": "{filter_by}", +# "partial": 1, +# }, +# { +# "doctype": "{doctype_3}", +# "strict": False, +# }, +# { +# "doctype": "{doctype_4}" +# } +# ] + +# Authentication and authorization +# -------------------------------- + +# auth_hooks = [ +# "portal_dashboard.auth.validate" +# ] diff --git a/portal_dashboard/modules.txt b/portal_dashboard/modules.txt new file mode 100644 index 0000000..e85aa60 --- /dev/null +++ b/portal_dashboard/modules.txt @@ -0,0 +1 @@ +Portal Dashboard \ No newline at end of file diff --git a/portal_dashboard/patches.txt b/portal_dashboard/patches.txt new file mode 100644 index 0000000..e69de29 diff --git a/portal_dashboard/portal_dashboard/__init__.py b/portal_dashboard/portal_dashboard/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/portal_dashboard/public/.gitkeep b/portal_dashboard/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/portal_dashboard/templates/__init__.py b/portal_dashboard/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/portal_dashboard/templates/pages/__init__.py b/portal_dashboard/templates/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e8486a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[project] +name = "portal_dashboard" +authors = [ + { name = "Adam Moussa", email = "adam@seahaven.com"} +] +description = "A role based tile dashboard for navigation to internal resources" +requires-python = ">=3.10" +readme = "README.md" +dynamic = ["version"] +dependencies = [ + # "frappe~=15.0.0" # Installed and managed by bench. +] + +[build-system] +requires = ["flit_core >=3.4,<4"] +build-backend = "flit_core.buildapi" + +# These dependencies are only installed when developer mode is enabled +[tool.bench.dev-dependencies] +# package_name = "~=1.1.0"