Skip to content

Commit 5aa218d

Browse files
committed
Merge branch 'development' into nc-maia-plan
2 parents 0676153 + 0c1749d commit 5aa218d

204 files changed

Lines changed: 3551 additions & 1678 deletions

File tree

Some content is hidden

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

content/en/docs/apidocs-mxsdk/apidocs/catalog/search-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,17 +232,17 @@ A successful `GET` call results in a `200` status code and a JSON response body
232232
"application": {
233233
"type": "Other",
234234
"technicalOwner": {
235-
"email": "andrej.koelewijn@mendix.com",
235+
"email": "john.doe@mendix.com",
236236
"uuid": "d9d4b5bc-ffe8-4c5c-b237-7358d01f7981",
237-
"name": "Andrej Koelewijn"
237+
"name": "John Doe"
238238
},
239239
"icon": "https://catalog.mendix.com/resources/logos/other_icon.png",
240240
"uuid": "1bed66d2-4477-39a9-9144-d0f848212f1e",
241241
"repositoryLocation": "https://sprintr.home.mendix.com/link/project/369386df-35b4-475b-a917-17adcc81c1b5",
242242
"businessOwner": {
243-
"email": "andrej.koelewijn@mendix.com",
243+
"email": "john.doe@mendix.com",
244244
"uuid": "d9d4b5bc-ffe8-4c5c-b237-7358d01f7981",
245-
"name": "Andrej Koelewijn"
245+
"name": "John Doe"
246246
},
247247
"name": "CustomerApp"
248248
},

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/pluggable-widgets/pluggable-widgets-property-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ When a `dataSource` attribute is specified and configured by the user, it is pas
441441

442442
#### XML Elements
443443

444-
`<translations>` — Allows a user to set a default value for text templates for different languages using `<translation>` elements with a `lang` attribute representing [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code of the language. Available languages are listed in the [Languages Tab](/refguide/app-settings/#languages-tab) in Studio Pro.
444+
`<translations>` — Allows a user to set a default value for text templates for different languages using `<translation>` elements with a `lang` attribute representing [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code of the language. Available languages are listed in the [Languages Tab](/refguide10/app-settings/#languages-tab) in Studio Pro.
445445

446446
#### Studio Pro UI
447447

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Though the type definition above looks complex, it is fairly simply to use becau
121121

122122
### EditableValue {#editable-value}
123123

124-
`EditableValue` is used to represent values, either an attribute or a variable, that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
124+
`EditableValue` is used to represent a value (either an attribute or a variable) that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
125125

126126
```ts
127127
export interface EditableValue<T extends AttributeValue> {
@@ -145,22 +145,67 @@ export interface EditableValue<T extends AttributeValue> {
145145

146146
A component will receive `EditableValue<X>` where `X` depends on the configured `attributeType`.
147147

148-
`status` is similar to one exposed for `DynamicValue`. It indicates if the value's loading has finished and if loading was successful. Similarly to `DynamicValue`, `EditableValue` keeps returning the previous `value` when `status` changes from `Available` to `Loading` to help a widget avoid flickering.
148+
`status` is similar to the one exposed for `DynamicValue`. It indicates if the value's loading has finished, and if loading was successful. Similarly to `DynamicValue`, `EditableValue` keeps returning the previous `value` when `status` changes from `Available` to `Loading` to help a widget avoid flickering.
149149

150150
The flag `readOnly` indicates whether a value can actually be edited. It will be true, for example, when a widget is placed inside a Data view that is not [editable](/refguide/data-view/#editable), or when a selected attribute is not editable due to [access rules](/refguide/access-rules/). The `readOnly` flag is always true when a `status` is not `ValueStatus.Available`. Any attempt to edit a value set to read-only will have no affect and incur a debug-level warning message.
151151

152152
The value can be read from the `value` field and modified using `setValue` function. Note that `setValue` returns nothing and does not guarantee that the value is changed synchronously. But when a change is propagated, a component receives a new prop reflecting the change.
153153

154-
When setting a value, a new value might not satisfy certain validation rules — for example when an attribute is selected and the new value is bigger than the underlying attribute allows. In this case, your change will affect only `value` and `displayValue` received through a prop. Your change will not be propagated to an object’s attribute and will not be visible outside of your component. The component will also receive a validation error text through the `validation` field of `EditableValue`.
154+
When setting a value, a new value might not satisfy certain validation rules — for example, when an attribute is selected and the new value is bigger than the underlying attribute allows. In this case, your change will affect only `value` and `displayValue` received through a prop. Your change will not be propagated to an object’s attribute and will not be visible outside of your component. The component will also receive a validation error text through the `validation` field of `EditableValue`.
155155

156-
It is possible for a component to extend the defined set of validation rules. A new validator a function that checks a passed value and returns a validation message string if any can be provided through the `setValidator` function. A component can have only a single custom validator. The Mendix Platform ensures that custom validators are run whenever necessary, for example when a page is being saved by an end-user. It is best practice to call `setValidator` early in a component's lifecycle — specifically in the [componentDidMount](https://en.reactjs.org/docs/react-component.html#componentdidmount) function.
156+
It is possible for a component to extend the defined set of validation rules. A new validator (a function that checks a passed value and returns a validation message string if any) can be provided through the `setValidator` function. A component can have only a single custom validator. The Mendix Platform ensures that custom validators are run whenever necessary, for example when a page is being saved by an end-user. It is best practice to call `setValidator` early in a component's lifecycle — specifically in the [componentDidMount](https://en.reactjs.org/docs/react-component.html#componentdidmount) function.
157157

158-
In practice, many client components present values as nicely formatted strings which take locale-specific settings into account. To facilitate such cases `EditableValue` exposes a field `displayValue` which is the formatted version of `value`, and a method `setTextValue` a version of `setValue` that takes care of parsing. `setTextValue` also validates that a passed value can be parsed and assigned to the target's value type. Similarly to `setValue`, a change to an invalid value will not be propagated further than the prop itself, but a `validation` is reported. Note that if a value cannot be parsed, the prop will contain only a `displayValue` string and `value` will become undefined.
158+
In practice, many client components present values as nicely formatted strings which take locale-specific settings into account. To facilitate such cases, `EditableValue` exposes a field `displayValue` (which is the formatted version of `value`), and a method `setTextValue` (a version of `setValue` that takes care of parsing). `setTextValue` also validates that a passed value can be parsed and assigned to the target's value type. Similarly to `setValue`, a change to an invalid value will not be propagated further than the prop itself, but a `validation` is reported. Note that if a value cannot be parsed, the prop will contain only a `displayValue` string and `value` will become undefined.
159159

160160
There is a way to use more the convenient `displayValue` and `setTextValue` while retaining control over the format. A component can use a `setFormatter` method passing a formatter object: an object with `format` and `parse` methods. The Mendix Platform provides a convenient way of creating such objects for simple cases. An existing formatter exposed using a `EditableValue.formatter` field can be modified using its `withConfig` method. For complex cases formatters still can be created manually. A formatter can be reset back to default settings by calling `setFormatter(undefined)`.
161161

162162
The optional field `universe` is used to indicate the set of all possible values that can be passed to a `setValue` if a set is limited. Currently, `universe` is provided only when the edited value is of the Boolean or enumeration [types](/refguide/attributes/#type).
163163

164+
### EditableFileValue {#editable-file-value}
165+
166+
`EditableFileValue` is used to represent file values, that can be changed by a pluggable widget client component and is passed only to [file](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#file). It is defined as follows:
167+
168+
```ts
169+
export interface EditableFileValue<T = FileValue> {
170+
readonly status: ValueStatus;
171+
readonly readOnly: boolean;
172+
173+
readonly validation: Option<string>;
174+
setValidator: (validator?: (value: Option<T>) => Option<string>) => void;
175+
176+
readonly value: Option<T>;
177+
setValue: (value: Option<T>) => void;
178+
}
179+
```
180+
181+
Member `status` is similar to one exposed for `DynamicValue`. It indicates if the value's loading has finished and if loading was successful. Similarly to `DynamicValue`, `EditableFileValue` keeps returning the previous `value` when `status` changes from `Available` to `Loading` to help a widget avoid flickering.
182+
183+
The flag `readOnly` indicates whether a value can actually be edited. The `readOnly` flag is always true when a `status` is not `ValueStatus.Available`. Any attempt to edit a value set to read-only will have no affect and incur a debug-level warning message.
184+
185+
The value can be read from the `value` field and modified using `setValue` function. Note that `setValue` returns nothing and does not guarantee that the value is changed synchronously. But when a change is propagated, a component receives a new prop reflecting the change.
186+
187+
When setting a value, a new value might not satisfy certain validation rules — for example when a file is selected and the new value is bigger than the underlying file allows, or the file type is not allowed. In this case, your change will affect only `value` received through a prop. Your change will not be propagated to an object and will not be visible outside of youAllowUpload (Optional)
188+
189+
This component. The component will also receive a validation error text through the `validation` field of `EditableFileValue`.
190+
191+
It is possible for a component to extend the defined set of validation rules. A new validator — a function that checks a passed value and returns a validation message string if any — can be provided through the `setValidator` function. A component can have only a single custom validator. The Mendix Platform ensures that custom validators are run whenever necessary, for example when a page is being saved by an end-user. It is best practice to call `setValidator` early in a component's lifecycle — specifically in the [componentDidMount](https://en.reactjs.org/docs/react-component.html#componentdidmount) function.
192+
193+
### EditableImageValue {#editable-image-value}
194+
195+
`EditableImageValue` is used to represent image values, that can be changed by a pluggable widget client component and is passed only to [image](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#image). It acts as an extension of [EditableFileValue](#editable-file-value) it is defined as follows:
196+
197+
```ts
198+
export interface EditableImageValue<T extends ImageValue> extends EditableFileValue<T> {
199+
setThumbnailSize: (width: Option<number>, height: Option<number>) => void;
200+
}
201+
```
202+
203+
`EditableImageValue` provides upload capabilities to [`ImageValue`](#imagevalue), similarly to how [`EditableFileValue`](#editable-file-value) for [`FileValue`](#filevalue). Also it adds `setThumbnailSize` method which enables a component to request the Mendix Platform to return an image with specific dimensions. The Mendix Platform will take care of resizing the image while keeping the aspect ratio intact. When a thumbnail size is set, the `value` field of `EditableImageValue` will contain a resized image. When a thumbnail size is not set, the `value` field will contain an original image.
204+
205+
{{% alert color="warning" %}}
206+
`EditableImageValue` does not support `NativeImage`.
207+
{{% /alert %}}
208+
164209
### ModifiableValue {#modifiable-value}
165210

166211
`ModifiableValue` is used to represent values that can be changed by a pluggable widget client component. It is passed only to [association properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#association), and is defined as follows:

0 commit comments

Comments
 (0)