feat: changes to the note editor
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 31s
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 31s
This commit is contained in:
@@ -342,10 +342,11 @@ const canManageSpaceSettings = computed(
|
||||
authStore.hasSpacePermission(currentSpace.value, "settings.member.view"),
|
||||
);
|
||||
|
||||
const flattenCategories = (items, level = 0) =>
|
||||
const flattenCategories = (items, trail = []) =>
|
||||
items.flatMap((category) => {
|
||||
const label = `${" ".repeat(level)}${category.name}`;
|
||||
return [{ id: category.id, name: category.name, label }, ...(category.subcategories?.length ? flattenCategories(category.subcategories, level + 1) : [])];
|
||||
const nextTrail = [...trail, category.name];
|
||||
const label = nextTrail.join("/");
|
||||
return [{ id: category.id, name: category.name, label }, ...(category.subcategories?.length ? flattenCategories(category.subcategories, nextTrail) : [])];
|
||||
});
|
||||
|
||||
const categoryOptions = computed(() => flattenCategories(categoryTree.value));
|
||||
|
||||
Reference in New Issue
Block a user