@bigbinary/neeto-rules-frontend 0.8.0-beta1 → 0.8.1

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 CHANGED
@@ -23,6 +23,7 @@ The `neeto-rules-nano` facilitates the management of automation rules within nee
23
23
  - [Actions](#28-actions)
24
24
  - [Custom action component](#29-custom-action-component)
25
25
  - [RulePreview](#3-rulepreview)
26
+ - [RulesTable](#4-rulestable)
26
27
  2. [Instructions for Publishing](#instructions-for-publishing)
27
28
 
28
29
  ## Development with Host Application
@@ -615,6 +616,66 @@ The `RulesReorder` component is used to reorder the automation rule.
615
616
  6. `isReordering`: To specify if the reordering is in progress. (Boolean).
616
617
  7. `paginationProps`: To add pagination to the list of rules. Refer [Pagination component doc](https://neeto-ui.neeto.com/?path=/docs/components-pagination--docs).
617
618
 
619
+
620
+ #### 5. `RulesTable`
621
+
622
+ The `RulesTable` component is used to display the list of automation rules.
623
+ > Includes subheader which displays count of the automation rules.
624
+
625
+ #### Props
626
+
627
+ 1. `automationRulesEndpoint`: The endpoint for automation rules.
628
+
629
+ Following actions will be used by the component
630
+ | Action | Description |
631
+ | --- | --- |
632
+ | `clone` | To create the clone of the automation rule. |
633
+ | `update` | To update the status of the automation rule. |
634
+ | `destroy` | To delete the automation rule. |
635
+
636
+ 2. `additionalColumns`: To add additional columns to the table. Refer [Table component doc](https://neeto-ui.neeto.com/?path=/docs/components-table--docs)
637
+
638
+ ```jsx
639
+ const additionalColumns = [
640
+ {
641
+ title: "Operated on",
642
+ dataIndex: "recentlyModifiedTickets",
643
+ width: 160,
644
+ description: "Number of tickets the rule has acted upon in the last 7 days",
645
+ render: recentlyModifiedTickets => (
646
+ <div className="text-center">{recentlyModifiedTickets}</div>
647
+ ),
648
+ },
649
+ ];
650
+ ```
651
+
652
+ 3. `automationRulesPath`: The path for automation rules component.
653
+
654
+ Following additional routes are considered by the component:
655
+ | Routes | Description |
656
+ | --- | --- |
657
+ | `{automationRulesPath}/edit` | Page to display rule edit form. |
658
+ | `{automationRulesPath}/new` | Page to display rule create form. |
659
+
660
+ 4. `onPreview`: The callback function to call when the preview is clicked.
661
+
662
+ 5. `helpDocUrl`: The URL of the help doc to be displayed when no data is available.
663
+
664
+ 6. `MoreDropdownItems`: Array of dropdown items to be added to the MoreDropdown component in the table. Refer [MoreDropdown in table doc](https://neeto-ui.neeto.com/?path=/docs/components-table--docs).
665
+
666
+ ```jsx
667
+ const moreDropdownItems = [
668
+ {
669
+ key: "view-matching-tickets",
670
+ label: "View matching rules",
671
+ // onClick callback receives the selected rule
672
+ onClick: rule => {
673
+ setSelectedRule(rule);
674
+ setShowMatchingTickets(true);
675
+ },
676
+ },
677
+ ];
678
+ ```
618
679
  ## Instructions for Publishing
619
680
 
620
681
  Consult the [building and releasing packages](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) guide for details on how to publish.
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "neetoRules": {
3
3
  "common": {
4
+ "automationRuleWithCount_one": "{{count}} automation rule",
5
+ "automationRuleWithCount_other": "{{count}} automation rules",
4
6
  "events": "Events",
5
7
  "name": "Name",
6
8
  "description": "Description",
@@ -33,7 +35,8 @@
33
35
  "phoneNumber": "Phone number",
34
36
  "phoneNumbers": "Phone numbers",
35
37
  "data": "Data",
36
- "reorder": "Reorder"
38
+ "reorder": "Reorder",
39
+ "at": "at"
37
40
  },
38
41
  "form": {
39
42
  "noEvents": "A rule without events will run hourly.",
@@ -54,6 +57,7 @@
54
57
  "selectDate": "Select date"
55
58
  },
56
59
  "labels": {
60
+ "active": "Active",
57
61
  "body": "Body",
58
62
  "selectValues": "Select values",
59
63
  "multipleValues": "Multiple values",
@@ -306,6 +310,20 @@
306
310
  },
307
311
  "description": {
308
312
  "reorder": "Automation rules are applied from top to bottom."
313
+ },
314
+ "button": {
315
+ "clone": "Clone",
316
+ "delete": "Delete",
317
+ "edit": "Edit",
318
+ "addNew": "Add new automation rule"
319
+ },
320
+ "deleteAlert": {
321
+ "message": "You are permanently deleting the automation rule <strong>{{name, anyCase}}</strong>. This can't be undone.",
322
+ "title": "Delete automation rule?"
323
+ },
324
+ "noData": {
325
+ "title": "There are no automation rule to show",
326
+ "helpText": "Here is how you can use <a>automation rules.</a>"
309
327
  }
310
328
  }
311
329
  }