Skip to content

Commit 8c1ed07

Browse files
authored
0.14.0. (#42)
1 parent 5193dc9 commit 8c1ed07

21 files changed

+56
-23
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.14.0
2+
3+
From now, the nullable any variable editor and the nullable variable editor display the expected variable types to select. This version also allows changes to the labels in the dropdown menu of the dynamic value editor.
4+
15
## 0.13.2
26

37
This version adds missing translations for the `variableDefinitions` value editor.

demos/webpack-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"sequential-workflow-model": "^0.2.0",
1919
"sequential-workflow-designer": "^0.21.2",
2020
"sequential-workflow-machine": "^0.4.0",
21-
"sequential-workflow-editor-model": "^0.13.2",
22-
"sequential-workflow-editor": "^0.13.2"
21+
"sequential-workflow-editor-model": "^0.14.0",
22+
"sequential-workflow-editor": "^0.14.0"
2323
},
2424
"devDependencies": {
2525
"ts-loader": "^9.4.2",

demos/webpack-app/src/editors/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export class App {
4747
});
4848

4949
if (location.hash) {
50-
const type = location.hash.substring(1);
51-
const step = designer.getDefinition().sequence.find(s => s.type === type);
50+
const type = location.hash.substring(1).toLowerCase();
51+
const step = designer.getDefinition().sequence.find(s => s.type.toLowerCase() === type);
5252
if (step) {
5353
designer.selectStepById(step.id);
5454
}

docs/I18N-KEYS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ This document lists all the I18N keys used in the Sequential Workflow Editor.
2121
"generatedString.differentValue": "Generator returns different value than the current value",
2222
"nullableAnyVariable.invalidVariableType": "The variable :name has invalid type",
2323
"nullableAnyVariable.select": "- Select -",
24+
"nullableAnyVariable.selectTypes": "- Select: :types -",
2425
"nullableAnyVariable.variableIsLost": "The variable :name is lost",
2526
"nullableAnyVariable.variableIsRequired": "The variable is required",
26-
"nullableVariable.select": "- Select -",
27+
"nullableVariable.selectType": "- Select: :type -",
2728
"nullableVariable.variableIsLost": "The variable :name is not found",
2829
"nullableVariable.variableIsRequired": "The variable is required",
2930
"nullableVariableDefinition.expectedType": "Variable type must be :type",

editor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor",
3-
"version": "0.13.2",
3+
"version": "0.14.0",
44
"type": "module",
55
"main": "./lib/esm/index.js",
66
"types": "./lib/index.d.ts",
@@ -46,11 +46,11 @@
4646
"prettier:fix": "prettier --write ./src ./css"
4747
},
4848
"dependencies": {
49-
"sequential-workflow-editor-model": "^0.13.2",
49+
"sequential-workflow-editor-model": "^0.14.0",
5050
"sequential-workflow-model": "^0.2.0"
5151
},
5252
"peerDependencies": {
53-
"sequential-workflow-editor-model": "^0.13.2",
53+
"sequential-workflow-editor-model": "^0.14.0",
5454
"sequential-workflow-model": "^0.2.0"
5555
},
5656
"devDependencies": {

editor/src/value-editors/nullable-any-variable/nullable-any-variable-editor.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ export function nullableAnyVariableValueEditor(
3535
const select = selectComponent({
3636
stretched: true
3737
});
38-
select.setValues([
39-
context.i18n('nullableAnyVariable.select', '- Select -'),
40-
...variables.map(variable => formatVariableNameWithType(variable.name, variable.type))
41-
]);
38+
39+
const expectedTypes = context.model.configuration.valueTypes ? context.model.configuration.valueTypes.join(', ') : null;
40+
const actionText = expectedTypes
41+
? context.i18n('nullableAnyVariable.selectTypes', '- Select: :types -', {
42+
types: expectedTypes
43+
})
44+
: context.i18n('nullableAnyVariable.select', '- Select -');
45+
46+
select.setValues([actionText, ...variables.map(variable => formatVariableNameWithType(variable.name, variable.type))]);
4247
if (startValue) {
4348
select.selectIndex(variables.findIndex(variable => variable.name === startValue.name) + 1);
4449
} else {

editor/src/value-editors/nullable-variable/nullable-variable-value-editor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export function nullableVariableValueEditor(context: ValueContext<NullableVariab
3232
stretched: true
3333
});
3434
select.setValues([
35-
context.i18n('nullableVariable.select', '- Select -'),
35+
context.i18n('nullableVariable.selectType', '- Select: :type -', {
36+
type: context.model.configuration.valueType
37+
}),
3638
...variables.map(variable => formatVariableNameWithType(variable.name, variable.type))
3739
]);
3840
if (startValue) {

model/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor-model",
3-
"version": "0.13.2",
3+
"version": "0.14.0",
44
"homepage": "https://nocode-js.com/",
55
"author": {
66
"name": "NoCode JS",

model/src/value-models/any-variables/any-variables-value-model.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { AnyVariables, ValueType } from '../../types';
44
import { ValueContext } from '../../context';
55

66
export interface AnyVariablesValueModelConfiguration {
7+
label?: string;
78
valueTypes?: ValueType[];
9+
editorId?: string;
810
}
911

1012
export type AnyVariablesValueModel = ValueModel<AnyVariables, AnyVariablesValueModelConfiguration>;
@@ -16,7 +18,8 @@ export const createAnyVariablesValueModel = (
1618
): ValueModelFactoryFromModel<AnyVariablesValueModel> => ({
1719
create: (path: Path) => ({
1820
id: anyVariablesValueModelId,
19-
label: 'Variables',
21+
label: configuration.label ?? 'Variables',
22+
editorId: configuration.editorId,
2023
path,
2124
configuration,
2225
getDefaultValue() {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export interface BooleanValueModelConfiguration {
2+
label?: string;
23
defaultValue?: boolean;
34
editorId?: string;
45
}

0 commit comments

Comments
 (0)