Skip to content

Commit 92c217c

Browse files
committed
ModelBuilder: The showParameter event has a new origin parameter and don't show the edit button for non-user parameters
1 parent f28c29f commit 92c217c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- `ModelBuilder`: The `showParameter` event has a new `origin` parameter
12+
13+
### Fixed
14+
15+
- `ModelBuilder`: Don't show the edit button for non-user parameters
16+
917
## [2.12.0] - 2022-11-30
1018

1119
### Added

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,12 @@ Show a process (graph) nicely visualized, includes support for basic editing.
508508
- `namespace` (string): Namespace of the process
509509
- `showCollection(id)`: Providing this event will enable a button on each collection so that user can click it to get more details. This event is fired when the user has clicked the button. The UI can then show the collection details to the user.
510510
- `id` (string): ID of a collection to show
511-
- `showParameter(parameter)`: Providing this event will enable a button on each parameter so that user can click it to get more details about the parameter and its schema. This event is fired when the user has clicked the button. The UI can then show the parameter details to the user.
511+
- `showParameter(parameter, origin)`: Providing this event will enable a button on each parameter so that user can click it to get more details about the parameter and its schema. This event is fired when the user has clicked the button. The UI can then show the parameter details to the user.
512512
- `parameter` (object): A process parameter compliant to the openEO API.
513+
- `origin` (string): Indicates who made the parameter available:
514+
- `user` if the parameter has been added by the user
515+
- `schema` if the parameter is coming from the parent process
516+
- Might return other values in the future.
513517
- `editParameter(parameter, title, saveCallback)`: Providing this event will enable a button on each parameter so that user can click it to edit the parameter. This event is fired when the user has clicked the button. The UI can then show the parameter editor to the user.
514518
- `parameter` (object): A process parameter compliant to the openEO API.
515519
- `editArguments(parameters, values, title, isEditable, selectParameterName , saveCallback, parentBlock)`: Providing this event will enable a button on each block so that user can click it to get more details about the parameters and corresponding values. This event is fired when the user has clicked the button. The UI can then show the parameter viewer or editor to the user.

components/model-builder/Block.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export default {
255255
},
256256
allowsParameterChange() {
257257
if (this.isParameter) {
258-
return this.state.editable && !!this.$parent.supports('editParameter');
258+
return this.state.editable && this.origin !== 'schema' && !!this.$parent.supports('editParameter');
259259
}
260260
else {
261261
return this.parameters.filter(p => p.isEditable()).length > 0;
@@ -444,7 +444,7 @@ export default {
444444
this.$parent.$emit('showCollection', this.collectionId);
445445
}
446446
else if (this.isParameter) {
447-
this.$parent.$emit('showParameter', this.spec);
447+
this.$parent.$emit('showParameter', this.spec, this.origin);
448448
}
449449
else {
450450
this.$parent.$emit('showProcess', this.processId, this.namespace);

0 commit comments

Comments
 (0)