@bigbinary/neeto-fields-frontend 2.3.5 → 2.3.7
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/README.md +28 -23
- package/dist/FieldsDashboard.js +18 -26
- package/dist/FieldsDashboard.js.map +1 -1
- package/dist/InlineFieldValueInput.js +7 -4
- package/dist/InlineFieldValueInput.js.map +1 -1
- package/dist/cjs/FieldsDashboard.js +18 -26
- package/dist/cjs/FieldsDashboard.js.map +1 -1
- package/dist/cjs/InlineFieldValueInput.js +7 -4
- package/dist/cjs/InlineFieldValueInput.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/types.d.ts +1 -0
package/README.md
CHANGED
|
@@ -8,28 +8,28 @@ Rails engine for development.
|
|
|
8
8
|
# Contents
|
|
9
9
|
|
|
10
10
|
1. [Development with Host Application](#development-with-host-application)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
- [Engine](#engine)
|
|
12
|
+
- [Installation](#installation)
|
|
13
|
+
- [customizability](#customizability)
|
|
14
|
+
- [Frontend package](#frontend-package)
|
|
15
|
+
- [Installation](#installation-1)
|
|
16
|
+
- [Instructions for development](#instructions-for-development)
|
|
17
|
+
- [Components](#components)
|
|
18
|
+
- [FieldsDashBoard](#1-fieldsdashboard)
|
|
19
|
+
- [FieldsPane](#2-fieldspane)
|
|
20
|
+
- [FieldValuesContainer](#3-fieldvaluescontainer)
|
|
21
|
+
- [FieldInputs](#4-fieldinputs)
|
|
22
|
+
- [InlineFieldValueInput](#5-inlinefieldvalueinput)
|
|
23
|
+
- [FieldDeleteAlert](#6-fielddeletealert)
|
|
24
|
+
- [Functions](#functions)
|
|
25
|
+
- [mergeInitialValues](#1-neetofieldsutilsmergeinitialvalues)
|
|
26
|
+
- [transformValues](#2-neetofieldsutilstransformvalues)
|
|
27
|
+
- [Hooks](#hooks)
|
|
28
|
+
- [useFetchFields](#1-usefetchfields)
|
|
29
|
+
- [useShowFields](#2-useshowfield)
|
|
30
|
+
- [useCreateField](#3-usecreatefield)
|
|
31
|
+
- [useUpdateField](#4-useupdatefield)
|
|
32
|
+
- [useDestroyField](#5-usedestroyfield)
|
|
33
33
|
2. [Instructions for Publishing](#instructions-for-publishing)
|
|
34
34
|
|
|
35
35
|
## Development with Host Application
|
|
@@ -91,6 +91,9 @@ The engine is used to manage fields for any entity across neeto products.
|
|
|
91
91
|
[Owner & Resource Information](docs/engine/owner-resource-information.md) for
|
|
92
92
|
details.
|
|
93
93
|
|
|
94
|
+
7. Add the permission `neeto_fields_engine.manage_fields` to your
|
|
95
|
+
`permissions.yml` file.
|
|
96
|
+
|
|
94
97
|
#### Customizability
|
|
95
98
|
|
|
96
99
|
Refer [Engine customizability](docs/engine/customizability.md) to learn about
|
|
@@ -476,6 +479,7 @@ The `InlineFieldValueInput` component render the field value input UI.
|
|
|
476
479
|
6. `onMutate`: The callback function which is triggered on the mutations
|
|
477
480
|
7. `onMutationSuccess`: The callback function which is triggered on the success
|
|
478
481
|
of mutation functions of field value.
|
|
482
|
+
8. `canManageFieldValues`: Boolean value which specifies whether the values can be modified.
|
|
479
483
|
|
|
480
484
|
#### Usage
|
|
481
485
|
|
|
@@ -484,7 +488,7 @@ tables. The example shows one such usage of building the `columnData` for table
|
|
|
484
488
|
with inline editable field value inputs in cell.
|
|
485
489
|
|
|
486
490
|
```jsx
|
|
487
|
-
const buildColumnDataForFields = (fields, onFieldValueUpdateSuccess) =>
|
|
491
|
+
const buildColumnDataForFields = (fields, onFieldValueUpdateSuccess, canWriteForm) =>
|
|
488
492
|
fields.map(field => ({
|
|
489
493
|
dataIndex: "field.id",
|
|
490
494
|
key: field.id,
|
|
@@ -497,6 +501,7 @@ const buildColumnDataForFields = (fields, onFieldValueUpdateSuccess) =>
|
|
|
497
501
|
resourceId={user.id}
|
|
498
502
|
resourceType="users"
|
|
499
503
|
onMutationSuccess={onFieldValueUpdateSuccess}
|
|
504
|
+
canManageFieldValues={canWriteForm}
|
|
500
505
|
/>
|
|
501
506
|
),
|
|
502
507
|
}));
|
package/dist/FieldsDashboard.js
CHANGED
|
@@ -24,7 +24,6 @@ import NoData from '@bigbinary/neetoui/NoData';
|
|
|
24
24
|
import Table from '@bigbinary/neetoui/Table';
|
|
25
25
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
26
26
|
import NeetoUIHeader from '@bigbinary/neeto-molecules/Header';
|
|
27
|
-
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
28
27
|
import Button from '@bigbinary/neetoui/Button';
|
|
29
28
|
import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
|
|
30
29
|
import { unstable_batchedUpdates, createPortal } from 'react-dom';
|
|
@@ -57,18 +56,18 @@ var configsApi = {
|
|
|
57
56
|
fetchConfigs: fetchConfigs
|
|
58
57
|
};
|
|
59
58
|
|
|
60
|
-
function ownKeys$
|
|
61
|
-
function _objectSpread$
|
|
59
|
+
function ownKeys$4(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; }
|
|
60
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
62
61
|
var useFetchConfigs = function useFetchConfigs(options) {
|
|
63
|
-
return useQuery(_objectSpread$
|
|
62
|
+
return useQuery(_objectSpread$4({
|
|
64
63
|
queryKey: [QUERY_KEYS.CONFIGS],
|
|
65
64
|
queryFn: configsApi.fetchConfigs,
|
|
66
65
|
staleTime: DEFAULT_STALE_TIME
|
|
67
66
|
}, options));
|
|
68
67
|
};
|
|
69
68
|
|
|
70
|
-
function ownKeys$
|
|
71
|
-
function _objectSpread$
|
|
69
|
+
function ownKeys$3(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; }
|
|
70
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
72
71
|
var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
73
72
|
var buildColumnData = _ref.buildColumnData,
|
|
74
73
|
isOwnerBased = _ref.isOwnerBased,
|
|
@@ -191,7 +190,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
191
190
|
defaultColumns: defaultColumns
|
|
192
191
|
});
|
|
193
192
|
var handleBlockClick = function handleBlockClick(params) {
|
|
194
|
-
return handleMetaClick(history, buildUrl("", _objectSpread$
|
|
193
|
+
return handleMetaClick(history, buildUrl("", _objectSpread$3({
|
|
195
194
|
resource: resource,
|
|
196
195
|
state: state
|
|
197
196
|
}, params)));
|
|
@@ -299,8 +298,8 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
299
298
|
};
|
|
300
299
|
};
|
|
301
300
|
|
|
302
|
-
function ownKeys$
|
|
303
|
-
function _objectSpread$
|
|
301
|
+
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; }
|
|
302
|
+
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; }
|
|
304
303
|
var FieldsTable = function FieldsTable(_ref) {
|
|
305
304
|
var totalCount = _ref.totalCount,
|
|
306
305
|
isFetched = _ref.isFetched,
|
|
@@ -343,7 +342,7 @@ var FieldsTable = function FieldsTable(_ref) {
|
|
|
343
342
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
344
343
|
children: showNoDataScreen ? /*#__PURE__*/jsx("div", {
|
|
345
344
|
className: "flex h-full w-full items-center justify-center",
|
|
346
|
-
children: /*#__PURE__*/jsx(NoData, _objectSpread$
|
|
345
|
+
children: /*#__PURE__*/jsx(NoData, _objectSpread$2({
|
|
347
346
|
title: showStateFilter ? t("neetoFields.messages.noFieldsWithState", {
|
|
348
347
|
title: title,
|
|
349
348
|
state: state
|
|
@@ -360,7 +359,7 @@ var FieldsTable = function FieldsTable(_ref) {
|
|
|
360
359
|
currentPageNumber: page,
|
|
361
360
|
defaultPageSize: pageSize,
|
|
362
361
|
handlePageChange: function handlePageChange(page) {
|
|
363
|
-
return setPageProps(_objectSpread$
|
|
362
|
+
return setPageProps(_objectSpread$2(_objectSpread$2({}, pageProps), {}, {
|
|
364
363
|
page: page
|
|
365
364
|
}));
|
|
366
365
|
},
|
|
@@ -369,8 +368,6 @@ var FieldsTable = function FieldsTable(_ref) {
|
|
|
369
368
|
});
|
|
370
369
|
};
|
|
371
370
|
|
|
372
|
-
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; }
|
|
373
|
-
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; }
|
|
374
371
|
var Header = withT(function (_ref) {
|
|
375
372
|
var searchInputProps = _ref.searchInputProps,
|
|
376
373
|
breadcrumbs = _ref.breadcrumbs,
|
|
@@ -383,6 +380,7 @@ var Header = withT(function (_ref) {
|
|
|
383
380
|
return /*#__PURE__*/jsx(NeetoUIHeader, {
|
|
384
381
|
breadcrumbs: breadcrumbs,
|
|
385
382
|
size: size,
|
|
383
|
+
title: title,
|
|
386
384
|
searchProps: searchInputProps,
|
|
387
385
|
actionBlock: /*#__PURE__*/jsx(Button, {
|
|
388
386
|
"data-cy": "neeto-fields-add-button",
|
|
@@ -391,19 +389,13 @@ var Header = withT(function (_ref) {
|
|
|
391
389
|
return setIsPaneOpen(true);
|
|
392
390
|
}
|
|
393
391
|
}),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
}), helpDocUrl && {
|
|
402
|
-
helpLinkProps: {
|
|
403
|
-
href: helpDocUrl
|
|
404
|
-
}
|
|
405
|
-
}))]
|
|
406
|
-
})
|
|
392
|
+
titleHelpPopoverProps: (helpDocUrl || helpDescription) && {
|
|
393
|
+
title: title,
|
|
394
|
+
description: helpDescription,
|
|
395
|
+
helpLinkProps: helpDocUrl && {
|
|
396
|
+
href: helpDocUrl
|
|
397
|
+
}
|
|
398
|
+
}
|
|
407
399
|
});
|
|
408
400
|
});
|
|
409
401
|
|