owl-cli 6.91.0 → 6.92.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,32 @@ 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.push(mapping);
79
+ }
80
+ }
81
+ if(propMappings.length>0){
82
+ var s = JSON.stringify(propMappings);
83
+ s = s.replace("[", "");
84
+ s = s.replace("]","");
85
+ return "," + s;
86
+ }
87
+ return "";
88
+
89
+
90
+
91
+
92
+ }
67
93
  function processOwl(owl, outdir, templatePath, buildType, inputFile) {
68
94
  var projectCode = getProjectCode(owl)
69
95
  var projectName = getProjectName(owl)
@@ -128,6 +154,7 @@ function processOwl(owl, outdir, templatePath, buildType, inputFile) {
128
154
  fileContent = fileContent.replace(/@meta/g, JSON.stringify(meta))
129
155
  fileContent = fileContent.replace(/@formSpecs/g, JSON.stringify(formSpecs))
130
156
  fileContent = fileContent.replace(/@flattenedSpecs/g, JSON.stringify(flattenedSpecs))
157
+ fileContent = fileContent.replace(/@fieldMappings/g, getIndexMapping(flattenedSpecs));
131
158
  fileContent = fileContent.replace(/@desktopDistDir/g, desktopDistDir)
132
159
  fileContent = fileContent.replace(/@idFunc/g, idFunc)
133
160
  fileContent = fileContent.replace(/@idOrig/g, id)
@@ -44,6 +44,7 @@
44
44
  "owl_createTime":{
45
45
  "type":"date"
46
46
  }
47
+ @fieldMappings
47
48
  }
48
49
  },
49
50
  "aliases" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "6.91.0",
3
+ "version": "6.92.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {