Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Aug 20, 2023
1 parent cf2def4 commit f1fedc4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.26.7",
"version": "0.26.8",
"private": true,
"license": "ISC",
"name": "metablock",
Expand Down
4 changes: 2 additions & 2 deletions packages/metablock-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/cli",
"version": "0.26.7",
"version": "0.26.8",
"description": "A node client for interacting with metablock cloud",
"main": "dist/index.js",
"type": "module",
Expand All @@ -12,7 +12,7 @@
"author": "Quantmind",
"license": "ISC",
"dependencies": {
"@metablock/core": "^0.26.7",
"@metablock/core": "^0.26.8",
"@rollup/plugin-node-resolve": "^15.0.1",
"archiver": "^5.1.0",
"colors": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/metablock-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/core",
"version": "0.26.7",
"version": "0.26.8",
"description": "Metablock core library",
"type": "module",
"browser": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/metablock-notebook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/notebook",
"version": "0.26.7",
"version": "0.26.8",
"description": "Metablock Notebook",
"type": "module",
"browser": "dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/metablock-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/react",
"version": "0.26.7",
"version": "0.26.8",
"description": "React Components for Metablock",
"type": "module",
"browser": "dist/index.js",
Expand All @@ -22,8 +22,8 @@
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@loadable/component": "^5.14.1",
"@metablock/core": "^0.26.7",
"@metablock/notebook": "^0.26.7",
"@metablock/core": "^0.26.8",
"@metablock/notebook": "^0.26.8",
"@mui/icons-material": "~5.14.1",
"@mui/lab": "~5.0.0-alpha.50",
"@mui/material": "~5.14.1",
Expand Down
21 changes: 15 additions & 6 deletions packages/metablock-react/src/DataGrid/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import TextField from "@mui/material/TextField";
import React from "react";
import { RenderHeaderCellProps } from "react-data-grid";

interface Option {
value: string;
label: string;
}

interface HeaderFilter<R> extends RenderHeaderCellProps<R> {
sx?: Record<string, any>;
dataGridFilters: any;
Expand Down Expand Up @@ -81,7 +86,7 @@ export const DataGridSelectFilter = <R,>({
emptyOption,
...props
}: HeaderFilter<R> & {
options: string[];
options: string[] | Option[];
emptyOption?: string;
}) => {
const value = dataGridFilters.filters[column.key] || "";
Expand All @@ -99,11 +104,15 @@ export const DataGridSelectFilter = <R,>({
size="small"
onChange={handleChange}
>
{options.map((value: string, index: number) => (
<MenuItem value={value} key={index}>
{value || empty}
</MenuItem>
))}
{options.map((option: string | Option, index: number) => {
if (typeof option === "string")
option = { value: option, label: option };
return (
<MenuItem value={option.value} key={index}>
{option.label || empty}
</MenuItem>
);
})}
</TextField>
)}
</DataGridHeaderFilter>
Expand Down
8 changes: 7 additions & 1 deletion packages/metablock-react/src/DataGrid/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ export const useDataGridFilters = (

set(key: string, value: any) {
const newFilters = { ...currentFilters, [key]: value };
if (!value || !value.length) delete newFilters[key];
if (
value === null ||
value === undefined ||
value === "" ||
(Array.isArray(value) && value.length === 0)
)
delete newFilters[key];
this.setAll(newFilters);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/metablock-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/server",
"version": "0.26.7",
"version": "0.26.8",
"description": "Metablock dev server",
"main": "dist/index.js",
"license": "ISC",
Expand All @@ -12,7 +12,7 @@
"dev"
],
"dependencies": {
"@metablock/core": "^0.26.7",
"@metablock/core": "^0.26.8",
"async-lock": "^1.2.4",
"body-parser": "^1.19.0",
"btoa": "^1.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/metablock-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metablock/store",
"version": "0.26.7",
"version": "0.26.8",
"description": "Metablock MobX store",
"type": "module",
"browser": "dist/index.js",
Expand All @@ -20,7 +20,7 @@
"store"
],
"dependencies": {
"@metablock/core": "^0.26.7",
"@metablock/core": "^0.26.8",
"mobx": "^6.0.3"
},
"scripts": {
Expand Down

0 comments on commit f1fedc4

Please sign in to comment.