Skip to content

Commit

Permalink
Merge pull request #890 from trey-wallis/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
decaf-dev authored Dec 1, 2023
2 parents 5362e0c + 89bdef7 commit adc3f83
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"fundingUrl": {
"Buymeacoffee": "https://www.buymeacoffee.com/treywallis"
},
"version": "8.15.4"
"version": "8.15.5"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-dataloom",
"version": "8.15.4",
"version": "8.15.5",
"description": "Weave together data from diverse sources into different views. Inspired by Excel Spreadsheets and Notion.so.",
"main": "main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/obsidian/modal/welcome-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class WelcomeModal extends Modal {
cardContainerEl,
"Quick start",
"Learn the basics of creating a loom",
"https://dataloom.xyz/basics/quick-start",
"https://dataloom.xyz/quick-start",
"table"
);

Expand All @@ -48,7 +48,7 @@ export default class WelcomeModal extends Modal {
cardContainerEl,
"Embedded looms",
"Learn how to embed a loom into a markdown note",
"https://dataloom.xyz/basics/embed-loom",
"https://dataloom.xyz/basics/embed-looms",
"sticky-note"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface Props {
conditionOptions: FilterCondition[];
selectedCondition: FilterCondition;
inputNode?: React.ReactNode;
useSpacer?: boolean;
onToggle: (id: string) => void;
onColumnChange: (id: string, columnId: string) => void;
onConditionChange: (id: string, value: FilterCondition) => void;
Expand All @@ -38,6 +39,7 @@ export default function FilterRow({
index,
id,
columns,
useSpacer,
isEnabled,
selectedColumnId,
selectedOperator,
Expand All @@ -53,15 +55,17 @@ export default function FilterRow({
return (
<div className="dataloom-filter-row">
<Wrap>
{index !== 0 ? (
{index !== 0 && (
<FilterOperator
id={id}
value={selectedOperator}
onChange={onOperatorChange}
/>
) : (
)}
{useSpacer && (
<div className="dataloom-filter-row__spacer"></div>
)}

<FilterColumnSelect
id={id}
columns={columns}
Expand Down
17 changes: 6 additions & 11 deletions src/react/loom-app/option-bar/filter-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Padding from "src/react/shared/padding";
import Stack from "src/react/shared/stack";
import Icon from "src/react/shared/icon";
import FilterRow from "./filter-row";
import Text from "src/react/shared/text";
import Button from "src/react/shared/button";

import ColumnNotFoundError from "src/shared/error/column-not-found-error";
Expand Down Expand Up @@ -613,6 +612,7 @@ export default function FilterMenu({
index={i}
key={id}
id={id}
useSpacer={filters.length > 1 && i === 0}
columns={columns}
selectedColumnId={columnId}
selectedCondition={condition}
Expand All @@ -628,16 +628,11 @@ export default function FilterMenu({
/>
);
})}
<Stack isHorizontal>
<Button
icon={<Icon lucideId="plus" />}
ariaLabel="Add filter"
onClick={() => onAddClick()}
/>
{filters.length === 0 && (
<Text value="No filters to display" />
)}
</Stack>
<Button
icon={<Icon lucideId="plus" />}
ariaLabel="Add filter"
onClick={() => onAddClick()}
/>
</Stack>
</Padding>
</div>
Expand Down
14 changes: 13 additions & 1 deletion src/react/loom-app/option-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,24 @@ export default function OptionBar({

function handleFilterMenuOpen() {
filterMenu.onOpen(LoomMenuLevel.ONE);
if (filters.length === 0) {
onFilterAddClick();
}
}

function handleMoreMenuOpen() {
moreMenu.onOpen(LoomMenuLevel.ONE);
}

function handleFilterDelete(id: string) {
onFilterDeleteClick(id);

//Close the menu when the last filter is deleted
if (filters.length === 1) {
filterMenu.onClose();
}
}

const activeFilters = filters.filter((filter) => filter.isEnabled);

const sortedColumns = columns.filter(
Expand Down Expand Up @@ -228,7 +240,7 @@ export default function OptionBar({
columns={columns}
filters={filters}
onUpdate={onFilterUpdate}
onDeleteClick={onFilterDeleteClick}
onDeleteClick={handleFilterDelete}
onAddClick={onFilterAddClick}
/>
</>
Expand Down
3 changes: 3 additions & 0 deletions src/react/shared/base-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface Props {
width?: number;
height?: number;
maxWidth?: number;
minWidth?: number;
maxHeight?: number;
children: React.ReactNode;
}
Expand All @@ -31,6 +32,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
position,
width = 0,
height = 0,
minWidth = 0,
maxHeight = 0,
maxWidth = 0,
children,
Expand Down Expand Up @@ -79,6 +81,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
left: numToPx(position.left),
width: width !== 0 ? numToPx(width) : "max-content",
height: height !== 0 ? numToPx(height) : "max-content",
minWidth: minWidth !== 0 ? numToPx(minWidth) : undefined,
maxWidth: maxWidth !== 0 ? numToPx(maxWidth) : undefined,
maxHeight: maxHeight !== 0 ? numToPx(maxHeight) : undefined,
overflowY: maxHeight !== 0 ? "scroll" : undefined,
Expand Down
3 changes: 3 additions & 0 deletions src/react/shared/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Props {
openDirection?: LoomMenuOpenDirection;
topOffset?: number;
leftOffset?: number;
minWidth?: number;
width?: number;
height?: number;
maxWidth?: number;
Expand All @@ -27,6 +28,7 @@ export default function Menu({
hideBorder = false,
openDirection,
position,
minWidth = 0,
width = 0,
height = 0,
leftOffset = 0,
Expand All @@ -53,6 +55,7 @@ export default function Menu({
position={position}
width={width}
height={height}
minWidth={minWidth}
maxHeight={maxHeight}
maxWidth={maxWidth}
>
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,6 @@
"8.15.1": "1.4.0",
"8.15.2": "1.4.0",
"8.15.3": "1.4.0",
"8.15.4": "1.4.0"
"8.15.4": "1.4.0",
"8.15.5": "1.4.0"
}

0 comments on commit adc3f83

Please sign in to comment.