@bigbinary/neeto-rules-frontend 2.5.18 → 2.5.20
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/dist/NeetoRules.js +2 -2
- package/dist/NeetoRulesForm.js +20 -10
- package/dist/NeetoRulesForm.js.map +1 -1
- package/dist/RulesReorder.js +2 -2
- package/dist/cjs/NeetoRules.js +2 -2
- package/dist/cjs/NeetoRulesForm.js +20 -10
- package/dist/cjs/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/RulesReorder.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/{index-CLPY1JDg.js → index-C0i4jsZ5.js} +2 -2
- package/dist/{index-CLPY1JDg.js.map → index-C0i4jsZ5.js.map} +1 -1
- package/dist/{index-85QKD0q0.js → index-CQs1hVC3.js} +2 -2
- package/dist/{index-85QKD0q0.js.map → index-CQs1hVC3.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{useAutomationRulesApi-Dex5R8oY.js → useAutomationRulesApi-BTjEL2XD.js} +18 -15
- package/dist/useAutomationRulesApi-BTjEL2XD.js.map +1 -0
- package/dist/{useAutomationRulesApi-CVgffrQW.js → useAutomationRulesApi-BxBbjNga.js} +18 -15
- package/dist/useAutomationRulesApi-BxBbjNga.js.map +1 -0
- package/package.json +5 -5
- package/dist/useAutomationRulesApi-CVgffrQW.js.map +0 -1
- package/dist/useAutomationRulesApi-Dex5R8oY.js.map +0 -1
package/dist/NeetoRules.js
CHANGED
|
@@ -5,8 +5,8 @@ import { truncate, removeBy, isNotEmpty, isPresent } from '@bigbinary/neeto-cist
|
|
|
5
5
|
import { DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
6
6
|
import { withT, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
7
|
import Container from '@bigbinary/neeto-molecules/Container';
|
|
8
|
-
import { b as useUpdateAutomationRule, c as useCloneAutomationRule, d as useDeleteAutomationRule, u as useFetchAutomationRules } from './useAutomationRulesApi-
|
|
9
|
-
import { R as RulesReorder, I as INITIAL_RULES_DATA } from './index-
|
|
8
|
+
import { b as useUpdateAutomationRule, c as useCloneAutomationRule, d as useDeleteAutomationRule, u as useFetchAutomationRules } from './useAutomationRulesApi-BxBbjNga.js';
|
|
9
|
+
import { R as RulesReorder, I as INITIAL_RULES_DATA } from './index-C0i4jsZ5.js';
|
|
10
10
|
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
11
11
|
import Button from '@bigbinary/neetoui/Button';
|
|
12
12
|
import { c as createRoutes, u as useUtilityStore } from './useUtilityStore-BcSUEW_u.js';
|
package/dist/NeetoRulesForm.js
CHANGED
|
@@ -60,7 +60,7 @@ import Container from '@bigbinary/neeto-molecules/Container';
|
|
|
60
60
|
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
61
61
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
62
62
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
63
|
-
import { b as useUpdateAutomationRule, e as
|
|
63
|
+
import { b as useUpdateAutomationRule, e as useFetchNameGenerationStatus } from './useAutomationRulesApi-BxBbjNga.js';
|
|
64
64
|
import Switch$1 from '@bigbinary/neetoui/Switch';
|
|
65
65
|
import { u as useCustomDataStore } from './useCustomDataStore-B1qHMIGJ.js';
|
|
66
66
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
@@ -6208,7 +6208,7 @@ var usePollRuleName = function usePollRuleName(_ref) {
|
|
|
6208
6208
|
}
|
|
6209
6209
|
}),
|
|
6210
6210
|
updateRule = _useUpdateAutomationR.mutate;
|
|
6211
|
-
var
|
|
6211
|
+
var _useFetchNameGenerati = useFetchNameGenerationStatus({
|
|
6212
6212
|
url: url,
|
|
6213
6213
|
id: rule === null || rule === void 0 ? void 0 : rule.id
|
|
6214
6214
|
}, {
|
|
@@ -6218,17 +6218,17 @@ var usePollRuleName = function usePollRuleName(_ref) {
|
|
|
6218
6218
|
return (_query$state$data = query.state.data) !== null && _query$state$data !== void 0 && (_query$state$data = _query$state$data.rule) !== null && _query$state$data !== void 0 && _query$state$data.isDefaultName ? POLL_RETRY_COUNT : false;
|
|
6219
6219
|
}
|
|
6220
6220
|
}),
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6221
|
+
_useFetchNameGenerati2 = _useFetchNameGenerati.data,
|
|
6222
|
+
_useFetchNameGenerati3 = _useFetchNameGenerati2 === void 0 ? {} : _useFetchNameGenerati2,
|
|
6223
|
+
ruleNameStatus = _useFetchNameGenerati3.rule;
|
|
6224
6224
|
useEffect(function () {
|
|
6225
|
-
if (!
|
|
6226
|
-
formikRef.current.setFieldValue("name.value",
|
|
6225
|
+
if (!ruleNameStatus || ruleNameStatus !== null && ruleNameStatus !== void 0 && ruleNameStatus.isDefaultName) return;
|
|
6226
|
+
formikRef.current.setFieldValue("name.value", ruleNameStatus.name);
|
|
6227
6227
|
setIsGeneratingName(false);
|
|
6228
6228
|
setTimeout(function () {
|
|
6229
|
-
resolverRef.current(
|
|
6229
|
+
resolverRef.current(ruleNameStatus.name);
|
|
6230
6230
|
}, 1000);
|
|
6231
|
-
}, [
|
|
6231
|
+
}, [ruleNameStatus === null || ruleNameStatus === void 0 ? void 0 : ruleNameStatus.name]);
|
|
6232
6232
|
var waitForGeneratedRuleName = useCallback(function (rule) {
|
|
6233
6233
|
if (!rule || !(rule !== null && rule !== void 0 && rule.isDefaultName)) return rule;
|
|
6234
6234
|
setRule(rule);
|
|
@@ -6319,8 +6319,14 @@ var TouchErrors = function TouchErrors() {
|
|
|
6319
6319
|
|
|
6320
6320
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6321
6321
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6322
|
+
var getOpenAIPayload = function getOpenAIPayload() {
|
|
6323
|
+
return Array.from(document.querySelectorAll(".neeto-rules-main-card")).map(function (e) {
|
|
6324
|
+
return e.innerText;
|
|
6325
|
+
}).join("\n");
|
|
6326
|
+
};
|
|
6322
6327
|
var buildPayload = function buildPayload(data, values) {
|
|
6323
6328
|
return Object.keys(data).reduce(function (acc, key) {
|
|
6329
|
+
var _fieldValue2;
|
|
6324
6330
|
var fieldValue = values[key].value;
|
|
6325
6331
|
if (Array.isArray(fieldValue)) {
|
|
6326
6332
|
var _values$key;
|
|
@@ -6335,7 +6341,11 @@ var buildPayload = function buildPayload(data, values) {
|
|
|
6335
6341
|
}
|
|
6336
6342
|
fieldValue = [].concat(_toConsumableArray(fieldValue), _toConsumableArray(((_values$key = values[key]) === null || _values$key === void 0 ? void 0 : _values$key.deleted) || []));
|
|
6337
6343
|
}
|
|
6338
|
-
|
|
6344
|
+
acc[key] = fieldValue;
|
|
6345
|
+
if (key === "name" && !((_fieldValue2 = fieldValue) !== null && _fieldValue2 !== void 0 && _fieldValue2.trim())) {
|
|
6346
|
+
acc.openaiPayload = getOpenAIPayload();
|
|
6347
|
+
}
|
|
6348
|
+
return acc;
|
|
6339
6349
|
}, {});
|
|
6340
6350
|
};
|
|
6341
6351
|
var formatData = function formatData(data) {
|