@bigbinary/neeto-rules-frontend 0.1.4 → 0.2.0
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 +51 -42
- package/dist/index.cjs.js +1088 -277
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1088 -277
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @bigbinary/neeto-rules-frontend
|
|
2
2
|
|
|
3
|
-
neetoRulesFrontend is the library that manages automation rules across neeto
|
|
3
|
+
neetoRulesFrontend is the library that manages automation rules across neeto
|
|
4
|
+
products.
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -8,9 +9,9 @@ neetoRulesFrontend is the library that manages automation rules across neeto pro
|
|
|
8
9
|
yarn add @bigbinary/neeto-rules-frontend
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
**neetoRulesFrontend** has a few peer dependencies that are required for the
|
|
12
|
-
functioning of the package. Install all the peer dependencies using the
|
|
13
|
-
command:
|
|
12
|
+
**neetoRulesFrontend** has a few peer dependencies that are required for the
|
|
13
|
+
proper functioning of the package. Install all the peer dependencies using the
|
|
14
|
+
below command:
|
|
14
15
|
|
|
15
16
|
```zsh
|
|
16
17
|
yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3.1
|
|
@@ -47,17 +48,17 @@ yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3
|
|
|
47
48
|
|
|
48
49
|
### Field Props
|
|
49
50
|
|
|
50
|
-
| Prop | Description
|
|
51
|
-
| ---------------- |
|
|
52
|
-
| name | Name of the field `string`
|
|
53
|
-
| label | To specify the text to be displayed above the field. `string`
|
|
54
|
-
| type | Type of the field. [Supported Field Types](#field-types) `string`
|
|
55
|
-
| value | Default value of the Field. It can be string or array based on the field type.
|
|
56
|
-
| componentProps | Component specific props. [Component Props](#component-props)
|
|
51
|
+
| Prop | Description |
|
|
52
|
+
| ---------------- | --------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| name | Name of the field `string` |
|
|
54
|
+
| label | To specify the text to be displayed above the field. `string` |
|
|
55
|
+
| type | Type of the field. [Supported Field Types](#field-types) `string` |
|
|
56
|
+
| value | Default value of the Field. It can be string or array based on the field type. |
|
|
57
|
+
| componentProps | Component specific props. [Component Props](#component-props) |
|
|
57
58
|
| options | `[{ label: "", value: ""}]` For [Field Types](#field-types) `radio`, `dropdown` and `multi-select`. |
|
|
58
|
-
| conditionOptions | If [Field Type](#field-types) is `condition` [Options](#options)
|
|
59
|
-
| eventOptions | If [Field Type](#field-types) is `events` [Options](#options)
|
|
60
|
-
| actionOptions | If [Field Type](#field-types) is `actions` [Options](#options)
|
|
59
|
+
| conditionOptions | If [Field Type](#field-types) is `condition` [Options](#options) |
|
|
60
|
+
| eventOptions | If [Field Type](#field-types) is `events` [Options](#options) |
|
|
61
|
+
| actionOptions | If [Field Type](#field-types) is `actions` [Options](#options) |
|
|
61
62
|
|
|
62
63
|
#### Options
|
|
63
64
|
|
|
@@ -130,11 +131,11 @@ const initialProps = {
|
|
|
130
131
|
|
|
131
132
|
#### API
|
|
132
133
|
|
|
133
|
-
| Prop | Description
|
|
134
|
-
| ----- |
|
|
135
|
-
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`.
|
|
136
|
-
| name | Name of the field. The name should be same as that in the initialProp. `string
|
|
137
|
-
| label | To specify the text to be displayed above the field. `string`
|
|
134
|
+
| Prop | Description |
|
|
135
|
+
| ----- | ------------------------------------------------------------------------------- |
|
|
136
|
+
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
137
|
+
| name | Name of the field. The name should be same as that in the initialProp. `string` |
|
|
138
|
+
| label | To specify the text to be displayed above the field. `string` |
|
|
138
139
|
|
|
139
140
|
### SelectField
|
|
140
141
|
|
|
@@ -170,7 +171,10 @@ const initialProps = {
|
|
|
170
171
|
users: {
|
|
171
172
|
label: "Projects",
|
|
172
173
|
type: "multi-select",
|
|
173
|
-
options: [
|
|
174
|
+
options: [
|
|
175
|
+
{ label: "Oliver", value: "oliver" },
|
|
176
|
+
{ label: "John", value: "john" },
|
|
177
|
+
],
|
|
174
178
|
value: ["oliver"], // Default selected option will be Oliver
|
|
175
179
|
},
|
|
176
180
|
};
|
|
@@ -239,23 +243,23 @@ const initialProps = {
|
|
|
239
243
|
};
|
|
240
244
|
|
|
241
245
|
<EventConditions
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
+
name="events"
|
|
247
|
+
data={initialProps}
|
|
248
|
+
performerName="performer"
|
|
249
|
+
conditionsName="conditions"
|
|
246
250
|
/>;
|
|
247
251
|
```
|
|
248
252
|
|
|
249
253
|
#### API
|
|
250
254
|
|
|
251
|
-
| Prop
|
|
252
|
-
|
|
|
253
|
-
| data
|
|
254
|
-
| name
|
|
255
|
-
| performerName
|
|
256
|
-
| conditionsName | Name of the conditions field. The conditionsName should be same as that in the initialProp
|
|
257
|
-
| label
|
|
258
|
-
| onSelectEvent
|
|
255
|
+
| Prop | Description |
|
|
256
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
257
|
+
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
258
|
+
| name | Name of the field. The name should be same as that in the initialProp |
|
|
259
|
+
| performerName | Name of the performer field. The performerName should be same as that in the initialProp |
|
|
260
|
+
| conditionsName | Name of the conditions field. The conditionsName should be same as that in the initialProp |
|
|
261
|
+
| label | To specify the text to be displayed above the field. `string` |
|
|
262
|
+
| 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. |
|
|
259
263
|
|
|
260
264
|
### Conditions
|
|
261
265
|
|
|
@@ -312,7 +316,7 @@ const initialProps = {
|
|
|
312
316
|
id: "3",
|
|
313
317
|
field: "tags",
|
|
314
318
|
verb: "contains_any_of",
|
|
315
|
-
metadata: { values: ["Test",
|
|
319
|
+
metadata: { values: ["Test", "Open"] },
|
|
316
320
|
joinType: "and_operator",
|
|
317
321
|
},
|
|
318
322
|
],
|
|
@@ -326,15 +330,15 @@ const initialProps = {
|
|
|
326
330
|
|
|
327
331
|
#### API
|
|
328
332
|
|
|
329
|
-
| Prop | Description
|
|
330
|
-
| ------------------------ |
|
|
331
|
-
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`.
|
|
332
|
-
| name | Name of the field. The name should be same as that in the initialProp
|
|
333
|
-
| label | To specify the text to be displayed above the field. `string`
|
|
334
|
-
| onSelectCondition | `(name, selectedOption) => void` This method will trigger when we select a condition. The `name` is to refer the condition in the formik context.
|
|
333
|
+
| Prop | Description |
|
|
334
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
335
|
+
| data | The same `initialProp` that is passed to `data` prop in `NeetoRulesForm`. |
|
|
336
|
+
| name | Name of the field. The name should be same as that in the initialProp |
|
|
337
|
+
| label | To specify the text to be displayed above the field. `string` |
|
|
338
|
+
| onSelectCondition | `(name, selectedOption) => void` This method will trigger when we select a condition. The `name` is to refer the condition in the formik context. |
|
|
335
339
|
| 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`. |
|
|
336
|
-
| isCallback
|
|
337
|
-
| previewCallback
|
|
340
|
+
| isCallback | To specify if there is a preview callback function for the conditions. `Boolean` |
|
|
341
|
+
| previewCallback | `(conditions) => void` This method will trigger when we click the preview button of the conditions. |
|
|
338
342
|
|
|
339
343
|
### Actions
|
|
340
344
|
|
|
@@ -348,7 +352,7 @@ const initialProps = {
|
|
|
348
352
|
{
|
|
349
353
|
value: "add_tags",
|
|
350
354
|
label: "Add Tags",
|
|
351
|
-
type: "multiSelect", // Types : emailToIds, emailTo, email, dropdown, list, multiSelect, note, date, text, textarea, decimal, number, regex
|
|
355
|
+
type: "multiSelect", // Types : emailToIds, emailTo, email, dropdown, list, multiSelect, note, date, text, textarea, decimal, number, regex, longText
|
|
352
356
|
hideSeparator: true,
|
|
353
357
|
placeholder: "Select tags",
|
|
354
358
|
dropdownOptions: [
|
|
@@ -364,6 +368,11 @@ const initialProps = {
|
|
|
364
368
|
separator: "as",
|
|
365
369
|
hideSubject: true, // Hide subject field if this prop is true
|
|
366
370
|
},
|
|
371
|
+
{
|
|
372
|
+
value: "send_sms",
|
|
373
|
+
label: "Send sms",
|
|
374
|
+
type: "longText",
|
|
375
|
+
},
|
|
367
376
|
],
|
|
368
377
|
value: [
|
|
369
378
|
{
|