feat: Enhance dashboard widget configuration and introduce new widgets
- Updated the dashboard layout schema to include new widgets: DashboardGreeting, QuickWeightToday, BodyStatStrip, StatusPills, ProfileGoalsProgress, TrendKcalWeight, NutritionActivitySummary, RecoverySleepRest, and TrainingTypeDistribution. - Improved widget configuration validation to support new features, including chart days for trend and distribution widgets. - Refactored the default lab layout to align with the updated widget catalog and ensure proper default activation. - Bumped app_dashboard version to 1.6.0 to reflect the addition of new widgets and configuration enhancements.
This commit is contained in:
1 parent
c0c512e942
commit
3d498d03c1
28 files changed
+1487
-243
No files matched your search
@@ -103,6 +103,31 @@ def cmd_issues_reopen(args: argparse.Namespace, base: str, token: str, owner: st
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def cmd_issues_edit(args: argparse.Namespace, base: str, token: str, owner: str, repo: str) -> None:
|
||||
fields: dict = {}
|
||||
if args.title is not None:
|
||||
fields["title"] = args.title.strip()
|
||||
if not fields["title"]:
|
||||
sys.stderr.write("issues edit: --title darf nicht leer sein\n")
|
||||
sys.exit(2)
|
||||
body: str | None = None
|
||||
if args.body_file:
|
||||
body = Path(args.body_file).read_text(encoding="utf-8")
|
||||
elif args.body is not None:
|
||||
body = args.body
|
||||
if body is not None:
|
||||
fields["body"] = body
|
||||
if not fields:
|
||||
sys.stderr.write(
|
||||
"issues edit: mindestens eines von --title, --body oder --body-file setzen\n"
|
||||
)
|
||||
sys.exit(2)
|
||||
status, payload = issues_patch(base, token, owner, repo, args.number, fields)
|
||||
print(json.dumps(payload, indent=2, ensure_ascii=False))
|
||||
if status >= 400:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def cmd_repo_contents(args: argparse.Namespace, base: str, token: str, owner: str, repo: str) -> None:
|
||||
status, payload = repo_file_content(
|
||||
base, token, owner, repo, args.path, ref=args.ref or ""
|
||||
@@ -167,6 +192,20 @@ def main() -> None:
|
||||
p_ro.add_argument("number", type=int)
|
||||
p_ro.set_defaults(_handler=cmd_issues_reopen)
|
||||
|
||||
p_ed = i_sub.add_parser(
|
||||
"edit",
|
||||
help="Issue per PATCH ändern (Titel und/oder Beschreibung; für große Texte --body-file)",
|
||||
)
|
||||
p_ed.add_argument("number", type=int)
|
||||
p_ed.add_argument("--title", default=None, help="Neuer Titel")
|
||||
p_ed.add_argument("--body", default=None, help="Neue Beschreibung (Markdown)")
|
||||
p_ed.add_argument(
|
||||
"--body-file",
|
||||
default=None,
|
||||
help="Beschreibung aus Datei (UTF-8); überschreibt --body wenn beides gesetzt",
|
||||
)
|
||||
p_ed.set_defaults(_handler=cmd_issues_edit)
|
||||
|
||||
p_repo = sub.add_parser("repo", help="Repository (API)")
|
||||
r_sub = p_repo.add_subparsers(dest="repo_cmd", required=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user