Skip to content

Commit 0d207b5

Browse files
authored
Data widgets v3.0 (#1496)
2 parents 4c040b2 + abb62b8 commit 0d207b5

File tree

294 files changed

+4524
-4279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+4524
-4279
lines changed

.github/workflows/BuildJobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
strategy:
9999
matrix:
100100
os: [ubuntu-latest, windows-latest]
101-
target: [build, release]
101+
target: [release]
102102

103103
steps:
104104
- name: Checkout

automation/run-e2e/lib/dev.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ export async function dev() {
1414

1515
const parseArgsOptions = {
1616
string: ["browser"],
17-
boolean: ["with-preps"],
17+
boolean: ["with-preps", "update-project", "setup-project"],
1818
default: {
1919
browser: "chromium",
20-
"with-preps": false
20+
"with-preps": false,
21+
"update-project": true,
22+
"setup-project": false
2123
},
2224
configuration: {
2325
// https://github.com/yargs/yargs-parser#boolean-negation
@@ -33,9 +35,11 @@ export async function dev() {
3335
process.env.PATH += `${delimiter}${packageBinariesPath}`;
3436
const options = parseArgs(process.argv.slice(2), parseArgsOptions);
3537

36-
if (options.withPreps) {
38+
if (options.withPreps || options.setupProject) {
3739
// Download test project from github
3840
await setupTestProject();
41+
}
42+
if (options.withPreps || options.updateProject) {
3943
// Run update project hook
4044
await updateTestProject();
4145

@@ -51,12 +55,10 @@ export async function dev() {
5155

5256
await enquirer.prompt({
5357
type: "confirm",
54-
name: "__ingore__",
58+
name: "__ignore__",
5559
result: () => "continue",
5660
message: "Press Enter to continue"
5761
});
58-
} else {
59-
console.log(c.yellow("Skip preparations"));
6062
}
6163

6264
const url = process.env.URL ?? "http://127.0.0.1:8080";

packages/modules/data-widgets/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Breaking changes
10+
11+
- We removing grid wide filtering in favor of new, in widget, configuration for more flexible filtering.
12+
913
## [2.32.1] DataWidgets - 2025-05-28
1014

1115
### [2.30.6] Datagrid

packages/modules/data-widgets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/data-widgets",
33
"moduleName": "Data Widgets",
4-
"version": "2.32.1",
4+
"version": "3.0.0",
55
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
66
"license": "Apache-2.0",
77
"private": true,

packages/pluggableWidgets/accessibility-helper-web/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"update-changelog": "rui-update-changelog-widget",
4141
"verify": "rui-verify-package-format"
4242
},
43+
"dependencies": {
44+
"@mendix/widget-plugin-component-kit": "workspace:*"
45+
},
4346
"devDependencies": {
4447
"@mendix/automation-utils": "workspace:*",
4548
"@mendix/eslint-config-web-widgets": "workspace:*",

packages/pluggableWidgets/area-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"dependencies": {
4141
"@mendix/shared-charts": "workspace:*",
42+
"@mendix/widget-plugin-component-kit": "workspace:*",
4243
"classnames": "^2.3.2",
4344
"plotly.js-dist-min": "^3.0.0"
4445
},

packages/pluggableWidgets/badge-button-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"verify": "rui-verify-package-format"
4343
},
4444
"dependencies": {
45+
"@mendix/widget-plugin-component-kit": "workspace:*",
4546
"classnames": "^2.3.2"
4647
},
4748
"devDependencies": {

packages/pluggableWidgets/badge-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"verify": "rui-verify-package-format"
4343
},
4444
"dependencies": {
45+
"@mendix/widget-plugin-component-kit": "workspace:*",
4546
"classnames": "^2.3.2"
4647
},
4748
"devDependencies": {

packages/pluggableWidgets/bar-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"dependencies": {
4141
"@mendix/shared-charts": "workspace:*",
42+
"@mendix/widget-plugin-component-kit": "workspace:*",
4243
"classnames": "^2.3.2",
4344
"plotly.js-dist-min": "^3.0.0"
4445
},

packages/pluggableWidgets/bubble-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"dependencies": {
4141
"@mendix/shared-charts": "workspace:*",
42+
"@mendix/widget-plugin-component-kit": "workspace:*",
4243
"classnames": "^2.3.2",
4344
"plotly.js-dist-min": "^3.0.0"
4445
},

packages/pluggableWidgets/carousel-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"verify": "rui-verify-package-format"
4343
},
4444
"dependencies": {
45+
"@mendix/widget-plugin-component-kit": "workspace:*",
4546
"@types/react-test-renderer": "^18.0.7",
4647
"classnames": "^2.3.2",
4748
"react-test-renderer": "^18.2.0",

packages/pluggableWidgets/charts-web/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"@mendix/heatmap-chart-web": "workspace:*",
5959
"@mendix/line-chart-web": "workspace:*",
6060
"@mendix/pie-doughnut-chart-web": "workspace:*",
61-
"@mendix/time-series-chart-web": "workspace:*"
61+
"@mendix/time-series-chart-web": "workspace:*",
62+
"@mendix/widget-plugin-component-kit": "workspace:*",
63+
"@mendix/widget-plugin-platform": "workspace:*"
6264
},
6365
"devDependencies": {
6466
"@mendix/automation-utils": "workspace:*",

packages/pluggableWidgets/column-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
},
4242
"dependencies": {
4343
"@mendix/shared-charts": "workspace:*",
44+
"@mendix/widget-plugin-component-kit": "workspace:*",
4445
"classnames": "^2.3.2",
4546
"plotly.js-dist-min": "^3.0.0"
4647
},

packages/pluggableWidgets/custom-chart-web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
},
4646
"dependencies": {
4747
"@mendix/shared-charts": "workspace:*",
48+
"@mendix/widget-plugin-component-kit": "workspace:*",
4849
"@mendix/widget-plugin-mobx-kit": "workspace:*",
50+
"@mendix/widget-plugin-platform": "workspace:*",
4951
"classnames": "^2.3.2",
5052
"plotly.js-dist-min": "^3.0.0"
5153
},

packages/pluggableWidgets/datagrid-date-filter-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/datagrid-date-filter-web",
33
"widgetName": "DatagridDateFilter",
4-
"version": "2.11.3",
4+
"version": "3.0.0",
55
"description": "",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",
@@ -23,7 +23,7 @@
2323
},
2424
"testProject": {
2525
"githubUrl": "https://github.com/mendix/testProjects",
26-
"branchName": "datagrid-date-filter-web/main"
26+
"branchName": "datagrid-date-filter-web/data-widgets-3.0"
2727
},
2828
"scripts": {
2929
"build": "pluggable-widgets-tools build:ts",

packages/pluggableWidgets/datagrid-date-filter-web/src/DatagridDateFilter.editorConfig.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hidePropertiesIn, hidePropertyIn, Properties } from "@mendix/pluggable-widgets-tools";
12
import {
23
betweenIcon,
34
betweenIconDark,
@@ -23,22 +24,23 @@ import {
2324
import {
2425
ContainerProps,
2526
ImageProps,
27+
structurePreviewPalette,
2628
StructurePreviewProps,
27-
text,
28-
structurePreviewPalette
29+
text
2930
} from "@mendix/widget-plugin-platform/preview/structure-preview-api";
30-
import { hidePropertiesIn, hidePropertyIn, Properties } from "@mendix/pluggable-widgets-tools";
3131

3232
import { DatagridDateFilterPreviewProps, DefaultFilterEnum } from "../typings/DatagridDateFilterProps";
3333

34-
export function getProperties(
35-
values: DatagridDateFilterPreviewProps,
36-
defaultProperties: Properties,
37-
platform: "web" | "desktop"
38-
): Properties {
34+
export function getProperties(values: DatagridDateFilterPreviewProps, defaultProperties: Properties): Properties {
3935
if (!values.adjustable) {
4036
hidePropertyIn(defaultProperties, values, "screenReaderButtonCaption");
4137
}
38+
39+
if (values.attrChoice === "auto") {
40+
hidePropertyIn(defaultProperties, values, "attributes");
41+
hidePropertyIn(defaultProperties, {} as { linkedDs: unknown }, "linkedDs");
42+
}
43+
4244
if (values.defaultFilter !== "between") {
4345
hidePropertiesIn(defaultProperties, values, [
4446
"defaultStartDate",
@@ -49,13 +51,7 @@ export function getProperties(
4951
} else {
5052
hidePropertiesIn(defaultProperties, values, ["defaultValue", "valueAttribute"]);
5153
}
52-
if (platform === "web") {
53-
if (!values.advanced) {
54-
hidePropertiesIn(defaultProperties, values, ["onChange", "valueAttribute"]);
55-
}
56-
} else {
57-
hidePropertyIn(defaultProperties, values, "advanced");
58-
}
54+
5955
return defaultProperties;
6056
}
6157

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1+
import { withFilterAPI } from "@mendix/widget-plugin-filtering/helpers/withFilterAPI";
12
import { withPreloader } from "@mendix/widget-plugin-platform/hoc/withPreloader";
23
import { createElement, ReactElement } from "react";
34
import { DatagridDateFilterContainerProps } from "../typings/DatagridDateFilterProps";
4-
import { Container } from "./components/DateFilterContainer";
5-
import { withDateFilterAPI } from "./hocs/withDateFilterAPI";
5+
import { DateFilterContainer } from "./components/DateFilterContainer";
6+
import { withLinkedDateStore } from "./hocs/withLinkedDateStore";
7+
import { withParentProvidedDateStore } from "./hocs/withParentProvidedDateStore";
68
import { isLoadingDefaultValues } from "./utils/widget-utils";
79

8-
const container = withPreloader(Container, isLoadingDefaultValues);
9-
const Widget = withDateFilterAPI(container);
10+
const Container = withPreloader(DateFilterContainer, isLoadingDefaultValues);
11+
12+
const FilterAuto = withParentProvidedDateStore(Container);
13+
14+
const FilterLinked = withFilterAPI(withLinkedDateStore(Container));
1015

1116
export default function DatagridDateFilter(props: DatagridDateFilterContainerProps): ReactElement | null {
12-
return <Widget {...props} />;
17+
if (props.attrChoice === "auto") {
18+
return <FilterAuto {...props} />;
19+
}
20+
21+
return <FilterLinked {...props} />;
1322
}

packages/pluggableWidgets/datagrid-date-filter-web/src/DatagridDateFilter.xml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,32 @@
88
<properties>
99
<propertyGroup caption="General">
1010
<propertyGroup caption="General">
11-
<property key="advanced" type="boolean" defaultValue="false">
12-
<caption>Enable advanced options</caption>
11+
<property key="attrChoice" type="enumeration" defaultValue="auto">
12+
<caption>Filter attributes</caption>
1313
<description />
14+
<enumerationValues>
15+
<enumerationValue key="auto">Auto</enumerationValue>
16+
<enumerationValue key="linked">Custom</enumerationValue>
17+
</enumerationValues>
18+
</property>
19+
<property key="linkedDs" type="datasource" isLinked="true" isList="true">
20+
<caption>Datasource to Filter</caption>
21+
<description />
22+
</property>
23+
<property key="attributes" type="object" isList="true" required="false">
24+
<caption>Attributes</caption>
25+
<description>Select the attributes that the end-user may use for filtering.</description>
26+
<properties>
27+
<propertyGroup caption="General">
28+
<property key="attribute" type="attribute" dataSource="../linkedDs" isMetaData="true" required="true">
29+
<caption>Attribute</caption>
30+
<description />
31+
<attributeTypes>
32+
<attributeType name="DateTime" />
33+
</attributeTypes>
34+
</property>
35+
</propertyGroup>
36+
</properties>
1437
</property>
1538
<property key="defaultValue" type="expression" required="false">
1639
<caption>Default value</caption>

packages/pluggableWidgets/datagrid-date-filter-web/src/components/DateFilterContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ContainerProps extends DatagridDateFilterContainerProps {
1212
parentChannelName?: string;
1313
}
1414

15-
export const Container: (props: ContainerProps) => React.ReactElement = observer(function Container(props) {
15+
export const DateFilterContainer: (props: ContainerProps) => React.ReactElement = observer(function Container(props) {
1616
const staticProps = useSetup({
1717
defaultEndValue: props.defaultEndDate?.value,
1818
defaultFilter: props.defaultFilter,

0 commit comments

Comments
 (0)