biz9-logic 4.8.31 → 4.8.32

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.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +23 -8
  3. package/package.json +1 -1
  4. package/test.js +24 -24
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='5.1.1'
1
+ VERSION='5.1.2'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -128,7 +128,7 @@ class Page_Logic {
128
128
  option = Field_Logic.get_option(DataType.PAGE,option?option:{});
129
129
  let item_list = [];
130
130
  for(let a=0;a<option.page_count;a++){
131
- item_list.push(Page_Logic.get_test("Page " +parseInt(a+1),option));
131
+ item_list.push(Page_Logic.get_test( "Page " +parseInt(a+1)? !option.get_blank : "",option));
132
132
  }
133
133
  return item_list;
134
134
  }
@@ -342,19 +342,27 @@ class Event_Logic {
342
342
  }
343
343
  class Field_Logic {
344
344
  static get_test = (title,option) =>{
345
+ let sub_note = "Sub Note "+String(Number.get_id());
346
+ let note = "Note "+String(Number.get_id());
345
347
  if(!option){
346
348
  option= {};
347
349
  }
348
350
  if(!option.category_title){
349
351
  option.category_title = 'Category '+String(Number.get_id());
350
352
  }
353
+ if(option.get_blank == true){
354
+ title = "";
355
+ sub_note = "";
356
+ note = "";
357
+ option.category_title = "";
358
+ }
351
359
  let item = {
352
360
  title:title,
353
361
  setting_visible:"1",
354
362
  title_url:Str.get_title_url(title),
355
363
  category:option.category_title,
356
- sub_note:"Sub Note "+String(Number.get_id()),
357
- note:"Note "+String(Number.get_id())
364
+ sub_note:sub_note,
365
+ note:note
358
366
  }
359
367
  if(option.get_value){
360
368
  item = Field_Logic.get_value_list(item,option);
@@ -363,9 +371,15 @@ class Field_Logic {
363
371
  }
364
372
  static get_value_list(item,option){
365
373
  for(let b=0;b<option.value_count;b++){
366
- item['value_'+String(b+1)] = 'value ' + String(b+1);
367
- item['field_'+String(b+1)] = Str.get_title_url(item['value_'+String(b+1)]);
368
- item[Str.get_title_url('value ' + String(b+1))] = item.title + ' value ' + String(b+1);
374
+ if(option.get_blank == false){
375
+ item['value_'+String(b+1)] = 'value ' + String(b+1);
376
+ item['field_'+String(b+1)] = Str.get_title_url(item['value_'+String(b+1)]);
377
+ item[Str.get_title_url('value ' + String(b+1))] = item.title + ' value ' + String(b+1);
378
+ }else{
379
+ item['value_'+String(b+1)] = "";
380
+ item['field_'+String(b+1)] = "";
381
+ item[Str.get_title_url('value ' + String(b+1))] ="";
382
+ }
369
383
  }
370
384
  return item;
371
385
  };
@@ -390,9 +404,7 @@ class Field_Logic {
390
404
  option.get_product = req.query.get_product?String(req.query.get_product)=='true': false;
391
405
  option.get_service = req.query.get_service?String(req.query.get_service)=='true': false;
392
406
  option.get_team = req.query.get_team?String(req.query.get_team)=='true': false;
393
-
394
407
  return option;
395
-
396
408
  }
397
409
  static get_option(data_type,option){
398
410
  if(!data_type){
@@ -425,6 +437,9 @@ class Field_Logic {
425
437
  if(!option.category_title){
426
438
  option.category_title=null;
427
439
  }
440
+ if(!option.get_blank){
441
+ option.get_blank=false;
442
+ }
428
443
  if(option.data_type==DataType.PAGE){
429
444
  if(!option.page_count){
430
445
  option.page_count=9;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.31",
3
+ "version": "4.8.32",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -31,22 +31,40 @@ describe("connect", () => {
31
31
  series([
32
32
 
33
33
  function(call) {
34
- console.log('GET-URL-START');
34
+ //console.log('GET-URL-START');
35
35
  //let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
36
36
  //let action_url = 'test_get_url';
37
37
  //let params = '&myparam1=p1&myparam2=p2'
38
38
  //let data_type = DataType.PRODUCT;
39
39
  //let id = "123";
40
- let cloud_url = Page_Url.home(biz9_config);
41
- console.log(biz9_config);
40
+ //let cloud_url = Page_Url.home(biz9_config);
41
+ //console.log(biz9_config);
42
42
  //let cloud_url = Category_Url.get_page(biz9_config,'cool');
43
43
  //let cloud_url = Category_Url.get_page(biz9_config,'cool');
44
- Log.w('cloud_url',cloud_url);
45
- console.log('GET-URL-SUCCESS');
46
- //call()
44
+ //Log.w('cloud_url',cloud_url);
45
+ //console.log('GET-URL-SUCCESS');
46
+ call();
47
47
  },
48
48
 
49
49
  function(call) {
50
+ /* --PAGE--START */
51
+ //let page = Page_Logic.get_test()
52
+ //let page = Page_Logic.get_test("Page "+Number.get_id())
53
+ let page = Page_Logic.get_test("Page "+Number.get_id(),{get_value:true,value_count:5,get_section:false,section_count:2})
54
+ Log.w("page",page);
55
+ //Log.w("page_section_1",page.section_1);
56
+ //Log.w("page_section_6",page.section_6.items);
57
+ //Log.w("page_section_1_section_1",page.section_1.section_1);
58
+ //let page_list = Page_Logic.get_test_list({page_count:10});
59
+ //Log.w("Page_list",page_list);
60
+ /*
61
+ let page = Page.get_test({item_count:9,page_count:19,get_item:true,get_value:true})
62
+ //let page = Page.get_test()
63
+ Log.w("Page_section_1_section_1_section_1",page.section_1.section_1.section_1);
64
+ */
65
+ /* --PAGE--END */
66
+
67
+
50
68
  /* --TEAM--START */
51
69
  //let team = Team_Logic.get_test()
52
70
  //let team = Team_Logic.get_test("Team 1",{get_value:true,get_member:true})
@@ -144,24 +162,6 @@ describe("connect", () => {
144
162
  /* --PRODUCT--END */
145
163
 
146
164
 
147
- /* --PAGE--START */
148
- console.log(PageType.get_title(PageType.BLOG_POST));
149
- //let page = Page_Logic.get_test()
150
- //let page = Page_Logic.get_test("Page "+Number.get_id())
151
- //let page = Page_Logic.get_test("Page "+Number.get_id(),{get_value:true,value_count:5,get_section:true,section_count:20})
152
- //Log.w("page",page);
153
- //Log.w("page_section_1",page.section_1);
154
- //Log.w("page_section_6",page.section_6.items);
155
- //Log.w("page_section_1_section_1",page.section_1.section_1);
156
- //let page_list = Page_Logic.get_test_list({page_count:10});
157
- //Log.w("Page_list",page_list);
158
- /*
159
- let page = Page.get_test({item_count:9,page_count:19,get_item:true,get_value:true})
160
- //let page = Page.get_test()
161
- Log.w("Page_section_1_section_1_section_1",page.section_1.section_1.section_1);
162
- */
163
- /* --PAGE--END */
164
-
165
165
 
166
166
  /* --ITEM-TEST--START */
167
167
  //let item = Item_Logic.get_test("Item_" +Number.get_id(),DataType.SERVICE,0);