fix: show childless headers on admin category page

This commit is contained in:
2026-04-09 18:23:30 +03:00
parent 658f345d60
commit 7566679d99
3 changed files with 19 additions and 4 deletions

View File

@@ -309,6 +309,21 @@ test-docker:
test-frontend:
$(pnpm_cmd) vitest run
info_xsd_url=https://apps.nextcloud.com/schema/apps/info.xsd
info_xsd=$(build_tools_directory)/info.xsd
$(info_xsd):
@mkdir -p $(build_tools_directory)
curl -sS -o $(info_xsd) $(info_xsd_url)
# lint-appinfo:
# - Validate appinfo/info.xml against the Nextcloud App Store XSD schema
.PHONY: lint-appinfo
lint-appinfo: $(info_xsd)
@echo "\x1b[33mValidating appinfo/info.xml against Nextcloud schema...\x1b[0m"
@xmllint --noout --schema $(info_xsd) appinfo/info.xml
@echo "\x1b[32mappinfo/info.xml is valid.\x1b[0m"
# lint:
# - Lint JS via pnpm and PHP via composer script "lint"
.PHONY: lint

View File

@@ -20,3 +20,6 @@ pre-commit:
openapi:
glob: "*Controller.php"
run: make openapi && git add openapi.json
lint-appinfo:
glob: "appinfo/info.xml"
run: make lint-appinfo

View File

@@ -106,13 +106,10 @@ class CategoryController extends OCSController {
$categoriesByHeader[$headerId][] = $categoryData;
}
// Build result with nested categories (only include headers that have accessible categories)
// Build result with nested categories
$result = [];
foreach ($headers as $header) {
$categories = $categoriesByHeader[$header->getId()] ?? [];
if (empty($categories)) {
continue;
}
$headerData = $header->jsonSerialize();
$headerData['categories'] = $categories;
$result[] = $headerData;