@bigbinary/neeto-approvals-frontend 0.0.12 → 0.0.14
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 +13 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -13
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3876,7 +3876,7 @@ var validations$1 = {
|
|
|
3876
3876
|
name: "Please enter name",
|
|
3877
3877
|
description: "Please enter description",
|
|
3878
3878
|
visibility: "Please select visibility",
|
|
3879
|
-
|
|
3879
|
+
approver: "Please select a approver",
|
|
3880
3880
|
message: "Please enter a message",
|
|
3881
3881
|
variable: "Please enter variable"
|
|
3882
3882
|
};
|
|
@@ -3888,7 +3888,7 @@ var inputs = {
|
|
|
3888
3888
|
firstName: "First name",
|
|
3889
3889
|
lastName: "Last name",
|
|
3890
3890
|
description: "Description",
|
|
3891
|
-
|
|
3891
|
+
approver: "Approver",
|
|
3892
3892
|
variableMapping: "Variable mapping",
|
|
3893
3893
|
message: "Message"
|
|
3894
3894
|
},
|
|
@@ -4874,7 +4874,7 @@ const Form$2 = _ref => {
|
|
|
4874
4874
|
onClose: onClose
|
|
4875
4875
|
}, /*#__PURE__*/t__default.createElement(Pane.Header, null, /*#__PURE__*/t__default.createElement(Typography, {
|
|
4876
4876
|
style: "h2"
|
|
4877
|
-
}, initialData ? t("typography.
|
|
4877
|
+
}, isEmpty(initialData) ? t("typography.newApprover") : t("typography.editApprover"))), /*#__PURE__*/t__default.createElement(Form$3, {
|
|
4878
4878
|
formikProps: {
|
|
4879
4879
|
initialValues: initialData || APPROVER_FORM_INITIAL_VALUES,
|
|
4880
4880
|
validationSchema: APPROVER_FORM_VALIDATION_SCHEMA,
|
|
@@ -8689,13 +8689,13 @@ const TEMPLATE_FORM_INITIAL_VALUES = {
|
|
|
8689
8689
|
name: "",
|
|
8690
8690
|
description: "",
|
|
8691
8691
|
visibility: "",
|
|
8692
|
-
|
|
8692
|
+
approver: "",
|
|
8693
8693
|
variables: [],
|
|
8694
8694
|
message: ""
|
|
8695
8695
|
};
|
|
8696
8696
|
const TEMPLATE_FORM_VALIDATION_SCHEMA = yup.object().shape({
|
|
8697
8697
|
name: yup.string().trim().required(t$2("validations.name")),
|
|
8698
|
-
|
|
8698
|
+
approver: yup.object().required(t$2("validations.approver")),
|
|
8699
8699
|
message: yup.string().test("message", t$2("validations.message"), content => !fr(content)),
|
|
8700
8700
|
variables: yup.array().of(yup.object().shape({
|
|
8701
8701
|
variable: yup.string().trim().required(t$2("validations.variable"))
|
|
@@ -8801,8 +8801,8 @@ const Form$1 = _ref => {
|
|
|
8801
8801
|
}), /*#__PURE__*/t__default.createElement("div", {
|
|
8802
8802
|
className: "flex space-x-6"
|
|
8803
8803
|
}, /*#__PURE__*/t__default.createElement(Select, {
|
|
8804
|
-
name: "
|
|
8805
|
-
label: t("inputs.labels.
|
|
8804
|
+
name: "approver",
|
|
8805
|
+
label: t("inputs.labels.approver"),
|
|
8806
8806
|
options: approvers.map(approver => ({
|
|
8807
8807
|
label: approver.name,
|
|
8808
8808
|
value: approver.id
|
|
@@ -8829,7 +8829,7 @@ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
8829
8829
|
const buildTemplatePayload = template => {
|
|
8830
8830
|
const variables = template.variables,
|
|
8831
8831
|
visibility = template.visibility,
|
|
8832
|
-
|
|
8832
|
+
approver = template.approver;
|
|
8833
8833
|
const indexedVariables = variables.map((_ref, index) => {
|
|
8834
8834
|
let variable = _ref.variable;
|
|
8835
8835
|
return [`variable${index + 1}`, variable];
|
|
@@ -8837,7 +8837,7 @@ const buildTemplatePayload = template => {
|
|
|
8837
8837
|
const payload = {
|
|
8838
8838
|
template: _objectSpread$3(_objectSpread$3({}, template), {}, {
|
|
8839
8839
|
accessibleId: visibility.value,
|
|
8840
|
-
approverId:
|
|
8840
|
+
approverId: approver.value,
|
|
8841
8841
|
variables: fromPairs(indexedVariables)
|
|
8842
8842
|
})
|
|
8843
8843
|
};
|
|
@@ -8881,7 +8881,7 @@ const Create = _ref => {
|
|
|
8881
8881
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8882
8882
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8883
8883
|
const Edit = _ref => {
|
|
8884
|
-
var _template$
|
|
8884
|
+
var _template$approver, _template$approver2;
|
|
8885
8885
|
let approvalsPath = _ref.approvalsPath,
|
|
8886
8886
|
visibilityOptions = _ref.visibilityOptions,
|
|
8887
8887
|
templateUrl = _ref.templateUrl;
|
|
@@ -8930,9 +8930,9 @@ const Edit = _ref => {
|
|
|
8930
8930
|
isLoading: isUpdating,
|
|
8931
8931
|
initialData: _objectSpread$2(_objectSpread$2({}, template), {}, {
|
|
8932
8932
|
visibility: template.accessible.id,
|
|
8933
|
-
|
|
8934
|
-
label: (_template$
|
|
8935
|
-
value: (_template$
|
|
8933
|
+
approver: {
|
|
8934
|
+
label: (_template$approver = template.approver) === null || _template$approver === void 0 ? void 0 : _template$approver.name,
|
|
8935
|
+
value: (_template$approver2 = template.approver) === null || _template$approver2 === void 0 ? void 0 : _template$approver2.id
|
|
8936
8936
|
},
|
|
8937
8937
|
variables: Object.values(template.variables).map(variable => ({
|
|
8938
8938
|
variable
|