Skip to content

Commit 7208b01

Browse files
committed
15.00.38: nw vibe
1 parent 201a9ba commit 7208b01

33 files changed

+3005
-328
lines changed

.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,16 @@
19591959
"args": ["add-cust","--project_name=../../../servers/NW_NoCust"],
19601960
"console": "integratedTerminal"
19611961
},
1962+
{
1963+
"name": " - add-graphics: Add Northwind Grpahics to NW-NoCust",
1964+
"type": "debugpy",
1965+
"request": "launch",
1966+
"cwd": "${workspaceFolder}/../../servers/NW_NoCust",
1967+
"program": "${workspaceFolder}/api_logic_server_cli/cli.py",
1968+
"redirectOutput": true,
1969+
"args": ["genai-graphics"],
1970+
"console": "integratedTerminal"
1971+
},
19621972
{
19631973
"name": " - Northwind NW_Collision_Test",
19641974
"type": "debugpy",

api_logic_server_cli/api_logic_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
Called from api_logic_server_cli.py, by instantiating the ProjectRun object.
1313
'''
1414

15-
__version__ = "15.00.37" # last public release: 15.00.36 (15.00.12)
15+
__version__ = "15.00.38" # last public release: 15.00.36 (15.00.12)
1616
recent_changes = \
1717
f'\n\nRecent Changes:\n' +\
18-
"\t07/02/2024 - 15.00.37: minor bug in mgr symlink creation, nw cards, mgr readme diagnostics, mcp printer \n"\
18+
"\t07/05/2024 - 15.00.38: nw vibe, minor bug in mgr symlink creation, nw cards, mgr readme diagnostics, mcp printer, bug[98] \n"\
1919
"\t06/30/2024 - 15.00.33: Tech Preview: genai-logic genai-add-app --vibe, bug [96, 97] \n"\
2020
"\t06/10/2024 - 15.00.12: MCP Security, win fixes for readme, graphics quotes \n"\
2121
"\t06/08/2024 - 15.00.10: MCP, optional shortening of stacktrace lines, bugfix[92] \n"\

api_logic_server_cli/genai/genai_svcs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,11 @@ def admin_app_path(request_path: Path, suffix: str) -> Path:
906906
request_path.parent.mkdir(parents=True, exist_ok=True)
907907
return request_path
908908

909-
def string_to_lines(dict_long_string: dict) -> dict:
909+
def string_to_lines(dict_long_string: list) -> dict:
910910
result = dict_long_string
911-
if isinstance(result[1]['content'], str):
912-
result[1]['content'] = result[1]['content'].split('\n')
911+
if len(result) > 1:
912+
if isinstance(result[1]['content'], str):
913+
result[1]['content'] = result[1]['content'].split('\n')
913914
return result
914915

915916
try:

api_logic_server_cli/prototypes/base/docs/training/admin_app_unused.md

Lines changed: 0 additions & 156 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
I need to enhance a React Admin supplier page to include a professional, interactive world map view that displays suppliers on a real map with proper geography. Requirements:
2+
3+
1. **Use a proper mapping library** (like Leaflet.js) - NOT custom SVG drawings
4+
2. **Real world map** with accurate geography, countries, and coastlines
5+
3. **Interactive controls**: pan, zoom, mouse wheel support
6+
4. **Clickable supplier markers** that navigate to supplier detail pages
7+
5. **Professional UI** with map legend and controls
8+
6. **Toggle between list and map view**
9+
7. **Position suppliers** by country with slight offsets to avoid overlap
10+
11+
The current supplier data has fields: Id, CompanyName, ContactName, City, Country, etc.
12+
13+
Please install the necessary mapping library dependencies and create a production-ready map component that looks professional like Google Maps, not a hand-drawn cartoon map.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Provide an option to see departments either as a list (as now), or as a tree. The tree expands to show related sub departments, as links. If I click on the dept name link, then open the department "show" to the right.
2+
3+
TECHNICAL CONSTRAINTS:
4+
5+
- Avoid recursion stack overflow: include proper termination conditions
6+
- Handle mixed data types: use parseInt() for ID comparisons
7+
- Prevent import conflicts: use aliases for Material-UI components
8+
- Verify data relationships: check actual field names in backend
9+
- Use incremental development: start simple, add complexity gradually
10+
- Test each layer: tree logic → expansion → detail panel → tabs

api_logic_server_cli/prototypes/manager/system/Manager_workspace.code-workspace

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
}
66
],
77
"settings": {
8-
"debug.console.wordWrap": false,
8+
"debug.console.wornw graphsdWrap": false,
99
"workbench.editorAssociations": {
1010
"*.md": "vscode.markdown.preview.editor"
1111
},
12-
"workbench.colorTheme": "Office Theme (Word)",
13-
"workbench.preferredLightColorTheme": "Office Theme (Word)"
12+
"workbench.colorTheme": "Office Theme (Excel)",
13+
"workbench.preferredLightColorTheme": "Office Theme (Excel)"
1414
}
1515
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import inspect
2+
import safrs
3+
import importlib
4+
import pathlib
5+
import logging as logging
6+
import flask_sqlalchemy
7+
8+
# use absolute path import for easier multi-{app,model,db} support
9+
force_import = __import__("database.database_discovery.authentication_models")
10+
database = __import__('database')
11+
app_logger = logging.getLogger(__name__)
12+
app_logger.debug("api/expose_api_models.py - endpoint for each table")
13+
14+
def add_check_sum(cls):
15+
"""
16+
Checksum decorator for each model
17+
"""
18+
@safrs.jsonapi_attr
19+
def _check_sum_(self):
20+
if isinstance(self, flask_sqlalchemy.model.DefaultMeta) or not hasattr(self, "_check_sum_property"): # property does not exist during initialization
21+
return None
22+
return self._check_sum_property
23+
24+
@_check_sum_.setter
25+
def _check_sum_(self, value):
26+
self._check_sum_property = value
27+
28+
cls.S_CheckSum = _check_sum_
29+
return cls
30+
31+
def add_service(app, api, project_dir, swagger_host: str, PORT: str, method_decorators ):
32+
""" Called by api_discovery to
33+
* expose API for each model (using introspection)
34+
35+
Args:
36+
app (_type_): _description_
37+
api (_type_): _description_
38+
project_dir (_type_): _description_
39+
swagger_host (str): _description_
40+
PORT (str): _description_
41+
method_decorators (_type_): _description_
42+
43+
Returns:
44+
_type_: _description_
45+
"""
46+
47+
# Get all the subclasses of the Base class and expose them in the api
48+
for name, obj in inspect.getmembers(database.database_discovery.authentication_models):
49+
if inspect.isclass(obj) and issubclass(obj, database.models.SAFRSBaseX) and obj is not database.models.SAFRSBaseX:
50+
app_logger.info(f"Exposing /{name}")
51+
api.expose_object(add_check_sum(obj), method_decorators= method_decorators)
52+
53+
return api
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import importlib
2+
from pathlib import Path
3+
import logging
4+
5+
app_logger = logging.getLogger(__name__)
6+
7+
def discover_services(app, api, project_dir, swagger_host: str, PORT: str):
8+
"""
9+
Discover services in the services directory
10+
"""
11+
import os
12+
method_decorators : list = []
13+
services = []
14+
services_path = Path(__file__).parent
15+
for root, dirs, files in os.walk(services_path):
16+
for file in files:
17+
if file.endswith(".py"):
18+
spec = importlib.util.spec_from_file_location("module.name", services_path.joinpath(file))
19+
if file.endswith("auto_discovery.py"):
20+
pass
21+
else:
22+
services.append(file)
23+
each_service = importlib.util.module_from_spec(spec)
24+
spec.loader.exec_module(each_service) # runs "bare" module code (e.g., initialization)
25+
each_service.add_service(app, api, project_dir, swagger_host, PORT, method_decorators) # invoke create function
26+
app.logger.info(f"..discovered services: {services}")
27+
return

0 commit comments

Comments
 (0)