owl-cli 5.37.0 → 5.40.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.
@@ -1,6 +1,12 @@
1
1
  //#import session.js
2
2
  //#import $owl_backend_session:services/modelService.jsx
3
3
  //#import $owlPermission:services/permissionService.jsx
4
+ //#import $owl_orgs:services/modelService.jsx
5
+ function getParentOrgIds(orgId){
6
+ var org = owl_orgsService.get(orgId);
7
+ return org.parentPathIds;
8
+
9
+ }
4
10
 
5
11
  function checklogin(){
6
12
  var magic = $.getSystemProperty("magic");
@@ -26,7 +32,7 @@ function checklogin(){
26
32
  var loginUserId = session.userId
27
33
  var roleId = session.role;
28
34
  var orgId = session.orgId;
29
- var orgIds = session.orgIds;
35
+ var orgIds = getParentOrgIds(orgId);
30
36
  if(loginUserId){
31
37
  var env = {
32
38
  now: new Date().getTime(),
@@ -15,7 +15,7 @@ var spec = @spec;
15
15
 
16
16
  function buildSort(sort){
17
17
  if(!sort){
18
- return null;
18
+ return {};
19
19
  }
20
20
  var result = [];
21
21
  for(var k in sort){
@@ -208,7 +208,10 @@ function buildSort(sort){
208
208
 
209
209
  var objs = hits.map(function(hit){return hit._source});
210
210
 
211
-
211
+ delete query.from;
212
+ delete query.size;
213
+ delete query.sort;
214
+ sndTxt = JSON.stringify(query);
212
215
  var countUrl = elasticSearchUrl+"/@projectCode/_count";
213
216
 
214
217
  var ss = HttpUtils.postRaw( countUrl, sndTxt, headers);
@@ -43,8 +43,15 @@
43
43
 
44
44
  if (!id || action=='add') {
45
45
  //adding
46
- modelObject._orgId = orgId;
47
- modelObject._orgIds = orgIds;
46
+ if(!modelObject._orgId){
47
+ modelObject._orgId = orgId;
48
+ modelObject._orgIds = orgIds;
49
+ }
50
+ else{
51
+ modelObject._orgIds = getParentOrgIds(orgId);
52
+ }
53
+
54
+
48
55
  modelObject.m = env.m;
49
56
  var newdata = @projectCodeService.add( modelObject,env );
50
57
  }
@@ -877,7 +877,7 @@ var @projectCodeService = (function (pigeon) {
877
877
  var filters = [];
878
878
  var must_not = [{
879
879
  term:{
880
- del:'T'
880
+ "del.keyword":'T'
881
881
  }
882
882
  }];
883
883
  for(var k in searchArgs){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "5.37.0",
3
+ "version": "5.40.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {