awing-library 2.1.93-beta → 2.1.95-beta

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.
@@ -46,10 +46,8 @@ var react_i18next_1 = require("react-i18next");
46
46
  var recoil_1 = require("recoil");
47
47
  var AWING_1 = require("../../../AWING");
48
48
  var Recoils_1 = require("./Recoils");
49
- var Hooks_1 = __importDefault(require("../Hooks"));
50
49
  var i18n_1 = __importDefault(require("../../../i18n"));
51
50
  var Infomation = function () {
52
- var service = (0, Hooks_1.default)().service;
53
51
  var directories = (0, recoil_1.useRecoilValue)(Recoils_1.directoriesState);
54
52
  var attributes = (0, recoil_1.useRecoilValue)(Recoils_1.attributesState);
55
53
  var _a = (0, recoil_1.useRecoilState)(Recoils_1.campaignState), campaign = _a[0], setCampaign = _a[1];
@@ -65,12 +63,6 @@ var Infomation = function () {
65
63
  }
66
64
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
65
  }, [directories]);
68
- (0, react_1.useEffect)(function () {
69
- if (!service.attributesGetByObjectTypeCode) {
70
- setCampaignAttributes([""]);
71
- }
72
- // eslint-disable-next-line react-hooks/exhaustive-deps
73
- }, [service]);
74
66
  var handleUpdate = (0, react_1.useCallback)(function (obj, formValid, fieldUpdate) {
75
67
  if (fieldUpdate) {
76
68
  if (fieldUpdate === 'attributeIds') {
@@ -100,6 +92,7 @@ var Infomation = function () {
100
92
  fieldName: 'name',
101
93
  type: 'text',
102
94
  label: t('Campaign.Name'),
95
+ pattern: false,
103
96
  required: true,
104
97
  },
105
98
  ];
@@ -76,6 +76,12 @@ var CreateOrEdit = function () {
76
76
  ? Constant_1.Constants.CAMPAIGN_CLONE
77
77
  : Constant_1.Constants.CAMPAIGN_CREATE;
78
78
  }, [location.pathname, campaignId]);
79
+ (0, react_1.useEffect)(function () {
80
+ if (!service.attributesGetByObjectTypeCode && !campaignData.campaignAttributes.length) {
81
+ setCampaignData(function (prev) { return (__assign(__assign({}, prev), { campaignAttributes: [""] })); });
82
+ }
83
+ // eslint-disable-next-line react-hooks/exhaustive-deps
84
+ }, [service, campaignData.campaignAttributes]);
79
85
  (0, react_1.useEffect)(function () {
80
86
  setLoading(true);
81
87
  Promise.all([getCampaignData(), getPage()]).finally(function () {
@@ -117,7 +117,7 @@ function attributesValid(value) {
117
117
  exports.attributesValid = attributesValid;
118
118
  function tabInfomationValid(campaign, campaignAttributes) {
119
119
  return (directoryValid(campaign.directoryId) &&
120
- (0, validation_1.textValidation)(campaign.name, 200).valid &&
120
+ (0, validation_1.textValidation)(campaign.name, 200, true, false).valid &&
121
121
  attributesValid(campaignAttributes));
122
122
  }
123
123
  exports.tabInfomationValid = tabInfomationValid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.93-beta",
3
+ "version": "2.1.95-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",