@bigbinary/neeto-email-notifications-frontend 1.4.1 → 1.4.3

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
@@ -1,19 +1,70 @@
1
1
  # neeto-email-notifications-nano
2
2
 
3
- [![BuildStatus](https://neeto-engineering.neetoci.com/badges/neeto-email-notifications-nano/workflows/branch.svg)](https://neeto-engineering.neetoci.com/projects/neeto-email-notifications-nano)
4
- ![package version](https://img.shields.io/npm/v/@bigbinary/neeto-email-notifications-frontend?color=greenyellow)
5
- ![npm downloads](https://img.shields.io/npm/dw/@bigbinary/neeto-email-notifications-frontend?color=greenyellow)
3
+ The neeto-email-notifications-nano enables the management of email notifications
4
+ within neeto applications. The nano exports the
5
+ @bigbinary/neeto-email-notifications-frontend NPM package and
6
+ neeto-email-notifications-engine Rails engine for development.
6
7
 
7
- neeto-email-notifications-nano enables the management of email notifications
8
- across neeto products
8
+ ## Contents
9
9
 
10
- # Installation
10
+ 1. [Development with Host Application](#development-with-host-application)
11
+ - [Engine](#engine)
12
+ - [Installation](#installation)
13
+ - [Usage](#usage)
14
+ - [Frontend package](#frontend-package)
15
+ - [Installation](#installation-1)
16
+ - [Usage](#usage-1)
17
+ 2. [Instructions for Publishing](#instructions-for-publishing)
11
18
 
12
- [Engine and package installation](./docs/engine-and-package-installation.md)
19
+ ## Development with Host Application
13
20
 
14
- # Usage
21
+ ### Engine
15
22
 
16
- ### Backend
23
+ The engine is used to manage email notifications across neeto products.
24
+
25
+ #### Installation
26
+
27
+ 1. Add this line to your application's Gemfile:
28
+
29
+ ```ruby
30
+ source "NEETO_GEM_SERVER_URL" do
31
+ # Rails engine to manage email notifications
32
+ gem "neeto-email-notifications-engine"
33
+ end
34
+ ```
35
+
36
+ 2. And then execute:
37
+
38
+ ```shell
39
+ bundle install
40
+ ```
41
+
42
+ 3. Add this line to your application's `config/routes.rb` file (replace `at` to
43
+ your desired route):
44
+
45
+ ```ruby
46
+ mount NeetoEmailNotificationsEngine::Engine, at: "/neeto_email_notifications"
47
+ ```
48
+
49
+ 4. Add required migrations in the `db/migrate` folder. Run the following
50
+ commands to generate the migrations.
51
+
52
+ ```shell
53
+ rails g neeto_fields_engine:install
54
+ ```
55
+
56
+ This will generate the migration to create the
57
+ `neeto_email_notifications_engine_email_notifications` table, which holds the
58
+ data for the email notifications, and have `custom_fields` column to include
59
+ custom attributes
60
+
61
+ 5. Run the following command to create the tables.
62
+
63
+ ```shell
64
+ rails db:migrate
65
+ ```
66
+
67
+ #### Usage
17
68
 
18
69
  1. Create required email notification models inherited from
19
70
  `NeetoEmailNotificationsEngine::EmailNotification`. For example,
@@ -38,16 +89,38 @@ across neeto products
38
89
 
39
90
  ```ruby
40
91
  class Form < ApplicationRecord
41
- ....
92
+ ....
42
93
 
43
- has_many :email_notifications, as: :notification_holder, class_name: "::NeetoEmailNotificationsEngine::EmailNotification", dependent: :destroy
44
- has_one :push_email_notification, as: :notification_holder
94
+ has_many :email_notifications, as: :notification_holder, class_name: "::NeetoEmailNotificationsEngine::EmailNotification", dependent: :destroy
95
+ has_one :push_email_notification, as: :notification_holder
45
96
 
46
- ....
97
+ ....
47
98
  end
48
99
  ```
49
100
 
50
- ### Frontend
101
+ You can learn more about the setup and usage here:
102
+
103
+ 1. [Models](/docs/engine/models.md)
104
+ 2. [Services](/docs/engine/services.md)
105
+
106
+ ### Frontend package
107
+
108
+ #### Installation
109
+
110
+ 1. Add the `neeto-email-notifications-frontend` package to the `package.json`
111
+
112
+ ```shell
113
+ yarn add @bigbinary/neeto-email-notifications-frontend
114
+ ```
115
+
116
+ This package will provide a single component `NeetoEmailNotification`, which
117
+ uses components from `neeto-molecules`.
118
+
119
+ #### Instructions for development
120
+
121
+ Check the [Frontend package development guide](https://neeto-engineering.neetokb.com/p/a-d34cb4b0) for step-by-step instructions to develop the frontend package.
122
+
123
+ #### Usage
51
124
 
52
125
  1. Add the component to the host application. For example,
53
126
  ```js
@@ -63,33 +136,25 @@ across neeto products
63
136
  />
64
137
  ```
65
138
 
66
- <img width="1318" alt="NeetoEmailNotificationForm component" src="https://github.com/bigbinary/neeto-email-notifications-nano/assets/89389135/bbe89fce-98ad-4974-9617-2a69d9baa61a">
67
-
68
- | Prop | Type | Default Value | Description |
69
- | ----------------------- | -------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
70
- | title | String | "Email notification" | The title of the component. |
71
- | subtitle | String | "Send an email notification when a new event occurred" | The subtitle of the component. |
72
- | disabled | Boolean | false | Disables the component |
73
- | emailFormikProps | Object | {} | Props for [`<EmailFormProvider />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailformprovider) |
74
- | emailFormProps | Object | {} | Props for [`<EmailForm />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailform) |
75
- | emailPreviewProps | Object | {} | Props for [`<EmailPreview />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailpreview) |
76
- | emailNotificationParams | Object | {} | Contains params required for fetching email notification |
77
- | onSuccess | Function | noop | Function that will be called when the email notification is updated successfully |
78
- | tooltipProps | Object | {} | Props for `<Tooltip>` for showing toolTip content when disabled |
79
- | children | Node | undefined | Additional content to be displayed inside the component |
139
+ ##### NeetoEmailNotificationForm
80
140
 
81
- <!-- TODO: Add references -->
141
+ The component is a form-based interface for adding or editing team members.
82
142
 
83
- # Local Development Setup
143
+ ###### Props
84
144
 
85
- 1. Setup
86
- [Instructions](https://github.com/bigbinary/neeto-engineering/tree/main/Local-Development-Setup).
145
+ - `title`: The title of the component.
146
+ - `subtitle`: The subtitle of the component.
147
+ - `onSuccess`: Function that will be called when the email notification is
148
+ updated successfully.
149
+ - `disabled`: Disables the component.
87
150
 
88
- 2. Run `yarn build` to bundle the app.
151
+ You can learn more about the NeetoEmailNotificationForm component and usage
152
+ here:
89
153
 
90
- 3. Visit http://spinkart.lvh.me:9100 and login with email `oliver@example.com`
91
- and password `welcome`.
154
+ 1. [NeetoEmailNotificationForm component](./docs/frontend/neeto_email_notification_form.md)
92
155
 
93
- # Publish instructions
156
+ ## Instructions for Publishing
94
157
 
95
- 1. [Building and releasing](./docs/building-and-releasing.md)
158
+ Consult the
159
+ [building and releasing packages](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages)
160
+ guide for details on how to publish.
@@ -0,0 +1,17 @@
1
+ {
2
+ "neetoEmailNotifications": {
3
+ "welcomeScreen": "Welcome to neeto wheel nano",
4
+ "errors": {
5
+ "invalidEmailAddress": "Please enter a valid email address",
6
+ "sendFromRequired": "'Send from' email address is required",
7
+ "sendToRequired": "'Send to' email address is required",
8
+ "subjectRequired": "Subject is required",
9
+ "messageRequired": "Message is required"
10
+ },
11
+ "emailNotification": {
12
+ "title": "Email notification",
13
+ "subTitle": "Send an email notification when a new event occurred"
14
+ },
15
+ "preview": "Preview"
16
+ }
17
+ }
@@ -0,0 +1,3 @@
1
+ import en from "./en.json";
2
+
3
+ export { en };