@bigbinary/neeto-approvals-frontend 0.1.0 → 0.1.1
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/index.cjs.js +31 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +31 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -5486,6 +5486,36 @@ var Field = function Field(_ref) {
|
|
|
5486
5486
|
};
|
|
5487
5487
|
var Field$1 = /*#__PURE__*/React__default["default"].memo(Field);
|
|
5488
5488
|
|
|
5489
|
+
var VALID_VARIABLE_NAME_REGEX = /^[a-z](?:\w*[a-z0-9])*$/i;
|
|
5490
|
+
var TEMPLATE_FORM_INITIAL_VALUES = {
|
|
5491
|
+
name: "",
|
|
5492
|
+
description: "",
|
|
5493
|
+
visibility: "",
|
|
5494
|
+
approver: "",
|
|
5495
|
+
variables: [],
|
|
5496
|
+
message: ""
|
|
5497
|
+
};
|
|
5498
|
+
var TEMPLATE_FORM_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
5499
|
+
name: yup__namespace.string().trim().required(t$2("validations.required", {
|
|
5500
|
+
what: t$2("common.name")
|
|
5501
|
+
})),
|
|
5502
|
+
approver: yup__namespace.object().required(t$2("validations.approver")),
|
|
5503
|
+
message: yup__namespace.string().test("message", t$2("validations.required", {
|
|
5504
|
+
what: t$2("inputs.labels.message")
|
|
5505
|
+
}), function (content) {
|
|
5506
|
+
return !neetoEditor.isEditorEmpty(content);
|
|
5507
|
+
}),
|
|
5508
|
+
variables: yup__namespace.array().of(yup__namespace.object().shape({
|
|
5509
|
+
variable: yup__namespace.string().trim().required(t$2("validations.pleaseEnter_", {
|
|
5510
|
+
what: t$2("common.variable").toLocaleLowerCase()
|
|
5511
|
+
})).matches(VALID_VARIABLE_NAME_REGEX, t$2("validations.variableName"))
|
|
5512
|
+
}))
|
|
5513
|
+
});
|
|
5514
|
+
var EVERYONE_VISIBILITY = {
|
|
5515
|
+
label: t$2("select.visibility.everyone"),
|
|
5516
|
+
value: "everyone"
|
|
5517
|
+
};
|
|
5518
|
+
|
|
5489
5519
|
var MemoizedEditorContent = /*#__PURE__*/React__default["default"].memo(neetoEditor.EditorContent);
|
|
5490
5520
|
var TemplateDetails = function TemplateDetails(_ref) {
|
|
5491
5521
|
var _Object$entries;
|
|
@@ -5520,7 +5550,7 @@ var TemplateDetails = function TemplateDetails(_ref) {
|
|
|
5520
5550
|
value: approverName
|
|
5521
5551
|
}), /*#__PURE__*/React__default["default"].createElement(Field$1, {
|
|
5522
5552
|
label: t("common.visibility"),
|
|
5523
|
-
value: accessible === null || accessible === void 0 ? void 0 : accessible.label
|
|
5553
|
+
value: (accessible === null || accessible === void 0 ? void 0 : accessible.label) || EVERYONE_VISIBILITY.label
|
|
5524
5554
|
}), (_Object$entries = Object.entries(variables || {})) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (_ref2) {
|
|
5525
5555
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
5526
5556
|
variable = _ref3[0],
|
|
@@ -5540,36 +5570,6 @@ var TemplateDetails = function TemplateDetails(_ref) {
|
|
|
5540
5570
|
}))));
|
|
5541
5571
|
};
|
|
5542
5572
|
|
|
5543
|
-
var VALID_VARIABLE_NAME_REGEX = /^[a-z](?:\w*[a-z0-9])*$/i;
|
|
5544
|
-
var TEMPLATE_FORM_INITIAL_VALUES = {
|
|
5545
|
-
name: "",
|
|
5546
|
-
description: "",
|
|
5547
|
-
visibility: "",
|
|
5548
|
-
approver: "",
|
|
5549
|
-
variables: [],
|
|
5550
|
-
message: ""
|
|
5551
|
-
};
|
|
5552
|
-
var TEMPLATE_FORM_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
5553
|
-
name: yup__namespace.string().trim().required(t$2("validations.required", {
|
|
5554
|
-
what: t$2("common.name")
|
|
5555
|
-
})),
|
|
5556
|
-
approver: yup__namespace.object().required(t$2("validations.approver")),
|
|
5557
|
-
message: yup__namespace.string().test("message", t$2("validations.required", {
|
|
5558
|
-
what: t$2("inputs.labels.message")
|
|
5559
|
-
}), function (content) {
|
|
5560
|
-
return !neetoEditor.isEditorEmpty(content);
|
|
5561
|
-
}),
|
|
5562
|
-
variables: yup__namespace.array().of(yup__namespace.object().shape({
|
|
5563
|
-
variable: yup__namespace.string().trim().required(t$2("validations.pleaseEnter_", {
|
|
5564
|
-
what: t$2("common.variable").toLocaleLowerCase()
|
|
5565
|
-
})).matches(VALID_VARIABLE_NAME_REGEX, t$2("validations.variableName"))
|
|
5566
|
-
}))
|
|
5567
|
-
});
|
|
5568
|
-
var EVERYONE_VISIBILITY = {
|
|
5569
|
-
label: t$2("select.visibility.everyone"),
|
|
5570
|
-
value: "everyone"
|
|
5571
|
-
};
|
|
5572
|
-
|
|
5573
5573
|
var Menu$1 = neetoui.Dropdown.Menu,
|
|
5574
5574
|
MenuItem = neetoui.Dropdown.MenuItem;
|
|
5575
5575
|
var columnData = function columnData(_ref) {
|