Skip to content

Commit 476d20e

Browse files
committed
Revert allowUpload for files and images for 10.24
1 parent 2fd7cd2 commit 476d20e

8 files changed

Lines changed: 30 additions & 71 deletions

File tree

packages/pluggable-widgets-tools/CHANGELOG.md

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

99
### Added
1010

11-
- We added support for the `allowUpload` attribute on image properties in native widgets, generating `EditableImageValue<NativeImage>` when enabled, introduced in Mendix 11.11.
12-
13-
- We added support for single object datasource properties, introduced in Mendix 11.11.
14-
1511
- We added the `audit` command. It will scan the dependencies of pluggable-widgets-tools for vulnerable packages and suggest overrides. Currently only npm is supported.
1612

17-
- We added support for editable image and file properties, introduced in Mendix 11.8.
18-
1913
### Changed
2014

2115
- We replaced `ts-jest` with `@swc/jest` as the Jest transform (3–5× faster for TSX-heavy test suites) and switched the test runner from `jest-jasmine2` to `jest-circus`.

packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export interface Property {
5151
isDefault?: string;
5252
dataSource?: string;
5353
onChange?: string;
54-
allowUpload?: string;
5554
};
5655
caption?: string[];
5756
category?: string[];

packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/file.ts

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export const fileInput = `<?xml version="1.0" encoding="utf-8"?>
2-
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true"
3-
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
2+
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true"
3+
pluginWidget="true"
4+
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
56
<properties>
67
<propertyGroup caption="General">
78
<property key="file" type="file">
@@ -12,22 +13,14 @@ export const fileInput = `<?xml version="1.0" encoding="utf-8"?>
1213
<caption>File 2</caption>
1314
<description />
1415
</property>
15-
<property key="file3" type="file" allowUpload="true">
16-
<caption>File 3</caption>
17-
<description />
18-
</property>
19-
<property key="file4" type="file" allowUpload="true" required="false">
20-
<caption>File 4</caption>
21-
<description />
22-
</property>
2316
</propertyGroup>
2417
<propertyGroup caption="Actions">
2518
<property key="description" type="attribute">
2619
<caption>Action</caption>
2720
<description />
2821
<attributeTypes>
29-
<attributeType name="String"/>
30-
</attributeTypes>
22+
<attributeType name="String" />
23+
</attributeTypes>
3124
</property>
3225
<property key="action" type="action">
3326
<caption>Action</caption>
@@ -42,13 +35,13 @@ export const fileInput = `<?xml version="1.0" encoding="utf-8"?>
4235
</propertyGroup>
4336
</properties>
4437
</widget>`;
45-
4638
export const fileInputNative = `<?xml version="1.0" encoding="utf-8"?>
47-
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" supportedPlatform="Native"
48-
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49-
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
39+
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true"
40+
pluginWidget="true" supportedPlatform="Native"
41+
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
42+
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
5043
<properties>
51-
<propertyGroup caption="General">
44+
<propertyGroup caption="General">
5245
<property key="file" type="file">
5346
<caption>File</caption>
5447
<description />
@@ -57,22 +50,14 @@ export const fileInputNative = `<?xml version="1.0" encoding="utf-8"?>
5750
<caption>File 2</caption>
5851
<description />
5952
</property>
60-
<property key="file3" type="file" allowUpload="true">
61-
<caption>File 3</caption>
62-
<description />
63-
</property>
64-
<property key="file4" type="file" allowUpload="true" required="false">
65-
<caption>File 4</caption>
66-
<description />
67-
</property>
6853
</propertyGroup>
6954
<propertyGroup caption="Actions">
7055
<property key="description" type="attribute">
7156
<caption>Action</caption>
7257
<description />
7358
<attributeTypes>
74-
<attributeType name="String"/>
75-
</attributeTypes>
59+
<attributeType name="String" />
60+
</attributeTypes>
7661
</property>
7762
<property key="action" type="action">
7863
<caption>Action</caption>

packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/image.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export const imageWebInput = `<?xml version="1.0" encoding="utf-8"?>
2-
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true"
3-
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
2+
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true"
3+
pluginWidget="true"
4+
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
56
<properties>
67
<propertyGroup caption="General">
78
<property key="image" type="image">
@@ -12,18 +13,14 @@ export const imageWebInput = `<?xml version="1.0" encoding="utf-8"?>
1213
<caption>Image 2</caption>
1314
<description />
1415
</property>
15-
<property key="image3" type="image" allowUpload="true">
16-
<caption>Image 3</caption>
17-
<description />
18-
</property>
1916
</propertyGroup>
2017
<propertyGroup caption="Actions">
2118
<property key="description" type="attribute">
2219
<caption>Action</caption>
2320
<description />
2421
<attributeTypes>
25-
<attributeType name="String"/>
26-
</attributeTypes>
22+
<attributeType name="String" />
23+
</attributeTypes>
2724
</property>
2825
<property key="action" type="action">
2926
<caption>Action</caption>
@@ -38,13 +35,13 @@ export const imageWebInput = `<?xml version="1.0" encoding="utf-8"?>
3835
</propertyGroup>
3936
</properties>
4037
</widget>`;
41-
4238
export const imageNativeInput = `<?xml version="1.0" encoding="utf-8"?>
43-
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" supportedPlatform="Native"
44-
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
45-
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
39+
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true"
40+
pluginWidget="true" supportedPlatform="Native"
41+
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
42+
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd">
4643
<properties>
47-
<propertyGroup caption="General">
44+
<propertyGroup caption="General">
4845
<property key="image" type="image">
4946
<caption>Image</caption>
5047
<description />
@@ -53,18 +50,14 @@ export const imageNativeInput = `<?xml version="1.0" encoding="utf-8"?>
5350
<caption>Image 2</caption>
5451
<description />
5552
</property>
56-
<property key="image3" type="image" allowUpload="true">
57-
<caption>Image 3</caption>
58-
<description />
59-
</property>
6053
</propertyGroup>
6154
<propertyGroup caption="Actions">
6255
<property key="description" type="attribute">
6356
<caption>Action</caption>
6457
<description />
6558
<attributeTypes>
66-
<attributeType name="String"/>
67-
</attributeTypes>
59+
<attributeType name="String" />
60+
</attributeTypes>
6861
</property>
6962
<property key="action" type="action">
7063
<caption>Action</caption>

packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/file.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ export const fileWebOutput = `/**
33
* WARNING: All changes made to this file will be overwritten
44
* @author Mendix Widgets Framework Team
55
*/
6-
import { ActionValue, DynamicValue, EditableFileValue, EditableValue, FileValue } from "mendix";
6+
import { ActionValue, DynamicValue, EditableValue, FileValue } from "mendix";
77
88
export interface MyWidgetContainerProps {
99
name: string;
1010
tabIndex?: number;
1111
id: string;
1212
file: DynamicValue<FileValue>;
1313
file2?: DynamicValue<FileValue>;
14-
file3: EditableFileValue;
15-
file4?: EditableFileValue;
1614
description: EditableValue<string>;
1715
action?: ActionValue;
1816
}
@@ -23,8 +21,6 @@ export interface MyWidgetPreviewProps {
2321
translate: (text: string) => string;
2422
file: string;
2523
file2: string;
26-
file3: string;
27-
file4: string;
2824
description: string;
2925
action: {} | null;
3026
}
@@ -34,8 +30,6 @@ export const fileNativeOutput = `export interface MyWidgetProps<Style> {
3430
style: Style[];
3531
file: DynamicValue<FileValue>;
3632
file2?: DynamicValue<FileValue>;
37-
file3: EditableFileValue;
38-
file4?: EditableFileValue;
3933
description: EditableValue<string>;
4034
action?: ActionValue;
4135
}`;

packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/image.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ export const imageWebOutput = `/**
33
* WARNING: All changes made to this file will be overwritten
44
* @author Mendix Widgets Framework Team
55
*/
6-
import { ActionValue, DynamicValue, EditableImageValue, EditableValue, WebImage } from "mendix";
6+
import { ActionValue, DynamicValue, EditableValue, WebImage } from "mendix";
77
88
export interface MyWidgetContainerProps {
99
name: string;
1010
tabIndex?: number;
1111
id: string;
1212
image: DynamicValue<WebImage>;
1313
image2?: DynamicValue<WebImage>;
14-
image3: EditableImageValue<WebImage>;
1514
description: EditableValue<string>;
1615
action?: ActionValue;
1716
}
@@ -22,7 +21,6 @@ export interface MyWidgetPreviewProps {
2221
translate: (text: string) => string;
2322
image: { type: "static"; imageUrl: string; } | { type: "dynamic"; entity: string; } | null;
2423
image2: { type: "static"; imageUrl: string; } | { type: "dynamic"; entity: string; } | null;
25-
image3: { type: "static"; imageUrl: string; } | { type: "dynamic"; entity: string; } | null;
2624
description: string;
2725
action: {} | null;
2826
}
@@ -32,7 +30,6 @@ export const imageNativeOutput = `export interface MyWidgetProps<Style> {
3230
style: Style[];
3331
image: DynamicValue<NativeImage>;
3432
image2?: DynamicValue<NativeImage>;
35-
image3: EditableImageValue<NativeImage>;
3633
description: EditableValue<string>;
3734
action?: ActionValue;
3835
}`;

packages/pluggable-widgets-tools/src/typings-generator/generate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const importableModules = [
1010
"AssociationMetaData",
1111
"AttributeMetaData",
1212
"DynamicValue",
13-
"EditableFileValue",
14-
"EditableImageValue",
1513
"EditableListValue",
1614
"EditableValue",
1715
"FileValue",

packages/pluggable-widgets-tools/src/typings-generator/generateClientTypes.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ function toClientPropType(
139139
case "icon":
140140
return isNative ? "DynamicValue<NativeIcon>" : "DynamicValue<WebIcon>";
141141
case "image":
142-
const imageType = isNative ? "NativeImage" : "WebImage";
143-
return `${prop.$.allowUpload === "true" ? "EditableImageValue" : "DynamicValue"}<${imageType}>`;
142+
return isNative ? "DynamicValue<NativeImage>" : "DynamicValue<WebImage>";
144143
case "file":
145-
return prop.$.allowUpload ? "EditableFileValue" : "DynamicValue<FileValue>";
144+
return "DynamicValue<FileValue>";
146145
case "datasource":
147146
return "ListValue";
148147
case "attribute": {

0 commit comments

Comments
 (0)