Skip to content

Commit f6010af

Browse files
committed
Bump 2.6.0
1 parent 0a990af commit f6010af

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "system-runtime",
3-
"version": "2.5.0",
3+
"version": "2.6.0",
44
"description": "A JavaScript library that runs systems",
55
"license": "Apache-2.0",
66
"homepage": "https://designfirst.io/systemruntime/",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "system-runtime",
3-
"version": "2.5.0",
3+
"version": "2.6.0",
44
"description": "A JavaScript library that runs systems",
55
"homepage": "https://designfirst.io/systemruntime/",
66
"keywords": [

src/metamodel.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ function merge(source, target, all) {
11321132
*/
11331133
function initConfiguration(name, type, isMethod) {
11341134
var result = null;
1135+
var typeDef = [];
1136+
var defaultValue = '';
11351137

11361138
switch (true) {
11371139
case name === '=>':
@@ -1257,19 +1259,29 @@ function initConfiguration(name, type, isMethod) {
12571259
break;
12581260
// link / custom type
12591261
case typeof type === 'string':
1262+
typeDef = $db._Type.find({
1263+
name: name
1264+
});
1265+
// case of enumeration
1266+
defaultValue = {};
1267+
if (typeDef.length) {
1268+
if (typeDef[0].value) {
1269+
defaultValue = typeDef[0].value[0];
1270+
}
1271+
}
12601272
if (isMethod) {
12611273
result = {
12621274
name: name,
12631275
type: type,
12641276
mandatory: false,
1265-
default: {}
1277+
default: defaultValue
12661278
};
12671279
} else {
12681280
result = {
12691281
type: type,
12701282
readOnly: false,
12711283
mandatory: false,
1272-
default: {}
1284+
default: defaultValue
12731285
};
12741286
}
12751287
break;
@@ -1491,8 +1503,14 @@ exports.schema = function schema(name, schema) {
14911503
var schemas = [];
14921504

14931505
if (typeof schema === 'undefined' || Object.keys(schema).length === 0) {
1494-
schema = JSON.parse(JSON.stringify(name));
1495-
schemaName = schema[NAME];
1506+
if (typeof name === 'string') {
1507+
schema = {};
1508+
schema[NAME] = name;
1509+
schemaName = name;
1510+
} else {
1511+
schema = JSON.parse(JSON.stringify(name));
1512+
schemaName = schema[NAME];
1513+
}
14961514
} else {
14971515
schema = JSON.parse(JSON.stringify(schema));
14981516
schema[NAME] = name;

src/system/system-runtime.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "system-runtime",
33
"master": false,
4-
"version": "2.5.0",
4+
"version": "2.6.0",
55
"description": "System Runtime",
66
"schemas": {
77
"1ac07185641fa9f": {
@@ -1094,7 +1094,7 @@
10941094
"_Database": { "db": { "_id": "db" } },
10951095
"_Logger": { "logger": { "_id": "logger", "level": "warn" } },
10961096
"_Metamodel": { "metamodel": { "_id": "metamodel" } },
1097-
"_Runtime": { "runtime": { "_id": "runtime", "version": "2.5.0" } }
1097+
"_Runtime": { "runtime": { "_id": "runtime", "version": "2.6.0" } }
10981098
},
10991099
"_id": "e89c617b6b15d24"
11001100
}

0 commit comments

Comments
 (0)