biz9-logic 4.9.32 → 4.9.33

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/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='9.0.2'
1
+ VERSION='9.0.3'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -127,7 +127,11 @@ class Demo_Logic {
127
127
  let category_title_list = [];
128
128
  if(option.categorys){
129
129
  category_title_list = option.categorys.split(',');
130
+ option.category_count = category_title_list.length;
130
131
  }else{
132
+ if(!option.category_count){
133
+ option.category_count = 1;
134
+ }
131
135
  for(let a = 1;a<parseInt(option.category_count)+1;a++){
132
136
  category_title_list.push(title + " Category " +a);
133
137
  }
@@ -140,12 +144,14 @@ class Demo_Logic {
140
144
  let item_title_list = [];
141
145
  if(option.items){
142
146
  item_title_list = option.items.split(',');
147
+ option.item_count = item_title_list.length;
143
148
  }else{
144
149
  for(let b = 1;b<parseInt(option.item_count)+1;b++){
145
- item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(item.categorys.length)].category)+" "+ b);
150
+ item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(option.category_count)].category)+" "+ b);
146
151
  }
147
152
  }
148
- const cat_item = item.categorys[Num.get_id(item.categorys.length)];
153
+ for(let a = 0;a < option.item_count; a++){
154
+ const cat_item = item.categorys[Num.get_id(option.category_count)];
149
155
  if(!cat_item.items){
150
156
  cat_item.items = [];
151
157
  }
@@ -162,6 +168,7 @@ class Demo_Logic {
162
168
  child_item.note = Field_Logic.get_test_note(),
163
169
  cat_item.items.push(child_item);
164
170
  }
171
+ }
165
172
  }
166
173
  return item;
167
174
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.32",
3
+ "version": "4.9.33",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -30,7 +30,62 @@ describe("connect", () => {
30
30
  it("_connect", () => {
31
31
  series([
32
32
  function(call) {
33
- console.log('CONNECT-START');
33
+ console.log('CONNECT-CMS-DEMO-START');
34
+
35
+ let category_type = DataType.PRODUCT;
36
+ let category_count = 12;
37
+ let item_count = 500;
38
+ let category_type_title_list = ['Add On','Admin Panel','Hosting','Landing Page','Mobile','Website'];
39
+ let category_title_list = ['Beauty','Church','Fashion','Food Trucks','Health Care','Music','Pets','Services','Service Repair','Sports','Trucking'];
40
+ let item_title_list = [];
41
+ let post_type_list = [];
42
+ let val_category_title = '';
43
+ let cat_max = 0;
44
+ let option = {get_category:true,category_count:category_count,category_data_type:category_type,categorys:val_category_title?val_category_title:null,
45
+ get_item:true,item_count:item_count,item_data_type:category_type,items:null}
46
+
47
+ if(category_title_list.length >0){
48
+ cat_max = category_title_list.length;
49
+ }else{
50
+ if(category_count.length){
51
+ cat_max = category_count;
52
+ }else{
53
+ cat_max = 0;
54
+ }
55
+ }
56
+ option.item_count = item_count / cat_max;
57
+ for(const item of category_type_title_list){
58
+ post_type_list.push(
59
+ Demo_Logic.get_new_type(item,option));
60
+ }
61
+
62
+ Log.w('post_type_list',post_type_list);
63
+ //Log.w('category_type_title_list',category_type_title_list);
64
+ //Log.w('category_title_list',category_title_list);
65
+ //Log.w('option',option);
66
+
67
+ /*
68
+ let post_category_count = 0;
69
+ let post_item_count = 0;
70
+ for(const item_type of post_type_list){
71
+ for(const item_cat of item_type.categorys){
72
+ post_category_count = post_category_count+1;
73
+ if(!item_cat.items){
74
+ item_cat.items = [];
75
+ }
76
+ for(const item_item of item_cat.items){
77
+ post_item_count = post_item_count+1;
78
+ }
79
+ }
80
+ };
81
+ let data = await App_User_Data.post(Url.CMS_DEMO_POST,{data_type:category_type,type_list:post_type_list,option:option});
82
+ alert_prop.current.showValidation("Demo OK. "+ post_type_list.length + " Types "+ category_count+" Categorys "+" "+item_count+" " +" Items");
83
+ */
84
+ console.log('CONNECT-CMS-DEMO-SUCCESS');
85
+
86
+ },
87
+ function(call) {
88
+ //console.log('CONNECT-START');
34
89
  //let post_cart = Cart_Logic.get_new(DataType.PRODUCT,0,);
35
90
  //let post_cart_list = [];
36
91
  //let post_cart_item = Cart_Logic.get_new_cart_item(DataType.PRODUCT,123,post_cart.cart_number,1,30);
@@ -44,7 +99,7 @@ describe("connect", () => {
44
99
  //Log.w('post_order',Order_Logic.get_new(post_cart,{get_payment_plan:true,payment_plan:Title.ORDER_PAYMENT_PLAN_1,payment_plan_status:Title.ORDER_PAYMENT_STATUS_OPEN}));
45
100
  //Log.w('post_cart_2',Cart_Logic.get_total(post_cart));
46
101
 
47
- console.log('CONNECT-END');
102
+ //console.log('CONNECT-END');
48
103
  //call();
49
104
  },
50
105
  function(call) {