owl-cli 6.91.0 → 6.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/dsl.js
CHANGED
|
@@ -153,6 +153,7 @@ function flattenFormSpecs(formSpec) {
|
|
|
153
153
|
var flattened = {
|
|
154
154
|
mainFields: [],
|
|
155
155
|
details: [],
|
|
156
|
+
allFields:[]
|
|
156
157
|
}
|
|
157
158
|
tranverseFields(formSpec, (field, ctx) => {
|
|
158
159
|
if (ctx.parentField && ctx.parentField._ft == 'array') {
|
|
@@ -178,6 +179,7 @@ function flattenFormSpecs(formSpec) {
|
|
|
178
179
|
else {
|
|
179
180
|
flattened.mainFields.push(field)
|
|
180
181
|
}
|
|
182
|
+
flattened.allFields.push(field);
|
|
181
183
|
}, {})
|
|
182
184
|
|
|
183
185
|
flattened.mainFields.sort((f1, f2) => {
|
package/bin/owl.js
CHANGED
|
@@ -64,6 +64,30 @@ function mkdir(path) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
function getIndexMapping(flatternedSpecs){
|
|
68
|
+
var allFields = flatternedSpecs.allFields;
|
|
69
|
+
var propMappings = {};
|
|
70
|
+
for(var i=0; i<allFields.length; i++){
|
|
71
|
+
var field = allFields[i];
|
|
72
|
+
if(field.fieldType == 'date'){
|
|
73
|
+
var mapping = {
|
|
74
|
+
}
|
|
75
|
+
mapping[field.key] = {
|
|
76
|
+
"type":"date"
|
|
77
|
+
}
|
|
78
|
+
propMappings[field.key] = {
|
|
79
|
+
"type":"date"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if(propMappings.length>0){
|
|
84
|
+
var s = JSON.stringify(propMappings);
|
|
85
|
+
s = s.substring(1);
|
|
86
|
+
s = s.substring(0,s.length-1);
|
|
87
|
+
return "," + s;
|
|
88
|
+
}
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
67
91
|
function processOwl(owl, outdir, templatePath, buildType, inputFile) {
|
|
68
92
|
var projectCode = getProjectCode(owl)
|
|
69
93
|
var projectName = getProjectName(owl)
|
|
@@ -128,6 +152,7 @@ function processOwl(owl, outdir, templatePath, buildType, inputFile) {
|
|
|
128
152
|
fileContent = fileContent.replace(/@meta/g, JSON.stringify(meta))
|
|
129
153
|
fileContent = fileContent.replace(/@formSpecs/g, JSON.stringify(formSpecs))
|
|
130
154
|
fileContent = fileContent.replace(/@flattenedSpecs/g, JSON.stringify(flattenedSpecs))
|
|
155
|
+
fileContent = fileContent.replace(/@fieldMappings/g, getIndexMapping(flattenedSpecs));
|
|
131
156
|
fileContent = fileContent.replace(/@desktopDistDir/g, desktopDistDir)
|
|
132
157
|
fileContent = fileContent.replace(/@idFunc/g, idFunc)
|
|
133
158
|
fileContent = fileContent.replace(/@idOrig/g, id)
|