@bigbinary/neeto-slack-frontend 2.2.2 → 2.2.4

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,17 +1,34 @@
1
- @bigbinary/neeto-slack-frontend
1
+ # neeto-slack-nano
2
+
3
+ [Engine and package installation](./docs/engine-and-package-installation.md)
4
+ [Building and releasing](./docs/building-and-releasing.md)
5
+
6
+ ## Integrations
7
+
8
+ | Projects | Integrated |
9
+ | ------------ | :----------------: |
10
+ | neetoForm | :white_check_mark: |
11
+ | neetoChat | :white_check_mark: |
12
+ | neetoDesk | :white_check_mark: |
13
+ | neetoInvoice | :white_check_mark: |
14
+ | neetoMonitor | :white_check_mark: |
15
+ | neetoBugtrap | :white_check_mark: |
16
+ | neetoCal | :white_check_mark: |
17
+
18
+ ## @bigbinary/neeto-slack-frontend
2
19
 
3
20
  ![npm](https://img.shields.io/npm/v/@bigbinary/neeto-slack-frontend?color=greenyellow)
4
21
  ![npm](https://img.shields.io/npm/dw/@bigbinary/neeto-slack-frontend?color=greenyellow)
5
22
 
6
23
  UI for slack integration for all neeto products.
7
24
 
8
- ## Installation
25
+ ### Installation
9
26
 
10
27
  ```bash
11
28
  yarn add @bigbinary/neeto-slack-frontend
12
29
  ```
13
30
 
14
- ## Usage
31
+ ### Usage
15
32
 
16
33
  Available components:
17
34
 
@@ -20,9 +37,11 @@ Available components:
20
37
  - [Finish](./docs/finish/README.md)
21
38
  - [Settings](./docs/settings/README.md)
22
39
 
23
- View the [example app](./example/src/App.jsx) to see usage.
40
+ Hook:
24
41
 
25
- ## Development
42
+ - [useFetchSlackIntegrationsStatus](./docs/useFetchSlackIntegrationsStatus/README.md)
43
+
44
+ ### Development
26
45
 
27
46
  Install all the dependencies by executing the following command
28
47
 
@@ -30,12 +49,7 @@ Install all the dependencies by executing the following command
30
49
  yarn install
31
50
  ```
32
51
 
33
- ### Using example app
34
-
35
- Start the development server using the `yarn start` command. Development server
36
- will run the example app using webpack.
37
-
38
- ### Using host application
52
+ #### Using host application
39
53
 
40
54
  1. Clone this repository.
41
55
  2. Run `yarn install` to download the dependencies and setup the development
@@ -53,34 +67,180 @@ will run the example app using webpack.
53
67
  host if changes are not applied.
54
68
  8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
55
69
 
56
- # Building and releasing.
70
+ ## neetoSlackEngine
71
+
72
+ To manage slack integration on neeto applications.
73
+
74
+ ### Installation
75
+
76
+ 1. Add this line to your application's Gemfile:
77
+
78
+ ```ruby
79
+ gem "neeto-slack-engine", git: 'https://github.com/bigbinary/neeto-slack-engine.git', branch: 'stable'
80
+ ```
81
+
82
+ 2. And then execute:
83
+
84
+ ```shell
85
+ bundle install
86
+ ```
57
87
 
58
- The `@bigbinary/neeto-slack-frontend` package gets published to NPM when we
59
- merge a PR with `patch`, `minor` or `major` label to the `main` branch. The
60
- `patch` label is used for bug fixes, `minor` label is used for new features and
61
- `major` label is used for breaking changes. You can checkout the
62
- `Create and publish releases` workflow in GitHub Actions to get a live update.
88
+ 3. Install the migrations
89
+
90
+ \*\* Add a migration to add slack_chat_api_key to Organization of host app if
91
+ it doesn't exist already. Then run
92
+
93
+ ```ruby
94
+ # frozen_string_literal: true
63
95
 
64
- In case if you missed to add the label, you can manually publish the package.
65
- For that first you need to create a PR to update the version number in the
66
- `package.json` file and merge it to the `main` branch. After merging the PR, you
67
- need to create a
68
- [new github release](https://github.com/bigbinary/neeto-slack-frontend/releases/new)
69
- from main branch. Whenever a new release is created with a new version number,
70
- the github actions will automatically publish the built package to npm. You can
71
- checkout the `Publish to npm` workflow in GitHub Actions to get a live update.
96
+ class AddSlackChatApiKeyToOrganization < ActiveRecord::Migration[7.0]
97
+ def change
98
+ add_column :organizations, :slack_chat_api_key, :string
99
+ end
100
+ end
101
+ ```
102
+
103
+ ```shell
104
+ bin/rails neeto_slack_engine:install:migrations
105
+ bin/rails db:migrate
106
+ ```
72
107
 
73
- Please note that before publishing the package, you need to verify the
74
- functionality in some of the neeto web-apps locally using `yalc` package
75
- manager. The usage of yalc is explained in this video:
76
- https://youtu.be/QBiYGP0Rhe0
108
+ 4. Configure model to add below association to the integrable class
109
+
110
+ ```ruby
111
+ has_one :slack_team, as: :integrable, class_name: "NeetoSlackEngine::SlackTeam", dependent: :destroy
112
+ ```
113
+
114
+ 5. Configure the following Environment Variables and secrets with suitable
115
+ values
77
116
 
78
- # Product integrations
117
+ Under .env
79
118
 
80
- | Projects | SlackFrontend |
81
- | ------------ | :----------------: |
82
- | neetoChat | :white_check_mark: |
83
- | neetoDesk | :white_check_mark: |
84
- | neetoForm | :white_check_mark: |
85
- | neetoInvoice | :white_check_mark: |
86
- | neetoBugtrap | :white_check_mark: |
119
+ ```yaml
120
+ SLACK_CLIENT_ID=#Value from Slack App console at
121
+ https://api.slack.com/apps/APP_ID/general SLACK_CLIENT_SECRET=#Value from
122
+ Slack App console at https://api.slack.com/apps/APP_ID/general
123
+ SLACK_CLIENT_SIGNING_SECRET=#Value from Slack App console at
124
+ https://api.slack.com/apps/APP_ID/general ATTR_ENCRYPTION_KEY=#Random varying
125
+ char. key with min. 32 chars. SLACK_REDIRECT_PATH=#Path controller if
126
+ Callbacks controller of application is to be used instead of Engine's
127
+ SLACK_HOST_URL=#Host url if different than application host url or in
128
+ development for use of Ngrok
129
+ ```
130
+
131
+ Under secrets.yml
132
+
133
+ ```yaml
134
+ application_name: #Application name
135
+ attr_encrypted:
136
+ encryption_key: <%= ENV['ATTR_ENCRYPTION_KEY'] %>
137
+ slack:
138
+ client_id: "<%= ENV['SLACK_CLIENT_ID'] %>"
139
+ client_secret: <%= ENV['SLACK_CLIENT_SECRET'] %>
140
+ client_signing_secret: <%= ENV['SLACK_CLIENT_SIGNING_SECRET'] %>
141
+ ```
142
+
143
+ 6. Add this line to your application's `config/routes.rb` file (replace `at` to
144
+ your desired route):
145
+
146
+ ```ruby
147
+ mount NeetoSlackEngine::Engine, at: '/integrations-slack'
148
+ ```
149
+
150
+ 7. Slack Integration supports customizing scopes required for host app on usage
151
+ basis, for adding/removing the scope file with name `neeto_slack_engine.yml`
152
+ can be added under host app `config` directory. In case the file is not
153
+ present the Engine fallbacks to set of default scopes defined under Engine
154
+ config. File scope structure
155
+ ```yml
156
+ scopes:
157
+ v1:
158
+ bot:
159
+ ...
160
+ user:
161
+ ...
162
+ v2:
163
+ bot:
164
+ ...
165
+ user:
166
+ ...
167
+ ```
168
+ Ref. -
169
+ https://github.com/bigbinary/neeto-slack-engine/blob/e229fec17fd1b7e8596ca1ca55bd2926133fb88f/test/dummy/config/neeto_slack_engine.yml
170
+
171
+ ### Development
172
+
173
+ 1. Add this line to your application's Gemfile (replace the path to the local
174
+ copy of neetoIntegrationsSlack's engine):
175
+
176
+ ```ruby
177
+ gem 'neeto-slack-engine', path: '../neeto-slack-nano'
178
+ ```
179
+
180
+ 2. And then execute:
181
+
182
+ ```shell
183
+ bundle install
184
+ ```
185
+
186
+ 3. Install the migrations
187
+
188
+ \*\* Additional migration to add Slack Chat API key to Organization of host
189
+ app.
190
+
191
+ ```ruby
192
+ # frozen_string_literal: true
193
+
194
+ class AddSlackChatApiKeyToOrganization < ActiveRecord::Migration[7.0]
195
+ def change
196
+ add_column :organizations, :slack_chat_api_key, :string
197
+ end
198
+ end
199
+ ```
200
+
201
+ ```shell
202
+ bin/rails neeto_integrations_slack_engine:install:migrations
203
+ bin/rails db:migrate
204
+ ```
205
+
206
+ 4. Configure model to add below association to the integrable class
207
+
208
+ ```ruby
209
+ has_one :slack_team, as: :integrable, class_name: "NeetoSlackEngine::SlackTeam", dependent: :destroy
210
+ ```
211
+
212
+ 5. Configure the following Environment Variables and secrets with suitable
213
+ values
214
+
215
+ Under `.env.development` or `.env` in application
216
+
217
+ ```yaml
218
+ SLACK_CLIENT_ID=#Value from Slack App console at
219
+ https://api.slack.com/apps/APP_ID/general SLACK_CLIENT_SECRET=#Value from
220
+ Slack App console at https://api.slack.com/apps/APP_ID/general
221
+ SLACK_CLIENT_SIGNING_SECRET=#Value from Slack App console at
222
+ https://api.slack.com/apps/APP_ID/general ATTR_ENCRYPTION_KEY=#Random varying
223
+ char. key with min. 32 chars. SLACK_REDIRECT_PATH=#Path controller if
224
+ Callbacks controller of application is to be used instead of Engine's
225
+ SLACK_HOST_URL=#Host url if different than application host url or in
226
+ development for use of Ngrok INTEGRATIONS_SLACK_ENGINE_DEVELOPMENT=true
227
+ ```
228
+
229
+ Under secrets.yml
230
+
231
+ ```yaml
232
+ application_name: #Application name
233
+ attr_encrypted:
234
+ encryption_key: <%= ENV['ATTR_ENCRYPTION_KEY'] %>
235
+ slack:
236
+ client_id: "<%= ENV['SLACK_CLIENT_ID'] %>"
237
+ client_secret: <%= ENV['SLACK_CLIENT_SECRET'] %>
238
+ client_signing_secret: <%= ENV['SLACK_CLIENT_SIGNING_SECRET'] %>
239
+ ```
240
+
241
+ 6. Add this line to your application's `config/routes.rb` file (replace `at` to
242
+ your desired route):
243
+
244
+ ```ruby
245
+ mount NeetoSlackEngine::Engine, at: '/integrations-slack'
246
+ ```
@@ -0,0 +1,38 @@
1
+ {
2
+ "neetoSlack": {
3
+ "common": {
4
+ "continue": "Continue",
5
+ "save": "Save",
6
+ "edit": "Edit",
7
+ "done": "Done",
8
+ "required": "{{entity}} is required"
9
+ },
10
+ "slack": {
11
+ "placeholder": "Notification Channel",
12
+ "channelName": "Channel Name",
13
+ "editPane": "Edit slack integration",
14
+ "channelListRefreshToastr": "Slack channels list is updated",
15
+ "channelListRefreshButton": "Refresh channels list",
16
+ "steps": {
17
+ "finish": "Finish"
18
+ },
19
+ "connect": {
20
+ "title": "Connect your Slack account",
21
+ "description": "There’s no linked Slack account yet",
22
+ "loginButton": "Login to Slack"
23
+ },
24
+ "configure": {
25
+ "title": "You are connecting to <a><strong>{{teamName}}</strong></a> workspace.",
26
+ "sendTo": "Send to",
27
+ "sendToDescription": "Choose a Slack channel that will receive notifications",
28
+ "refreshSlackChannelList": "Refresh Slack channel list"
29
+ },
30
+ "finish": {
31
+ "title": "You are successfully connected to the <strong>{{teamName}}</strong> workspace."
32
+ },
33
+ "settings": {
34
+ "title": "You are connected to <a><strong>{{teamName}}</strong></a> workspace."
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1 @@
1
+ export { default as en } from "./en.json";