@bigbinary/neeto-rules-frontend 0.0.82 → 0.0.83
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 +79 -93
- package/dist/index.cjs.js +4 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -25,12 +25,10 @@ yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3
|
|
|
25
25
|
<InputField name="name" data={initialProps} />
|
|
26
26
|
<TextareaField name="description" data={initialProps} />
|
|
27
27
|
<SelectField name="projectId" data={initialProps} />
|
|
28
|
-
<Events name="events" data={initialProps} />
|
|
29
|
-
<RadioField name="performer" data={initialProps} />
|
|
28
|
+
<Events name="events" data={initialProps} performerName="performer" />
|
|
30
29
|
<Card title="Conditions">
|
|
31
30
|
<Conditions name="conditions" data={initialProps} />
|
|
32
31
|
</Card>
|
|
33
|
-
<ConditionGroups name="conditionGroups" data={initialProps} />
|
|
34
32
|
<Actions name="actions" data={initialProps} />
|
|
35
33
|
</>
|
|
36
34
|
)}
|
|
@@ -56,7 +54,7 @@ yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3
|
|
|
56
54
|
| type | Type of the field. [Supported Field Types](#field-types) `string` |
|
|
57
55
|
| value | Default value of the Field. It can be string or array based on the field type. |
|
|
58
56
|
| componentProps | Component specific props. [Component Props](#component-props) |
|
|
59
|
-
| options | `[{ label: "", value: ""}]` For [Field Types](#field-types) `radio` and `
|
|
57
|
+
| options | `[{ label: "", value: ""}]` For [Field Types](#field-types) `radio`, `dropdown` and `multi-select`. |
|
|
60
58
|
| conditionOptions | If [Field Type](#field-types) is `condition` [Options](#options) |
|
|
61
59
|
| eventOptions | If [Field Type](#field-types) is `events` [Options](#options) |
|
|
62
60
|
| actionOptions | If [Field Type](#field-types) is `actions` [Options](#options) |
|
|
@@ -75,11 +73,11 @@ yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3
|
|
|
75
73
|
- `text`
|
|
76
74
|
- `long-text`
|
|
77
75
|
- `dropdown`
|
|
76
|
+
- `multi-select`
|
|
78
77
|
- `radio`
|
|
79
78
|
- `events`
|
|
80
79
|
- `actions`
|
|
81
80
|
- `condition`
|
|
82
|
-
- `condition-group`
|
|
83
81
|
|
|
84
82
|
### Component Props
|
|
85
83
|
|
|
@@ -112,7 +110,7 @@ const initialProps = {
|
|
|
112
110
|
| Prop | Description |
|
|
113
111
|
| ----- | ------------------------------------------------------------------------- |
|
|
114
112
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
115
|
-
| name | Name of the field. The name should be same as that in the initialProp
|
|
113
|
+
| name | Name of the field. The name should be same as that in the initialProp. |
|
|
116
114
|
| label | To specify the text to be displayed above the field. `string` |
|
|
117
115
|
|
|
118
116
|
### TextareaField
|
|
@@ -135,7 +133,7 @@ const initialProps = {
|
|
|
135
133
|
| Prop | Description |
|
|
136
134
|
| ----- | ------------------------------------------------------------------------------ |
|
|
137
135
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
138
|
-
| name | Name of the field. The name should be same as that in the initialProp `string
|
|
136
|
+
| name | Name of the field. The name should be same as that in the initialProp. `string`|
|
|
139
137
|
| label | To specify the text to be displayed above the field. `string` |
|
|
140
138
|
|
|
141
139
|
### SelectField
|
|
@@ -159,11 +157,37 @@ const initialProps = {
|
|
|
159
157
|
| Prop | Description |
|
|
160
158
|
| -------- | ------------------------------------------------------------------------- |
|
|
161
159
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
162
|
-
| name | Name of the field. The name should be same as that in the initialProp
|
|
160
|
+
| name | Name of the field. The name should be same as that in the initialProp. |
|
|
163
161
|
| label | To specify the text to be displayed above the field. `string` |
|
|
164
162
|
| options | To provide options for the Select input. `[{label, value}]`. |
|
|
165
163
|
| onChange | `(value, setValue) => void` `setValue` is to set the new value |
|
|
166
164
|
|
|
165
|
+
### MultiSelectField
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
const initialProps = {
|
|
169
|
+
...otherProps,
|
|
170
|
+
users: {
|
|
171
|
+
label: "Projects",
|
|
172
|
+
type: "multi-select",
|
|
173
|
+
options: [{ label: "Oliver", value: "oliver" }, { label: "John", value: "john" }],
|
|
174
|
+
value: ["oliver"], // Default selected option will be Oliver
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
<MultiSelectField name="users" data={initialProps} />;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### API
|
|
182
|
+
|
|
183
|
+
| Prop | Description |
|
|
184
|
+
| -------- | ------------------------------------------------------------------------- |
|
|
185
|
+
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
186
|
+
| name | Name of the field. The name should be same as that in the initialProp. |
|
|
187
|
+
| label | To specify the text to be displayed above the field. `string` |
|
|
188
|
+
| options | To provide options for the Select input. `[{label, value}]` |
|
|
189
|
+
| onChange | `(value, setValue) => void` `setValue` is to set the new value |
|
|
190
|
+
|
|
167
191
|
### RadioField
|
|
168
192
|
|
|
169
193
|
```jsx
|
|
@@ -188,9 +212,9 @@ const initialProps = {
|
|
|
188
212
|
| Prop | Description |
|
|
189
213
|
| ------- | ------------------------------------------------------------------------- |
|
|
190
214
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
191
|
-
| name | Name of the field. The name should be same as that in the initialProp
|
|
215
|
+
| name | Name of the field. The name should be same as that in the initialProp. |
|
|
192
216
|
| label | To specify the text to be displayed above the field. `string` |
|
|
193
|
-
| options | To provide options for the Radio input. `[{label, value}]
|
|
217
|
+
| options | To provide options for the Radio input. `[{label, value}]` |
|
|
194
218
|
|
|
195
219
|
### Events
|
|
196
220
|
|
|
@@ -200,12 +224,17 @@ const initialProps = {
|
|
|
200
224
|
events: {
|
|
201
225
|
label: "Events",
|
|
202
226
|
type: "events",
|
|
203
|
-
value: [{ id: "1", name: "
|
|
227
|
+
value: [{ id: "1", name: "created" }], // Default value
|
|
204
228
|
eventOptions: [
|
|
205
|
-
{ label: "
|
|
206
|
-
{ label: "
|
|
207
|
-
{ label: "
|
|
229
|
+
{ label: "Created", value: "created" },
|
|
230
|
+
{ label: "Updated", value: "updated" },
|
|
231
|
+
{ label: "Assigned", value: "deleted" },
|
|
208
232
|
],
|
|
233
|
+
defaultData: {
|
|
234
|
+
name: "deleted",
|
|
235
|
+
performer: "admin",
|
|
236
|
+
message: "When deleted by admin",
|
|
237
|
+
},
|
|
209
238
|
},
|
|
210
239
|
};
|
|
211
240
|
|
|
@@ -218,6 +247,7 @@ const initialProps = {
|
|
|
218
247
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
219
248
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
220
249
|
| name | Name of the field. The name should be same as that in the initialProp |
|
|
250
|
+
| performerName | Name of the performer field. The performerName should be same as that in the initialProp |
|
|
221
251
|
| label | To specify the text to be displayed above the field. `string` |
|
|
222
252
|
| onSelectEvent | `(name, selectedOption) => void` This method will trigger when we select an event option. The `name` is to refer the event in the formik context. |
|
|
223
253
|
|
|
@@ -233,17 +263,24 @@ const initialProps = {
|
|
|
233
263
|
{
|
|
234
264
|
value: "status",
|
|
235
265
|
label: "Status",
|
|
236
|
-
type: "dropdown", // Types : text, textarea, dropdown, multi-select, multi-select-create, date.
|
|
266
|
+
type: "dropdown", // Types : text, number, email, textarea, dropdown, multi-select, multi-select-create, date.
|
|
267
|
+
allowMatching: ["is", "is_not"],
|
|
237
268
|
dropdownOptions: [
|
|
238
269
|
{ label: "Open", value: "open" },
|
|
239
270
|
{ label: "Closed", value: "closed" },
|
|
240
271
|
],
|
|
241
272
|
},
|
|
242
|
-
{
|
|
273
|
+
{
|
|
274
|
+
value: "name",
|
|
275
|
+
label: "Name",
|
|
276
|
+
type: "text",
|
|
277
|
+
allowMatching: ["is", "is_not"],
|
|
278
|
+
},
|
|
243
279
|
{
|
|
244
280
|
value: "tags",
|
|
245
281
|
label: "Tags",
|
|
246
282
|
type: "multi-select-create",
|
|
283
|
+
allowMatching: ["contains_any_of", "contains_none_of"],
|
|
247
284
|
},
|
|
248
285
|
],
|
|
249
286
|
value: [
|
|
@@ -251,14 +288,21 @@ const initialProps = {
|
|
|
251
288
|
id: "1",
|
|
252
289
|
field: "status",
|
|
253
290
|
verb: "is",
|
|
254
|
-
value: "open",
|
|
291
|
+
metadata: { value: "open" },
|
|
255
292
|
joinType: "and_operator",
|
|
256
293
|
},
|
|
257
294
|
{
|
|
258
295
|
id: "2",
|
|
259
296
|
field: "name",
|
|
260
297
|
verb: "is",
|
|
261
|
-
value: "Test",
|
|
298
|
+
metadata: { value: "Test" },
|
|
299
|
+
joinType: "and_operator",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: "3",
|
|
303
|
+
field: "tags",
|
|
304
|
+
verb: "contains_any_of",
|
|
305
|
+
metadata: { values: ["Test", "Open"] },
|
|
262
306
|
joinType: "and_operator",
|
|
263
307
|
},
|
|
264
308
|
],
|
|
@@ -277,72 +321,10 @@ const initialProps = {
|
|
|
277
321
|
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
278
322
|
| name | Name of the field. The name should be same as that in the initialProp |
|
|
279
323
|
| label | To specify the text to be displayed above the field. `string` |
|
|
280
|
-
| isConditionGroup | To specify whether the component is part of `ConditionGroups` field. Default is `false` |
|
|
281
324
|
| onSelectCondition | `(name, selectedOption) => void` This method will trigger when we select a condition. The `name` is to refer the condition in the formik context. |
|
|
282
|
-
| selectedConditionOptions | `(selectedCondition)=> [{label, value}]` To provide options for the selected condition if the type of selected condition is `dropdown`, `multi-select`, or `multi-select-create
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
```jsx
|
|
287
|
-
const initialProps = {
|
|
288
|
-
...otherProps,
|
|
289
|
-
conditionGroups: {
|
|
290
|
-
label: "Condition Groups",
|
|
291
|
-
type: "condition-group",
|
|
292
|
-
conditionOptions: [
|
|
293
|
-
{
|
|
294
|
-
value: "status",
|
|
295
|
-
label: "Status",
|
|
296
|
-
type: "dropdown", // Types : text, textarea, dropdown, multi-select, multi-select-create, date.
|
|
297
|
-
dropdownOptions: [
|
|
298
|
-
{ label: "Open", value: "open" },
|
|
299
|
-
{ label: "Closed", value: "closed" },
|
|
300
|
-
],
|
|
301
|
-
},
|
|
302
|
-
{ value: "name", label: "Name", type: "text" },
|
|
303
|
-
{
|
|
304
|
-
value: "tags",
|
|
305
|
-
label: "Tags",
|
|
306
|
-
type: "multi-select-create",
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
value: [
|
|
310
|
-
{
|
|
311
|
-
id: "1",
|
|
312
|
-
joinType: "and_operator",
|
|
313
|
-
conditions: [
|
|
314
|
-
{
|
|
315
|
-
id: "1",
|
|
316
|
-
field: "status", Specify the value of the selected condition.
|
|
317
|
-
verb: "is",
|
|
318
|
-
value: "open",
|
|
319
|
-
joinType: "and_operator",
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
id: "2",
|
|
323
|
-
field: "name",
|
|
324
|
-
verb: "is",
|
|
325
|
-
value: "Test",
|
|
326
|
-
joinType: "and_operator",
|
|
327
|
-
},
|
|
328
|
-
],
|
|
329
|
-
},
|
|
330
|
-
],
|
|
331
|
-
},
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
<ConditionGroups name="conditionGroups" data={initialProps} />
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
#### API
|
|
338
|
-
|
|
339
|
-
| Prop | Description |
|
|
340
|
-
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
341
|
-
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
342
|
-
| name | Name of the field. The name should be same as that in the initialProp |
|
|
343
|
-
| label | To specify the text to be displayed above the field. `string` |
|
|
344
|
-
| onSelectCondition | `(name, selectedOption) => void` This method will trigger when we select a condition. The `name` is to refer the condition in the formik context. |
|
|
345
|
-
| selectedConditionOptions | `(selectedCondition)=> [{label, value}]` To provide options for the selected condition if the type of selected condition is `dropdown`, `multi-select`, or `multi-select-create` |
|
|
325
|
+
| selectedConditionOptions | `(selectedCondition)=> [{label, value}]` To provide options for the selected condition if the type of selected condition is `dropdown`, `multi-select`, or `multi-select-create`. |
|
|
326
|
+
| isCallback | To specify if there is a preview callback function for the conditions. `Boolean` |
|
|
327
|
+
| previewCallback | `(conditions) => void` This method will trigger when we click the preview button of the conditions. |
|
|
346
328
|
|
|
347
329
|
### Actions
|
|
348
330
|
|
|
@@ -354,18 +336,22 @@ const initialProps = {
|
|
|
354
336
|
type: "actions",
|
|
355
337
|
actionOptions: [
|
|
356
338
|
{
|
|
357
|
-
value: "
|
|
358
|
-
label: "
|
|
359
|
-
type: "
|
|
339
|
+
value: "add_tags",
|
|
340
|
+
label: "Add Tags",
|
|
341
|
+
type: "multiSelect", // Types : emailToIds, emailTo, email, dropdown, list, multiSelect, note
|
|
342
|
+
hideSeparator: true,
|
|
343
|
+
placeholder: "Select tags",
|
|
360
344
|
dropdownOptions: [
|
|
361
345
|
{ label: "Open", value: "open" },
|
|
362
|
-
{ label: "
|
|
346
|
+
{ label: "Close", value: "close" },
|
|
347
|
+
{ label: "Hold", value: "hold" },
|
|
363
348
|
],
|
|
364
349
|
},
|
|
365
350
|
{
|
|
366
351
|
value: "email_to",
|
|
367
352
|
label: "Email To",
|
|
368
353
|
type: "emailToIds",
|
|
354
|
+
separator: "as",
|
|
369
355
|
hideSubject: true, // Hide subject field if this prop is true
|
|
370
356
|
},
|
|
371
357
|
],
|
|
@@ -377,8 +363,8 @@ const initialProps = {
|
|
|
377
363
|
},
|
|
378
364
|
{
|
|
379
365
|
id: "2",
|
|
380
|
-
name: "
|
|
381
|
-
metadata: {
|
|
366
|
+
name: "add_tags",
|
|
367
|
+
metadata: { values: ["close"] },
|
|
382
368
|
},
|
|
383
369
|
],
|
|
384
370
|
},
|
|
@@ -433,7 +419,7 @@ https://youtu.be/QBiYGP0Rhe0
|
|
|
433
419
|
|
|
434
420
|
## Integrations
|
|
435
421
|
|
|
436
|
-
| Project | Pages
|
|
437
|
-
| ----------------- |
|
|
438
|
-
| neeto-desk-web | Automation rules,
|
|
439
|
-
| neeto-planner-web | Automation rules
|
|
422
|
+
| Project | Pages |
|
|
423
|
+
| ----------------- | ----------------------------------------- |
|
|
424
|
+
| neeto-desk-web | Automation rules, Views, Canned responses |
|
|
425
|
+
| neeto-planner-web | Automation rules |
|