@bigbinary/neeto-tags-frontend 2.2.10 → 2.2.12
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 +80 -41
- package/dist/NeetoTags.js +7 -1
- package/dist/NeetoTags.js.map +1 -1
- package/dist/cjs/NeetoTags.js +7 -1
- package/dist/cjs/NeetoTags.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,82 +1,111 @@
|
|
|
1
|
-
|
|
2
1
|
# neeto-tags-nano
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
The `neeto-tags-nano` manages tags across neeto applications. The nano exports
|
|
4
|
+
the `@bigbinary/neeto-tags-frontend` NPM package and `neeto-tags-engine` Rails
|
|
5
|
+
engine for development.
|
|
4
6
|
|
|
5
7
|
# Contents
|
|
8
|
+
|
|
6
9
|
1. [Development with Host Application](#development-with-host-application)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
- [Engine](#engine)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Frontend package](#frontend-package)
|
|
14
|
+
- [Installation](#installation-1)
|
|
15
|
+
- [Instructions for development](#instructions-for-development)
|
|
16
|
+
- [Components](#components)
|
|
14
17
|
2. [Instructions for Publishing](#instructions-for-publishing)
|
|
15
18
|
|
|
16
19
|
# Development with Host Application
|
|
20
|
+
|
|
17
21
|
## Engine
|
|
22
|
+
|
|
18
23
|
The engine is used to manage tags for any entity across neeto products.
|
|
19
24
|
|
|
20
25
|
### Installation
|
|
26
|
+
|
|
21
27
|
1. Add this line to your application's Gemfile:
|
|
22
|
-
```ruby
|
|
23
|
-
source "NEETO_GEM_SERVER_URL" do
|
|
24
|
-
# ..existing gems
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
```ruby
|
|
30
|
+
source "NEETO_GEM_SERVER_URL" do
|
|
31
|
+
# ..existing gems
|
|
32
|
+
|
|
33
|
+
gem 'neeto-tags-engine'
|
|
34
|
+
end
|
|
35
|
+
```
|
|
36
|
+
|
|
29
37
|
2. And then execute:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
```ruby
|
|
39
|
+
bundle install
|
|
40
|
+
```
|
|
33
41
|
3. Add this line to your application's `config/routes.rb` file:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
```ruby
|
|
43
|
+
mount NeetoTagsEngine::Engine, at: "/neeto_tags"
|
|
44
|
+
```
|
|
45
|
+
**NOTE: The mount point must be `/neeto_tags` and cannot be changed to any
|
|
46
|
+
other path.**
|
|
47
|
+
4. Run the following command to copy the migrations from the engine to the host
|
|
48
|
+
application:
|
|
49
|
+
```ruby
|
|
50
|
+
bundle exec rails neeto_tags_engine:install:migrations
|
|
51
|
+
```
|
|
41
52
|
5. Add the migrations to the database:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
```ruby
|
|
54
|
+
bundle exec rails db:migrate
|
|
55
|
+
```
|
|
56
|
+
|
|
45
57
|
### Usage
|
|
58
|
+
|
|
46
59
|
You can learn more about the setup and usage here:
|
|
60
|
+
|
|
47
61
|
1. [Models](/docs/engine/models.md)
|
|
48
62
|
2. [Controllers](/docs/engine/controllers.md)
|
|
49
63
|
|
|
50
64
|
## Frontend package
|
|
65
|
+
|
|
51
66
|
The package exports two components: `NeetoTags` and `Tags`.
|
|
52
67
|
|
|
53
68
|
The package also exports one hook: `refetchTags`.
|
|
54
69
|
|
|
55
70
|
### Installation
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
|
|
72
|
+
1. `neeto-tags-nano` has a few peer dependencies that are required for the
|
|
73
|
+
proper functioning of the package. Install all the peer dependencies using
|
|
74
|
+
the below command:
|
|
75
|
+
|
|
76
|
+
```zsh
|
|
77
|
+
yarn add @bigbinary/neeto-commons-frontend@2.0.35 @bigbinary/neeto-icons@1.9.10 @bigbinary/neetoui@4.3.3 @honeybadger-io/js@5.1.1 @honeybadger-io/react@5.1.2 axios@1.3.3 classnames@2.3.2 formik@2.2.9 js-logger@1.6.1 ramda@0.28.0 react-helmet@6.1.0 react-query@3.39.3 react-router-dom@5.3.4 react-toastify@8.2.0 yup@1.0.0
|
|
78
|
+
```
|
|
60
79
|
|
|
61
80
|
2. Now install the latest `neeto-tags-nano` package using the below command:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
81
|
+
```zsh
|
|
82
|
+
yarn add @bigbinary/neeto-tags-frontend
|
|
83
|
+
```
|
|
65
84
|
|
|
66
85
|
### Instructions for development
|
|
67
|
-
|
|
86
|
+
|
|
87
|
+
Check the
|
|
88
|
+
[Frontend package development guide](https://neeto-engineering.neetokb.com/p/a-d34cb4b0)
|
|
89
|
+
for step-by-step instructions to develop the frontend package.
|
|
68
90
|
|
|
69
91
|
### Components
|
|
92
|
+
|
|
70
93
|
#### `NeetoTags` ([source code](https://github.com/bigbinary/neeto-tags-nano/blob/e61f7bd2b9cab9fbf29fcfecf57e66131c86e6ef/app/javascript/src/index.jsx))
|
|
94
|
+
|
|
71
95
|
This component provides a dashboard to manage tags for an application.
|
|
72
96
|
|
|
73
97
|
##### Props
|
|
74
|
-
|
|
98
|
+
|
|
99
|
+
- `config`: Configuration object that includes specifications for tags, display
|
|
100
|
+
menu, and breadcrumbs.
|
|
75
101
|
|
|
76
102
|
##### Configuration
|
|
77
|
-
|
|
103
|
+
|
|
104
|
+
Refer to the [NeetoTags](/docs/frontend/neeto_tags.md) section for detailed
|
|
105
|
+
information on the available configurations for the `NeetoTags` component.
|
|
78
106
|
|
|
79
107
|
##### Usage
|
|
108
|
+
|
|
80
109
|
```jsx
|
|
81
110
|
import React from "react";
|
|
82
111
|
|
|
@@ -93,9 +122,12 @@ export default App;
|
|
|
93
122
|
This component provides functionality to assign tags to an entity.
|
|
94
123
|
|
|
95
124
|
##### Configuration
|
|
96
|
-
|
|
125
|
+
|
|
126
|
+
Refer to the [Tags](/docs/frontend/tags.md) section for detailed information on
|
|
127
|
+
the available configurations for the `Tags` component.
|
|
97
128
|
|
|
98
129
|
##### Usage
|
|
130
|
+
|
|
99
131
|
```jsx
|
|
100
132
|
import React from "react";
|
|
101
133
|
|
|
@@ -127,10 +159,13 @@ export default App;
|
|
|
127
159
|
```
|
|
128
160
|
|
|
129
161
|
### Hooks
|
|
162
|
+
|
|
130
163
|
#### `refetchTags` ([source code](https://github.com/bigbinary/neeto-tags-nano/blob/e61f7bd2b9cab9fbf29fcfecf57e66131c86e6ef/app/javascript/src/hooks/useTagsApi.js#L39))
|
|
164
|
+
|
|
131
165
|
This function refetches the tags list.
|
|
132
166
|
|
|
133
167
|
##### Usage
|
|
168
|
+
|
|
134
169
|
Below is an example usage of the `refetchTags` hook:
|
|
135
170
|
|
|
136
171
|
```js
|
|
@@ -150,8 +185,12 @@ const useBulkUpdateTickets = () =>
|
|
|
150
185
|
}
|
|
151
186
|
);
|
|
152
187
|
```
|
|
153
|
-
Used by [neetoDesk](https://github.com/bigbinary/neeto-desk-web/blob/5ba3471deae047bc9d08dca6bf26537194b9a209/app/javascript/src/hooks/reactQuery/tickets/useTicketsApi.js#L83)
|
|
154
188
|
|
|
189
|
+
Used by
|
|
190
|
+
[neetoDesk](https://github.com/bigbinary/neeto-desk-web/blob/5ba3471deae047bc9d08dca6bf26537194b9a209/app/javascript/src/hooks/reactQuery/tickets/useTicketsApi.js#L83)
|
|
155
191
|
|
|
156
192
|
# Instructions for Publishing
|
|
157
|
-
|
|
193
|
+
|
|
194
|
+
Consult the
|
|
195
|
+
[building and releasing packages](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages)
|
|
196
|
+
guide for details on how to publish.
|
package/dist/NeetoTags.js
CHANGED
|
@@ -31,11 +31,11 @@ import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
|
31
31
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
32
32
|
import NeetoUITable from '@bigbinary/neetoui/Table';
|
|
33
33
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
34
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
34
35
|
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
35
36
|
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
36
37
|
import Tag from '@bigbinary/neetoui/Tag';
|
|
37
38
|
import NeetoUITagMergeIcon from '@bigbinary/neeto-icons/Merge';
|
|
38
|
-
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
39
39
|
import classNames from 'classnames';
|
|
40
40
|
import Check from '@bigbinary/neeto-icons/Check';
|
|
41
41
|
import Input$1 from '@bigbinary/neetoui/Input';
|
|
@@ -360,6 +360,12 @@ var Table = function Table(_ref) {
|
|
|
360
360
|
noDataProps = _ref.noDataProps;
|
|
361
361
|
var _useTranslation = useTranslation(),
|
|
362
362
|
t = _useTranslation.t;
|
|
363
|
+
if (isLoading) {
|
|
364
|
+
return /*#__PURE__*/jsx("div", {
|
|
365
|
+
className: "flex h-full w-full items-center justify-center",
|
|
366
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
367
|
+
});
|
|
368
|
+
}
|
|
363
369
|
if (!isLoading && !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length)) {
|
|
364
370
|
return /*#__PURE__*/jsx("div", {
|
|
365
371
|
className: "ntm-empty-state",
|