biz9-logic 10.0.59 → 10.0.61

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='10.6.0'
1
+ VERSION='10.6.2'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main'
package/index.js CHANGED
@@ -995,7 +995,12 @@ class User_Logic {
995
995
  ];
996
996
  };
997
997
  static get_user_role_by_type(type){
998
- return User_Logic.get_user_roles().find(item_find => item_find.value === type);
998
+ let item_match = User_Logic.get_user_roles().find(item_find => item_find.value === type);
999
+ if(item_match){
1000
+ return item_match;
1001
+ }else{
1002
+ return {value:Type.DATA_BLANK,label:'Blank User',title:'Blank User'};
1003
+ }
999
1004
  };
1000
1005
  static get_country_state_city(item){
1001
1006
  let country_state_city = "";
@@ -1059,7 +1064,7 @@ class Data_Logic {
1059
1064
  static get_new = (data_type,id,option) => {
1060
1065
  return Data_Logic.get(data_type,id,option);
1061
1066
  };
1062
- // --> options / test / test_blank / title / generate_title / count
1067
+ // --> options / test / blank / title / generate_title / count
1063
1068
  static get = (data_type,id,option) => {
1064
1069
  function get_test_data(data_type){
1065
1070
  switch(data_type)
@@ -1095,7 +1100,11 @@ class Data_Logic {
1095
1100
  if(option.test){
1096
1101
  data = Obj.merge(get_test_data(data_type),data);
1097
1102
  }
1098
- if(option.test_blank){
1103
+ if(option.title){
1104
+ data[Type.FIELD_TITLE_URL] = option.title;
1105
+ data[Type.FIELD_TITLE] = Str.get_title_url(option.title);
1106
+ }
1107
+ if(option.blank){
1099
1108
  for(const field in data){
1100
1109
  if(field != Type.FIELD_ID && field != Type.FIELD_DATA_TYPE){
1101
1110
  data[field] = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "10.0.59",
3
+ "version": "10.0.61",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const series = require('async-series');
2
- const {Type,App_Logic,Data_Logic} = require('./index');
2
+ const {Type,App_Logic,Data_Logic,User_Logic} = require('./index');
3
3
  const {Log,Num,Str,Obj} = require('biz9-utility');
4
4
  const {Scriptz}= require('biz9-scriptz');
5
5
 
@@ -32,12 +32,13 @@ describe("connect", () => {
32
32
  function(call) {
33
33
  console.log('CONNECT-BASE-START');
34
34
  // -->
35
- let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0);
35
+ //let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0);
36
+ let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0,{test:true,title:'cool'});
36
37
  // -->
37
38
  //let join = App_Logic.get_join({},'','',{});
38
39
  // -->
39
40
  //let data = Data_Logic.get(Type.DATA_BLANK,0,{test:true});
40
- let data = Data_Logic.get(Type.DATA_PRODUCT,0,{test:true,count:1,parent:parent,data:{title:'cool',title_url:'cool'}});
41
+ //let data = Data_Logic.get(Type.DATA_PRODUCT,0,{test:true,count:1,parent:parent,data:{title:'cool',title_url:'cool'}});
41
42
  //let data = Data_Logic.get(Type.DATA_BLANK,0,{title:'cool bean',data:{field_1:'field_1',field_2:'field_2'}});
42
43
  //let data = Data_Logic.get(Type.DATA_BLANK,0,{title:'cool bean'});
43
44
  //let data = Data_Logic.get(Type.DATA_BLANK,0,{data:{field_1:'field_1',field_2:'field_2'}});
@@ -49,8 +50,9 @@ describe("connect", () => {
49
50
  // -->
50
51
  //let data_items = Type.get_app_links();
51
52
  // -->
52
- Log.w('99_result_data',data);
53
- //Log.w('99_result_parent',parent);
53
+ //let data = User_Logic.get_user_role_by_type(Type.USER_ROLE_USER);
54
+ //Log.w('99_result_data',data.label);
55
+ Log.w('99_result_parent',parent);
54
56
  //Log.w('99_result_data_items',data_items);
55
57
 
56
58
  //Log.w('Title',Type.get_title(Type.ORDER_STATUS_NEW));