@itilite/iui-user-management 0.2.2 → 0.2.4

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.
@@ -2850,8 +2850,11 @@ var personalInfo = [{
2850
2850
  readOnly: false,
2851
2851
  placeholder: 'Enter first and middle name',
2852
2852
  validation: {
2853
- regexOnChange: /^[a-zA-Z ]*$/,
2854
- regexOnBlur: null,
2853
+ regexOnChange: null,
2854
+ regexOnBlur: [{
2855
+ regex: /^[a-zA-Z ]*$/,
2856
+ message: 'Only alphabets are allowed.'
2857
+ }],
2855
2858
  maxLimit: '',
2856
2859
  minLimit: '',
2857
2860
  maxLength: 100,
@@ -2869,8 +2872,11 @@ var personalInfo = [{
2869
2872
  readOnly: false,
2870
2873
  placeholder: 'Enter last name',
2871
2874
  validation: {
2872
- regexOnChange: /^[a-zA-Z ]*$/,
2873
- regexOnBlur: null,
2875
+ regexOnChange: null,
2876
+ regexOnBlur: [{
2877
+ regex: /^[a-zA-Z ]*$/,
2878
+ message: 'Only alphabets are allowed.'
2879
+ }],
2874
2880
  maxLimit: '',
2875
2881
  minLimit: '',
2876
2882
  maxLength: 100,
@@ -2889,7 +2895,10 @@ var personalInfo = [{
2889
2895
  placeholder: 'Enter email address',
2890
2896
  validation: {
2891
2897
  regexOnChange: null,
2892
- regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
2898
+ regexOnBlur: [{
2899
+ regex: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
2900
+ message: 'Invalid email address'
2901
+ }],
2893
2902
  maxLimit: '',
2894
2903
  minLimit: '',
2895
2904
  maxLength: 100,
@@ -2981,7 +2990,7 @@ var workInfo = [{
2981
2990
  value: 'employee_level',
2982
2991
  component: /*#__PURE__*/React.createElement(IUITypography, {
2983
2992
  className: "iui__font--color-link iui__font--weight-500"
2984
- }, "+ Add Employee Level"),
2993
+ }, "+ Add employee level"),
2985
2994
  callback: null
2986
2995
  }
2987
2996
  }, {
@@ -2995,8 +3004,11 @@ var workInfo = [{
2995
3004
  readOnly: false,
2996
3005
  placeholder: 'Enter employee ID',
2997
3006
  validation: {
2998
- regexOnChange: /^[A-Za-z0-9]*$/,
2999
- regexOnBlur: null,
3007
+ regexOnChange: null,
3008
+ regexOnBlur: [{
3009
+ regex: /^[A-Za-z0-9]*$/,
3010
+ message: 'Only alphabets & numbers are allowed'
3011
+ }],
3000
3012
  maxLimit: '',
3001
3013
  minLimit: '',
3002
3014
  maxLength: 100,
@@ -3023,7 +3035,7 @@ var workInfo = [{
3023
3035
  value: 'entity',
3024
3036
  component: /*#__PURE__*/React.createElement(IUITypography, {
3025
3037
  className: "iui__font--color-link iui__font--weight-500"
3026
- }, "+ Add Entity"),
3038
+ }, "+ Add entity"),
3027
3039
  callback: null
3028
3040
  }
3029
3041
  }, {
@@ -3045,7 +3057,7 @@ var workInfo = [{
3045
3057
  value: 'business_unit',
3046
3058
  component: /*#__PURE__*/React.createElement(IUITypography, {
3047
3059
  className: "iui__font--color-link iui__font--weight-500"
3048
- }, "+ Add Business Unit"),
3060
+ }, "+ Add business unit"),
3049
3061
  callback: null
3050
3062
  }
3051
3063
  }, {
@@ -3067,7 +3079,7 @@ var workInfo = [{
3067
3079
  value: 'department',
3068
3080
  component: /*#__PURE__*/React.createElement(IUITypography, {
3069
3081
  className: "iui__font--color-link iui__font--weight-500"
3070
- }, "+ Add Department"),
3082
+ }, "+ Add department"),
3071
3083
  callback: null
3072
3084
  }
3073
3085
  }, {
@@ -3081,8 +3093,14 @@ var workInfo = [{
3081
3093
  readOnly: false,
3082
3094
  placeholder: 'Enter designation',
3083
3095
  validation: {
3084
- regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
3085
- regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
3096
+ regexOnChange: null,
3097
+ regexOnBlur: [{
3098
+ regex: /^[A-Za-z0-9 -.&'()]*$/,
3099
+ message: "Only alphabets, numbers & special characters . & ' () - are allowed."
3100
+ }, {
3101
+ regex: /^[a-zA-Z]/,
3102
+ message: 'Designation should start with alphabets'
3103
+ }],
3086
3104
  maxLimit: '',
3087
3105
  minLimit: '',
3088
3106
  maxLength: 100,
@@ -3100,8 +3118,14 @@ var workInfo = [{
3100
3118
  visibility: true,
3101
3119
  readOnly: false,
3102
3120
  validation: {
3103
- regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
3104
- regexOnBlur: null,
3121
+ regexOnChange: null,
3122
+ regexOnBlur: [{
3123
+ regex: /^[A-Za-z0-9 -.&'()]*$/,
3124
+ message: "Only alphabets, numbers & special characters . & ' () - are allowed."
3125
+ }, {
3126
+ regex: /^[a-zA-Z]/,
3127
+ message: 'Base location should start with alphabets'
3128
+ }],
3105
3129
  maxLimit: '',
3106
3130
  minLimit: '',
3107
3131
  maxLength: 500,
@@ -3332,8 +3356,11 @@ var passportInfo = [{
3332
3356
  readOnly: false,
3333
3357
  placeholder: 'Enter passport number',
3334
3358
  validation: {
3335
- regexOnChange: /^[A-Za-z0-9]*$/,
3336
- regexOnBlur: null,
3359
+ regexOnChange: null,
3360
+ regexOnBlur: [{
3361
+ regex: /^[A-Za-z0-9]*$/,
3362
+ message: 'Only alphabets & numbers are allowed'
3363
+ }],
3337
3364
  maxLimit: '',
3338
3365
  minLimit: '',
3339
3366
  maxLength: 15,
@@ -5149,16 +5176,11 @@ var UserAddEdit = function UserAddEdit(props) {
5149
5176
  } else if (id === 'department') {
5150
5177
  title = 'Department';
5151
5178
  } else if (id === 'business_unit') {
5152
- title = 'Business Unit';
5179
+ title = 'Business unit';
5153
5180
  } else if (id === 'employee_level') {
5154
- title = 'Employee Level';
5181
+ title = 'Employee level';
5155
5182
  }
5156
5183
 
5157
- console.log(_extends({}, addModalData, {
5158
- isOpen: true,
5159
- title: title,
5160
- id: id
5161
- }));
5162
5184
  setAddModalData(_extends({}, addModalData, {
5163
5185
  isOpen: true,
5164
5186
  title: title,
@@ -5180,7 +5202,6 @@ var UserAddEdit = function UserAddEdit(props) {
5180
5202
  })).then(function (res) {
5181
5203
  var _extends2;
5182
5204
 
5183
- console.log(res, "success add " + addModalData.title + " response");
5184
5205
  setAddModalData(_extends({}, addModalData, {
5185
5206
  isOpen: false
5186
5207
  }));
@@ -5190,11 +5211,9 @@ var UserAddEdit = function UserAddEdit(props) {
5190
5211
  value: res.data.value,
5191
5212
  label: res.data.label
5192
5213
  }, _extends2)));
5193
- console.log('Set new value', res.data.label);
5194
5214
  clearCacheForAsyncDropdown(function (prevState) {
5195
5215
  var _extends3;
5196
5216
 
5197
- console.log('ClearCache function called');
5198
5217
  return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
5199
5218
  });
5200
5219
  dispatch(stopLoader());
@@ -5457,7 +5476,7 @@ var UserAddEdit = function UserAddEdit(props) {
5457
5476
  if ((_name === 'passport_photo' || _name === 'travel_docs') && _obj.openFile === true) {
5458
5477
  if (_obj.file.isExistingFile) {
5459
5478
  var link = document.createElement('a');
5460
- link.setAttribute('download', _obj.file.name);
5479
+ link.setAttribute('target', '_blank');
5461
5480
  link.href = _obj.file.presigned_url;
5462
5481
  document.body.appendChild(link);
5463
5482
  link.click();
@@ -5471,7 +5490,7 @@ var UserAddEdit = function UserAddEdit(props) {
5471
5490
  })).then(function (res) {
5472
5491
  dispatch(stopLoader());
5473
5492
  var link = document.createElement('a');
5474
- link.setAttribute('download', _obj.file.returned_file_name);
5493
+ link.setAttribute('target', '_blank');
5475
5494
  link.href = res.data.presigned_url;
5476
5495
  document.body.appendChild(link);
5477
5496
  link.click();