= {
+ grid: t("book_properties.grid"),
+ list: t("book_properties.list"),
+ calendar: t("book_properties.calendar"),
+ table: t("book_properties.table"),
+ geoMap: t("book_properties.geo-map"),
+ board: t("book_properties.board"),
+ presentation: t("book_properties.presentation")
};
-export default function CollectionPropertiesTab({ note }: TabContext) {
- const [ viewType, setViewType ] = useNoteLabel(note, "viewType");
- const defaultViewType = (note?.type === "search" ? "list" : "grid");
- const viewTypeWithDefault = (viewType ?? defaultViewType) as ViewTypeOptions;
- const properties = bookPropertiesConfig[viewTypeWithDefault].properties;
+const isNewLayout = isExperimentalFeatureEnabled("new-layout");
- return (
-
- {note && (
- <>
-
-
- >
- )}
-
- );
+export default function CollectionPropertiesTab({ note }: TabContext) {
+ const [viewType, setViewType] = useViewType(note);
+ const properties = bookPropertiesConfig[viewType].properties;
+
+ return (
+
+ {note && (
+ <>
+ {!isNewLayout && }
+
+ >
+ )}
+
+ );
+}
+
+export function useViewType(note: FNote | null | undefined) {
+ const [ viewType, setViewType ] = useNoteLabel(note, "viewType");
+ const defaultViewType = (note?.type === "search" ? "list" : "grid");
+ const viewTypeWithDefault = (viewType ?? defaultViewType) as ViewTypeOptions;
+ return [ viewTypeWithDefault, setViewType ] as const;
}
function CollectionTypeSwitcher({ viewType, setViewType }: { viewType: string, setViewType: (newValue: string) => void }) {
@@ -148,7 +155,7 @@ function NumberPropertyView({ note, property }: { note: FNote, property: NumberP
diff --git a/apps/client/src/widgets/ribbon/RibbonDefinition.ts b/apps/client/src/widgets/ribbon/RibbonDefinition.ts
index e2779e287..d29cd181f 100644
--- a/apps/client/src/widgets/ribbon/RibbonDefinition.ts
+++ b/apps/client/src/widgets/ribbon/RibbonDefinition.ts
@@ -38,7 +38,7 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
icon: "bx bx-play",
content: ScriptTab,
activate: true,
- show: ({ note }) => note &&
+ show: ({ note }) => note && !isNewLayout &&
(note.isTriliumScript() || note.isTriliumSqlite()) &&
(note.hasLabel("executeDescription") || note.hasLabel("executeButton"))
},
@@ -60,14 +60,14 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
title: t("book_properties.book_properties"),
icon: "bx bx-book",
content: CollectionPropertiesTab,
- show: ({ note }) => note?.type === "book" || note?.type === "search",
+ show: ({ note }) => !isNewLayout && note?.type === "book" || note?.type === "search",
toggleCommand: "toggleRibbonTabBookProperties"
},
{
title: t("note_properties.info"),
icon: "bx bx-info-square",
content: NotePropertiesTab,
- show: ({ note }) => !!note?.getLabelValue("pageUrl"),
+ show: ({ note }) => !isNewLayout && !!note?.getLabelValue("pageUrl"),
activate: true
},
{
diff --git a/apps/client/src/widgets/ribbon/collection-properties-config.tsx b/apps/client/src/widgets/ribbon/collection-properties-config.tsx
index f5fa6d5f3..1f79217e9 100644
--- a/apps/client/src/widgets/ribbon/collection-properties-config.tsx
+++ b/apps/client/src/widgets/ribbon/collection-properties-config.tsx
@@ -18,7 +18,8 @@ interface BookConfig {
export interface CheckBoxProperty {
type: "checkbox",
label: string;
- bindToLabel: FilterLabelsByType
+ bindToLabel: FilterLabelsByType;
+ icon?: string;
}
export interface ButtonProperty {
@@ -40,10 +41,11 @@ export interface NumberProperty {
bindToLabel: FilterLabelsByType;
width?: number;
min?: number;
+ icon?: string;
disabled?: (note: FNote) => boolean;
}
-interface ComboBoxItem {
+export interface ComboBoxItem {
value: string;
label: string;
}
@@ -56,6 +58,7 @@ interface ComboBoxGroup {
export interface ComboBoxProperty {
type: "combobox",
label: string;
+ icon?: string;
bindToLabel: FilterLabelsByType;
/**
* The default value is used when the label is not set.
@@ -107,11 +110,13 @@ export const bookPropertiesConfig: Record = {
properties: [
{
label: t("book_properties_config.hide-weekends"),
+ icon: "bx bx-calendar-week",
type: "checkbox",
bindToLabel: "calendar:hideWeekends"
},
{
label: t("book_properties_config.display-week-numbers"),
+ icon: "bx bx-hash",
type: "checkbox",
bindToLabel: "calendar:weekNumbers"
}
@@ -121,6 +126,7 @@ export const bookPropertiesConfig: Record = {
properties: [
{
label: t("book_properties_config.map-style"),
+ icon: "bx bx-palette",
type: "combobox",
bindToLabel: "map:style",
defaultValue: DEFAULT_MAP_LAYER_NAME,
@@ -147,6 +153,7 @@ export const bookPropertiesConfig: Record = {
},
{
label: t("book_properties_config.show-scale"),
+ icon: "bx bx-ruler",
type: "checkbox",
bindToLabel: "map:scale"
}
@@ -156,6 +163,7 @@ export const bookPropertiesConfig: Record = {
properties: [
{
label: t("book_properties_config.max-nesting-depth"),
+ icon: "bx bx-subdirectory-right",
type: "number",
bindToLabel: "maxNestingDepth",
width: 65,
@@ -171,6 +179,7 @@ export const bookPropertiesConfig: Record = {
{
label: "Theme",
type: "combobox",
+ icon: "bx bx-palette",
bindToLabel: "presentation:theme",
defaultValue: DEFAULT_THEME,
options: getPresentationThemes().map(theme => ({
diff --git a/packages/commons/src/lib/attribute_names.ts b/packages/commons/src/lib/attribute_names.ts
index 0295af0b2..ebbe22123 100644
--- a/packages/commons/src/lib/attribute_names.ts
+++ b/packages/commons/src/lib/attribute_names.ts
@@ -5,6 +5,7 @@ type Labels = {
color: string;
iconClass: string;
workspaceIconClass: string;
+ executeButton: boolean;
executeDescription: string;
executeTitle: string;
limit: string; // should be probably be number