11 | It's been {{ daysSinceLastPost }} days since your last post. Share your thoughts or 12 | updates to keep the conversation going. 13 |
14 |3 | Accept Invitation 4 |
5 | -------------------------------------------------------------------------------- /gameplan/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/gameplan/69025284cda530e11b2cbe9101c3243f99b44b06/gameplan/templates/pages/__init__.py -------------------------------------------------------------------------------- /gameplan/test_api.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | import frappe 5 | 6 | 7 | def whitelist(fn): 8 | if not frappe.conf.enable_ui_tests: 9 | frappe.throw("Cannot run UI tests. Set 'enable_ui_tests' in site_config.json to continue.") 10 | 11 | whitelisted = frappe.whitelist()(fn) 12 | return whitelisted 13 | 14 | 15 | @whitelist 16 | def clear_data(onboard=None): 17 | doctypes = frappe.get_all("DocType", filters={"module": "Gameplan"}, pluck="name") 18 | for doctype in doctypes: 19 | frappe.db.delete(doctype) 20 | 21 | admin = frappe.get_doc("User", "Administrator") 22 | admin.add_roles("Gameplan Admin") 23 | 24 | if not frappe.db.exists("User", "john@example.com"): 25 | frappe.get_doc( 26 | doctype="User", 27 | email="john@example.com", 28 | first_name="John", 29 | last_name="Doe", 30 | send_welcome_email=0, 31 | roles=[{"role": "Gameplan Member"}], 32 | ).insert() 33 | 34 | if not frappe.db.exists("User", "system@example.com"): 35 | frappe.get_doc( 36 | doctype="User", 37 | email="system@example.com", 38 | first_name="System", 39 | last_name="User", 40 | send_welcome_email=0, 41 | roles=[{"role": "Gameplan Admin"}, {"role": "System Manager"}], 42 | ).insert() 43 | 44 | keep_users = ["Administrator", "Guest", "john@example.com", "system@example.com"] 45 | for user in frappe.get_all("User", filters={"name": ["not in", keep_users]}): 46 | frappe.delete_doc("User", user.name) 47 | 48 | if onboard: 49 | frappe.get_doc(doctype="GP Team", title="Test Team").insert() 50 | -------------------------------------------------------------------------------- /gameplan/unsplash.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | 5 | import frappe 6 | 7 | base_url = "https://api.unsplash.com" 8 | 9 | 10 | def get_by_keyword(keyword): 11 | data = make_unsplash_request(f"/search/photos?query={keyword}") 12 | return data.get("results") 13 | 14 | 15 | def get_list(): 16 | return make_unsplash_request("/photos") 17 | 18 | 19 | def get_random(params=None): 20 | query_string = "" 21 | for key, value in params.items(): 22 | query_string += f"{key}={value}&" 23 | return make_unsplash_request(f"/photos/random?{query_string}") 24 | 25 | 26 | def make_unsplash_request(path): 27 | if "unsplash_access_key" not in frappe.conf: 28 | frappe.throw("Please set unsplash_access_key in site_config.json") 29 | 30 | import requests 31 | 32 | url = f"{base_url}{path}" 33 | print(url) 34 | res = requests.get( 35 | url, 36 | headers={ 37 | "Accept-Version": "v1", 38 | "Authorization": f"Client-ID {frappe.conf.unsplash_access_key}", 39 | }, 40 | ) 41 | res.raise_for_status() 42 | data = res.json() 43 | return data 44 | -------------------------------------------------------------------------------- /gameplan/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import * 2 | -------------------------------------------------------------------------------- /gameplan/www/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/gameplan/69025284cda530e11b2cbe9101c3243f99b44b06/gameplan/www/__init__.py -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "check-pnpm": "chmod +x ./scripts/install-pnpm.sh && ./scripts/install-pnpm.sh", 6 | "frontend:pnpm_install": "npm run check-pnpm && cd frontend && pnpm install", 7 | "postinstall": "npm run frontend:pnpm_install", 8 | "dev": "cd frontend && pnpm dev", 9 | "build": "pnpm check-pnpm && cd frontend && pnpm build", 10 | "disable-workspaces": "chmod +x ./scripts/manage_workspaces.sh && ./scripts/manage_workspaces.sh disable", 11 | "enable-workspaces": "chmod +x ./scripts/manage_workspaces.sh && ./scripts/manage_workspaces.sh enable", 12 | "upgrade-frappeui": "cd frontend && pnpm add frappe-ui@latest && cd .." 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml.disabled: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'frontend' 3 | - 'frappe-ui' -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "gameplan" 3 | authors = [ 4 | { name = "Frappe Technologies Pvt Ltd", email = "developers@frappe.io" }, 5 | ] 6 | description = "Team discussion and collaboration tool" 7 | requires-python = ">=3.10" 8 | readme = "README.md" 9 | dynamic = ["version"] 10 | dependencies = [ 11 | "rembg>=2.0.49,<2.1", 12 | "numpy==1.26.1", 13 | "onnxruntime==1.16.2", 14 | "faker==37.3.0", 15 | ] 16 | 17 | [build-system] 18 | requires = ["flit_core >=3.4,<4"] 19 | build-backend = "flit_core.buildapi" 20 | 21 | [tool.ruff] 22 | line-length = 110 23 | target-version = "py310" 24 | 25 | [tool.ruff.lint] 26 | select = ["F", "E", "W", "I", "UP", "B"] 27 | ignore = [ 28 | "F403", # can't detect undefined names from * import 29 | "W191", # indentation contains tabs 30 | ] 31 | 32 | [tool.ruff.lint.per-file-ignores] 33 | "**/demo/**" = ["E501"] # Disable line too long for demo files 34 | 35 | [tool.ruff.format] 36 | quote-style = "double" 37 | indent-style = "tab" 38 | docstring-code-format = true 39 | -------------------------------------------------------------------------------- /scripts/install-pnpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! command -v pnpm &> /dev/null 4 | then 5 | echo "pnpm could not be found, installing..." 6 | npm install -g pnpm@latest-10 7 | else 8 | echo "pnpm is already installed." 9 | fi 10 | 11 | echo "pnpm version: $(pnpm --version)" 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | --------------------------------------------------------------------------------