Compare commits

...
561 Commits
Author SHA1 Message Date
Sojan d03fad3e1d Merge branch 'release/1.6.0' 2020-07-08 01:00:45 +05:30
a77cc713c2 Chore: Include Tamil, Arabic, other language updates (#1018)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-07-08 00:59:30 +05:30
0fc0dc1683 Chore: Refactor round robin logic (#1015)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-08 00:14:07 +05:30
49db9c5d8a Adds unread message bubbles for widget (#943)
Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-08 00:04:44 +05:30
6a7d810c95 Bug: Set auto width to email input (#1013)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-07-06 18:14:19 +05:30
Pranav Raj SandGitHub f8a3f2df27 Chore: Add documentation for Mailgun & Mailchimp (#1014) 2020-07-06 13:28:50 +05:30
Sojan JoseandGitHub e41bd56f41 Chore: Feature Flags for Channels (#1010) 2020-07-06 11:16:19 +05:30
Pranav Raj SandGitHub b633126b35 Chore: Fix spelling mistakes in docs (#1012) 2020-07-06 10:37:51 +05:30
43147b3163 Chore: Fix presence for current user (#1001)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-07-04 20:03:16 +05:30
4612494923 Chore: Fix issues with conversation data models (#1000)
Co-authored-by: Sojan <sojan@pepalo.com>
2020-07-04 19:46:17 +05:30
36661ea45d Enhancement: Add focus state for reply box in dashboard (#999)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-07-04 13:50:44 +05:30
c98907db49 Feature: Availability Statuses (#874)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-04 11:42:47 +05:30
Nithin David ThomasandGitHub bd87927576 Add icon show last reply is from agent on conversation list #997 2020-07-03 23:25:33 +05:30
1b1deb9626 Proposed Enhancements for Chat Bubble Looks in the Dashboard (#992)
* Update Private Note border color

* Added box-shadow to chat bubbles

* Adjustments as suggested in PR #992

Adjustments as suggested in PR #992

* Reintroduced @include border-normal; in L-253

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-03 23:17:39 +05:30
c0cd747f29 Bug: Fix duplicate messages while using enter key on slow network (#987)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-02 11:58:02 +05:30
Steven BucciniandGitHub a699d7bdfe Update documentation with Sendgrid instructions (#994)
Add information about how to integrate with Sendgrid.
2020-07-01 23:02:59 +05:30
83be2e1edb Enhancement: Improve the UX for unread conversations (#986)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-07-01 14:40:21 +05:30
MohmmdandGitHub 534409d25a Enhancement: Use Tahoma as fallback for Arabic characters (#991) 2020-07-01 14:16:08 +05:30
Sojan JoseandGitHub cc02611007 Chore: Convert Message Sender to polymorphic (#740)
Fixes #680
2020-06-27 21:34:53 +05:30
Sojan JoseandGitHub 4f83d5451e Chore: Routine Bugfixes and enhancements (#979)
- Fix slack scopes
- Docs for authentication
Fixes: #704 , #973
2020-06-25 23:35:16 +05:30
Pranav Raj SandGitHub 0aab717bb3 Chore: Add default value for label color (#981) 2020-06-25 21:33:56 +05:30
97ad39713b Feature: Improve label experience (#975)
Co-authored-by: Sojan <sojan@pepalo.com>
2020-06-25 21:04:03 +05:30
Pranav Raj SandGitHub 8b61452d56 Chore: Fix typo in Slack documentation (#977)
- Fix typo in slack-integration-setup.md
2020-06-22 13:40:31 +05:30
1ef8d03e18 Feature: Slack - receive messages, create threads, send replies (#974)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-06-22 13:19:26 +05:30
Sojan aa8a85b8bd Merge branch 'hotfix/1.5.3' into develop 2020-06-22 12:02:58 +05:30
Sojan 77c16932f8 Merge branch 'hotfix/1.5.3' 2020-06-22 12:02:50 +05:30
Sojan d4214cd78f Bugfix: Invalid argument expiry in global config
references: #976
2020-06-22 12:01:26 +05:30
963f173730 Feature: ResizableTextArea in widget and dashboard (#969)
* Create ResizableTextArea component
* Rubocop fixes and spec fixes

Co-authored-by: Sojan <sojan@pepalo.com>
2020-06-18 15:17:45 +05:30
Sojan JoseandGitHub 04f6460afb Chore: Fix failing sidekiq events for contact create (#966) 2020-06-16 19:39:57 +05:30
b0bbd757b5 Chore: FCM Notification Improvements (#957)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-06-15 13:36:56 +05:30
Pranav Raj SandGitHub 667e3abbe1 Fix: Set widget bg color for file-bubble (#965) 2020-06-15 13:35:52 +05:30
Pranav Raj SandGitHub 7c6ea3a05a Chore: Fix HTML rendering in ConversationCard (#963) 2020-06-14 18:30:36 +05:30
Pranav Raj SandGitHub 5cb88237f5 Chore: Move conversationStats to a seperate module (#962)
* Chore: Move conversationStats to a seperate module

* Move toggleTyping to conversationTypingStatus

* Remove unused agentTyping flag

* Fix review comments
2020-06-14 14:07:52 +05:30
Nithin David ThomasandGitHub 5ec9af9325 Bug: Add min height to widget input box (#960) 2020-06-14 11:28:38 +05:30
Pranav Raj SandGitHub ecd5e20133 Bug: Replace non-numeric characters in Twilio phonenumber (#958) 2020-06-13 22:29:12 +05:30
944fbf27b7 Enhancement: Improve scrolling on widget #954 (#955)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-06-13 20:33:23 +05:30
f9e8bb8e10 Chore: Send browser language in webwidget events (#952)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-06-13 00:19:43 +05:30
Subin T PandGitHub ed1c871633 Feature: Slack integration (#783)
- Integrations architecture
- Slack integration
2020-06-12 23:12:47 +05:30
Pranav Raj SandGitHub 4f3b483066 Chore: Add Github Sponsors link 2020-06-12 19:37:00 +05:30
ca7554f88c Chore: Add deployment documentation (#904)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-06-11 22:34:22 +05:30
Pranav Raj SandGitHub e769282e7f BugFix: Fix missing tagline in inbox settings (#949) 2020-06-10 00:30:37 +05:30
Sojan 3823ad8fef Merge branch 'master' into develop 2020-06-10 00:25:52 +05:30
Sojan 04a0aa5f1b BugFix: Fix twitter DM view
- Fix twitter DMs gettings getting appended to tweet conversation

Fixes: #939
2020-06-10 00:25:05 +05:30
Sojan 991648edcf Merge branch 'hotfix/1.5.2' 2020-06-10 00:24:12 +05:30
Sojan bfe10618fb BugFix: Fix twitter DM view
- Fix twitter DMs gettings getting appended to tweet conversation

Fixes: #939
2020-06-10 00:23:34 +05:30
Pranav Raj SandGitHub eadc33d230 Use empty string as fallback greeting_message if null (#948) 2020-06-10 00:16:34 +05:30
432dad203b Feature: Inbox greeting message (#927)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-06-09 23:54:35 +05:30
Sojan JoseandGitHub 8b022311c0 Chore: FCM Push Fixes (#934) 2020-06-09 17:42:18 +05:30
Pranav Raj SandGitHub 40481f6462 Bugfix: Update conversation counters in realtime (#944)
* Bug: Update conversation counters in realtime
2020-06-09 16:26:33 +05:30
Pranav Raj SandGitHub 602132119b Fix socket reconnect if the pubsub token is same (#942) 2020-06-08 19:13:33 +05:30
Sojan JoseandGitHub 52d28105e4 Chore: Remove dead code related to billing (#935)
- remove subscription model
- remove billing-related code
2020-06-07 20:31:48 +05:30
Sojan JoseandGitHub 051871a3cd Chore: Code Cleanup in API controllers (#932)
* Chore: Code Cleanup in API controllers

* Remove unnecessary scoping for accounts controller
2020-06-07 13:58:05 +05:30
Sojan JoseandGitHub 3d84568a37 Feature: Label APIs (#931) 2020-06-07 11:17:13 +05:30
Sojan JoseandGitHub 915eefdc36 Bugfix: FCM push subscription builder fix (#930) 2020-06-06 20:53:30 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ede4dd9cb0 Chore: Bump websocket-extensions from 0.1.3 to 0.1.4 (#929)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-06 18:56:58 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b7f7b54f9b Chore: Bump websocket-extensions from 0.1.4 to 0.1.5 (#928)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/faye/websocket-extensions-ruby/releases)
- [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-06 15:56:54 +05:30
Sojan JoseandGitHub a13a474c23 Chore: Firebase Cloud Messaging Support (#858) 2020-06-05 00:15:50 +05:30
Sojan e783c3af5d Merge branch 'release/1.5.1' 2020-06-04 23:15:08 +05:30
68be7e3ea8 Use db:prepare instead of db:migrate (#924)
Use db:prepare instead of db:migrate

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-06-04 23:13:10 +05:30
Koichi MATSUMOTOandGitHub 72a25ffdc5 BugFix: Fix undefined method compare_and_save (#921)
Fix undefined method `compare_and_save` in config loader
2020-06-04 22:33:10 +05:30
Sojan 89dafa366e Merge branch 'release/1.5.0' 2020-06-02 23:53:19 +05:30
Sojan JoseandGitHub dafabac796 Chore: Minor bugfixes and housekeeping tasks (#896) 2020-06-02 23:50:39 +05:30
Sojan JoseandGitHub 93d8a25877 Enable Spanish (#913) 2020-06-02 23:43:03 +05:30
f78df91dd2 Chore: Contact Sidebar, conversation cleanup (#908)
- Update sidebar design
- Move every contact data to contacts module
- Revert go to next conversation feature
- Fix issues with new conversation in action cable
- Escape HTML content
- Broadcast event when conversation.contact changes.

Co-authored-by: Sojan <sojan@pepalo.com>
2020-06-02 22:59:02 +05:30
Sojan JoseandGitHub 8c52a3a953 Chore: Remove duplication of user JBuilder (#911)
* Chore: Reduce duplication of user JBuilder
2020-05-31 23:10:20 +05:30
Pranav Raj SandGitHub d4783db6fd Chore: Update app logo, add FRONTEND_URL env var (#910)
Chore: Update app logo, add FRONTEND_URL env var
2020-05-31 21:49:28 +05:30
Pranav Raj SandGitHub 586c616ae3 Bug: Render header title and tagline as HTML (#906)
* Render header title and tagline as HTML
2020-05-31 16:35:10 +05:30
Pranav Raj SandGitHub 884a1c5971 Chore: Add an option to upload a business logo to inbox (#905)
Chore: Add an option to upload a business logo to inbox
2020-05-31 16:16:22 +05:30
Pranav Raj SandGitHub 47ec7ad7c9 Feature: Ability to customise widget color (#903)
- Use Chrome style color-picker
2020-05-30 17:28:00 +05:30
Pranav Raj SandGitHub ec197b077d Chore: Add db migrate to Heroku release phase (#901) 2020-05-29 14:53:27 +05:30
Ronald WalkerandGitHub 10a1758261 Bug: Fix false positive in #toggleAgentTypingStatus spec (#899) 2020-05-29 12:37:18 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a9d93b750c Chore: Bump kaminari from 1.2.0 to 1.2.1 (#898)
Bumps [kaminari](https://github.com/kaminari/kaminari) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/kaminari/kaminari/releases)
- [Changelog](https://github.com/kaminari/kaminari/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kaminari/kaminari/compare/v1.2.0...v1.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-05-29 11:14:27 +05:30
Pranav Raj SandGitHub efc59bb43f Bug: Fix account_id in URLs (#894)
* Bug: Fix account_id in URLs
* Fix accountMixin specs
2020-05-26 23:36:42 +05:30
b7a583b2c4 Feature: Ability to switch between multiple accounts (#881)
* Feature: Ability to switch between multiple accounts

* Fix rubocop

* Fix assigned inboxes

* fix auth json

* Add account switcher in UI

* fix ordering on administrate

* Add switch accounts to sidebar

* add account id

* Fix schema.rb timestamp

* Revert "add account id"

This reverts commit 27570f50ef584cb9a5f69454f43f630b318c8807.

* Add a check for account

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-26 22:38:48 +05:30
Abdulkadir PoyrazandGitHub b1aab228ae Feature: Ability to mute contacts (#891)
fixes: #867
2020-05-26 17:43:59 +05:30
Sojan JoseandGitHub d8d14fc4a4 Feature: Rewamp super admin dashboard (#882) 2020-05-24 22:44:26 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e49a200ee0 Chore: Bump puma from 4.3.4 to 4.3.5 (#890)
Bumps [puma](https://github.com/puma/puma) from 4.3.4 to 4.3.5.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-05-23 14:21:13 +05:30
Jean TraulléandGitHub 8ccc00b5ba Add crowdin badge on README.md (#889) 2020-05-22 19:59:26 +05:30
Sony MathewandGitHub 6230f4d796 Enhancement: Threaded email replies for a conversation (#885) (#886)
* Added custom Message-ID and In-Reply-To headers for conversation reply emails
* Added new global config for the default domain (This is used in the above headers)
* Added migration to run the config loader to load the new global config value
* The subject of the conversation reply mailer was made static (This is required for threaded emails)
* Added required tests
2020-05-22 18:14:18 +05:30
Sony MathewandGitHub 11b4b4ea3f Chore: Parse quoted text in incoming emails (#883) (#884)
* Chore: Parse quoted text in incoming emails (#883)
* Parsed the quoted text and replies in incoming emails and store them separately
* Did this parsing for plain text and html part of emails
* In the chat window, we will only show the parsed reply alone

* Conversation mailbox test fixes (#883)
2020-05-22 18:07:06 +05:30
Sony MathewandGitHub 00093fa408 Fixed rspec due to unescaped html check for user name (#887) (#888)
* Fixed the flaky failure in rspec for super admin user controller due to unescaped user name check
2020-05-22 17:58:08 +05:30
Sojan JoseandGitHub f6a9f791cf Chore: Configure Letter opener with environment variable (#880) 2020-05-20 20:02:28 +05:30
Pranav Raj SandGitHub 8af200ad20 Fix missing translations, enable dutch language (#878)
* Fix missing translations, enable dutch language
2020-05-19 19:05:10 +05:30
Pranav Raj SandGitHub 3f5ce2ddbf Bug: Fix autoload_paths for facebook bot (#877)
* Fix autoload_paths for facebook bot
2020-05-18 15:32:26 +05:30
6e92d9be9e Bug: Fix Facebook v7.0 API issues (#863)
* Fix v7.0 API issues

Co-authored-by: Sojan <sojan@pepalo.com>
2020-05-17 23:44:50 +05:30
Pranav Raj SandGitHub b7129785c6 Chore: View form responses as user messages (#876)
* Chore: View form responses as user messages
2020-05-17 22:49:45 +05:30
Pranav Raj SandGitHub 246d0b407f Chore: UI Cleanup in modals (#873)
* Chore: UI Cleanup in modals

* Fix review comments
2020-05-17 21:07:45 +05:30
59f4dd7ebe Feature: Introduce locale in web-widget SDK (#871)
* Introduce setLocale in SDK

Co-authored-by: Sojan <sojan@pepalo.com>
2020-05-17 16:15:53 +05:30
Sojan JoseandGitHub 2e8cd59a06 Add new translations (#862)
* New translations agentMgmt.json (Dutch)

* New translations login.json (Dutch)

* New translations settings.json (French)

* New translations en.json (French)

* New translations en.json (Arabic)

* New translations en.json (Greek)

* New translations settings.json (Portuguese, Brazilian)

* New translations settings.json (Dutch)

* New translations settings.json (Greek)

* New translations signup.json (Ukrainian)

* New translations chatlist.json (Dutch)

* New translations contact.json (Dutch)

* New translations billing.json (Dutch)

* New translations cannedMgmt.json (Dutch)

* New translations inboxMgmt.json (Dutch)

* New translations conversation.json (Dutch)

* New translations generalSettings.json (Dutch)

* New translations en.json (Dutch)

* New translations en.json (Portuguese, Brazilian)

* New translations devise.en.yml (Dutch)

* New translations en.yml (Dutch)
2020-05-16 18:07:19 +05:30
Pranav Raj SandGitHub 467fcda6fc Chore: Add docs for push notifications env (#865) 2020-05-15 12:15:28 +05:30
Sojan JoseandGitHub e6aa851987 Chore: Add Account Users to Admin Panel (#859)
- Show errors on login page
- Dashboard for admin panel
2020-05-14 22:51:51 +05:30
20f39caa42 Chore: Twitter Integration house cleaning (#855)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-14 22:51:07 +05:30
Bruno AlmeidaandGitHub 1108446974 Feature: Move to the next conversation when I resolve a the current c… (#757)
* Feature: Move to the next conversation when I resolve a the current conversation

* check if nextId is present before emitting the event

* use es6 string literals

* use a named variable for better reading

* create a variable for better readability

* better sintax to get clickable element

* after last, go to first chat when resolve

* use state and action to set next chat

* remove not used emit

* clear selected state when there is not next chat

* Remove deprecated scope from FB Channel (#761)

Remove deprecated scope from FB Channel

* Feature: Customise the position of messenger (#767)

Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>

* Bug: Redirect user to set new password screen (#772)

* auto linter

* fix js linter

* sort chats on getter / filter before getting next chat

* Revert not related changes on ConversationCard.vue

* add test for getNextChatConversation getter

* remove not used module

* add test for getAllConversations getter
2020-05-14 13:43:02 +05:30
Ronald WalkerandGitHub e6bf81caf4 Bug: Fix widget icon alignment in Firefox (#857) 2020-05-14 11:42:53 +05:30
005f332776 Chore: Fixed auto-generated German translations
"canned responses" are no food: "Eingemachte Antwort" -> "Vorgefertigte Antwort"
"open", "closed" status are no verbs, so "Öffnen" -> "Offen", ...
"mine" has nothing to do with mining :) "Bergwerk" -> "Meine"
"home" isn't your home, but the main page "Hauptseite"
"resolve action" is about solutions, not determination, so
"Entschlossenheit" -> "Fall schließen"
"settings" are simply "Einstellungen"

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-13 22:47:31 +05:30
Pranav Raj SandGitHub d219b0a45e Chore: Add an option to toggle web manifest (#848) 2020-05-12 12:45:28 +05:30
f819bc0f33 Chore: Use installation config in frontend (#847)
* Use installation config in widget
* Add configuration for installation in UI
* Add config for mailer

Co-authored-by: Sojan <sojan@pepalo.com>
2020-05-12 01:31:40 +05:30
c74b5c21d7 Feature: Introduce Super Admins (#705)
* Feature: Introduce Super Admins

- added new devise model for super user
- added administrate gem
- sample dashboards for users and accounts

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-11 23:07:22 +05:30
Sony MathewandGitHub 8859880e55 Feature: Global Config helper (#844) (#845)
* Added a global config helper to easily access installation/global configs
  * this will fetch the keys from cache with fallback to DB on cache miss
  * ability to query multiple keys simultaneously
  * interface to delete the existing global config cache
* Added tests for this new helper module
2020-05-11 19:00:33 +05:30
Pranav Raj Sreepuram 6e0f02a38b Merge branch 'hotfix/1.4.2' into develop 2020-05-11 11:43:49 +05:30
Pranav Raj Sreepuram 0f8689b701 Merge branch 'hotfix/1.4.2' 2020-05-11 11:42:46 +05:30
Pranav Raj SandGitHub 70341df9b8 Bug: Use v2 reports instead of v1 reports (#843) 2020-05-11 11:40:14 +05:30
Sony MathewandGitHub 905c93b8f8 Feature: Installation global config (#839) (#840)
* Renamed concern from Feature to Featurable

* Feature: Installation config (#839)
* Added new model installtion config with corresponding migrations and specs
* Created an installation config yml (key value store model)
* Created a config loader module to load the installaltion configs
* Added this to the config loader seeder
* Changed the account before create hook for default feature enabling to use the feature values from installtion config
* Renamed the feature concern to Featurable to follow the naming pattern for concerns
* Added comments and specs for modules and places that deemed necessary

* Refactored config loader to reduce cognitive complexity (#839)
2020-05-10 22:40:36 +05:30
Pranav Raj SandGitHub 76b98cbed4 Bug: Fix inbox.agent_bot nil case (#841) 2020-05-10 22:20:45 +05:30
sony-mathew dedbe08a1c Hotfix: Fixed private notes in email notifications - Merge branch 'master' into develop 2020-05-10 16:38:55 +05:30
sony-mathew a5cc3bae6c Hotfix: Fix for private note in conversation email notifications - Merge branch 'hotfix/1.4.1' into develop 2020-05-10 16:22:53 +05:30
sony-mathew 0d7c1e5e11 Hotfix: Fix for private note in emails - Merge branch 'hotfix/1.4.1' 2020-05-10 16:21:30 +05:30
sony-mathew 35b2bdd074 Removed the un-neccessary attribute from msg create factory 2020-05-10 16:21:02 +05:30
sony-mathew 1a123a4f56 Spec for private messages not to be included in mails (#837) 2020-05-10 16:21:02 +05:30
sony-mathew a75f49ddcc Bug: Fixed private note being sent to customer (#837) 2020-05-10 16:21:02 +05:30
Pranav Raj SandGitHub f28ec29b8c Feature: Customise widget for bot conversations (#834)
* Feature: Customise widget for bot conversations
2020-05-09 22:02:43 +05:30
Sojan JoseandGitHub 05ea6308f2 Chore: Update ruby and rails versions (#831) 2020-05-08 12:13:23 +05:30
Sojan 628e0c8423 Merge branch 'release/1.4.0' 2020-05-06 14:26:24 +05:30
217f33b2b2 Chore: Add ro, fr, pt_BR translation files (#827)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-06 14:24:20 +05:30
c7120e9637 Chore: Add translated languages to account settings (#826)
* Add available languages in account settings

Co-authored-by: Sojan <sojan@pepalo.com>
2020-05-06 13:38:36 +05:30
Sojan Jose d6d15c8c3c Update Crowdin configuration file 2020-05-06 13:20:31 +05:30
Pranav Raj SandGitHub b50aeb7ae4 Chore: Fix broken conversation mailer layout (#825) 2020-05-06 12:40:41 +05:30
e9131ea558 Feature: Add web push notification permission in frontend (#766)
Add webpush notification permission in frontend

Co-authored-by: Sojan <sojan@pepalo.com>
2020-05-06 00:10:56 +05:30
Vishnu NarayananandGitHub 5bd7a4c511 Feature: Add installation script (#776)
* Feature: Add installation script
* Add systemd service files for chatwoot
* Enable static file serving by rails on prod
* Fix systemd files path
2020-05-05 01:59:38 +05:30
Pranav Raj SandGitHub 44fae4a4a1 Feature: Add default value to ChatForm (#816)
* Feature: Add adefault value to ChatForm
2020-05-04 23:48:47 +05:30
5bc8219db5 Feature: Typing Indicator on widget and dashboard (#811)
* Adds typing indicator for widget
* typing indicator for agents in dashboard

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-04 23:07:56 +05:30
Sony MathewandGitHub fabc3170b7 Feature: Feature flags on account (#814) (#815)
* Feature: Feature flags on account (#814)
* Added the new column on account model for managing feature flags
* Added the inbound email flag
* Locked the settings of this eature in account settings based on this
* Encapsulated the feature flaging as a concern. With this, we can re-use the same concern if we introduce this in other models like user or inbox or so.
* Added the features in the account api

* Changed Rails/FilePath style - rubocop issue

* Revert "Changed Rails/FilePath style - rubocop issue"

This reverts commit 3a42d3b9c9b3a2fde8bc7256fd704b6fcaf54040.

* Disabling rubocop on codeclimate as we already have this in CICD
2020-05-04 23:06:42 +05:30
Pranav Raj SandGitHub 98af47aae2 Fix missing translation key (#810) 2020-05-04 19:07:31 +05:30
Sojan JoseandGitHub ae3f8c02e1 Chore: Add pt and pt_BR translations (#813) 2020-05-04 17:33:55 +05:30
Pranav Raj SandGitHub 19886b40bd Chore: Add enter key listener for email input box (#809)
* Chore: Add enter key listener for email input box
2020-05-03 14:45:33 +05:30
Sojan JoseandGitHub dc6398ab56 Feature: Api to toggle typing status on a conversation (#807)
- api to toggle typing status on a conversation
- clients receive webhook events on the same

Addresses: #718 , #719 , #775
2020-05-03 12:17:27 +05:30
Sojan JoseandGitHub ba1e0dbda0 Chore: Apple site association file for deep linking (#805) 2020-05-03 12:16:11 +05:30
Sojan JoseandGitHub db6e3fb43e Chore: API to get conversations count (#808)
Addresses: #497
2020-05-03 12:15:10 +05:30
Sony MathewandGitHub d8131e450c Chore: Moved the email ingress method to an env variable (#777) (#806)
* Chore: Moved the email ingress method to an env variable (#777)
* Moved the email ingress method in config to an environment variable
* Updated documentation to reflect this

* Added ingress config to staging env config (#777)
* Re-arranged the order in env configs so that email related configs are together
2020-05-02 23:29:09 +05:30
Pranav Raj SandGitHub 8655466fa5 Chore: Add docs for Twilio Whatsapp/SMS channel (#804) 2020-05-02 16:25:57 +05:30
Subin T PandGitHub 7e62000e1b Chore: Remove redis backed reporting (#669) 2020-05-02 16:04:52 +05:30
Pranav Raj SandGitHub ddbc612f0b Bug: Use beginAtZero option for reports (#803) 2020-05-02 15:03:43 +05:30
a951fb20cb Chore: UI fixes and enhancements (#796)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-05-02 09:47:36 +05:30
Pranav Raj SandGitHub 8906fd808d Bug: Fix missing contact_id in conversation list (#798) 2020-05-01 23:00:33 +05:30
Pranav Raj SandGitHub 8f0c4281c7 Chore: Fix data migration in notification settings (#797) 2020-05-01 22:30:57 +05:30
Sojan JoseandGitHub d4ff9f5b45 Chore: Add additional information to conversation meta (#795)
Chore: Add additional information to conversation meta
2020-05-01 16:49:28 +05:30
96da27f1f6 Feature: User Notification Objects (#752)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-05-01 14:53:43 +05:30
Sojan JoseandGitHub 66aace7c13 Chore: Add Romanian, Portuguese, Brazilian, Ukrainian languages (#790)
* New translations integrations.json (Romanian)

* New translations integrations.json (Portuguese, Brazilian)

* New translations integrations.json (Ukrainian)

* New translations integrations.json (Portuguese)

* New translations inboxMgmt.json (French)

* New translations report.json (Portuguese, Brazilian)

* New translations resetPassword.json (Portuguese, Brazilian)

* New translations login.json (Portuguese)

* New translations report.json (Ukrainian)

* New translations report.json (Portuguese)

* New translations cannedMgmt.json (Portuguese)

* New translations billing.json (Portuguese)

* New translations agentMgmt.json (Spanish)

* New translations agentMgmt.json (Portuguese, Brazilian)

* New translations generalSettings.json (French)

* New translations conversation.json (Portuguese, Brazilian)

* New translations conversation.json (Portuguese)

* New translations chatlist.json (Portuguese)

* New translations contact.json (Portuguese)

* New translations chatlist.json (Portuguese, Brazilian)

* New translations en.yml (Portuguese, Brazilian)

* New translations devise.en.yml (Portuguese, Brazilian)

* New translations en.yml (French)

* New translations en.yml (Spanish)

* New translations settings.json (Romanian)

* New translations setNewPassword.json (Portuguese)

* New translations setNewPassword.json (Ukrainian)

* New translations signup.json (Portuguese, Brazilian)

* New translations settings.json (Ukrainian)

* New translations settings.json (Portuguese, Brazilian)
2020-05-01 12:03:46 +05:30
29ae232e54 Feature: Add spanish (Spain) language (#671)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-01 11:45:46 +05:30
Nithin David ThomasandGitHub 1ebe9fdba9 Fixes broken seeds issue (#788) 2020-05-01 01:22:13 +05:30
0690d3191d Chore: Review docker issues (#787)
* Fix docker issues

Addresses: #701

* Add action cable configurations

Co-authored-by: Sony Mathew <ynos1234@gmail.com>
2020-04-30 21:32:34 +05:30
Sony MathewandGitHub 0b65526b85 Feature: Conversation Continuity with Email (#770)
* Added POC for mail inbox reply email
* created mailbox and migratuion for the same
* cleaned up sidekiq queues and added the queues for action mailbox and active storage
* created conversation mailbox and functionlaity to create a message on the conversation when it's replied

* Added UUID to conversation to be used in email replies

* added migration to add uuid for conversation
* changed parsing and resource fetching to reflect matching uuid and
  loading conversation alone
* cleaned up conversation mailbox.rb

* Added content type & attribute for message

* Added the new reply email to outgoing emails
* Added migration to accounts for adding domain and settings
* Modified seeds to reflect this changes
* Added the flag based column on account for boolean settings
* Added the new reply to email in outgoing conversation emails based on conditions

* Added dynamic email routing in application mailbox
* Added dynamic email routing in application mailbox
* Added a catch all deafult empty mailbox
* Added annotation for account

* Added the complete email details & attachments to the message
* Added the complete email details to the message in content_attributes, like subject, to, cc, bcc etc
* Modified the mail extractor to give a serilaized version of email
* Handled storing attachments of email on the message

* Added incoming email settings, env variables

* [#138] Added documentation regarding different email settings and variables

* Fixed the mail attachments blob issue (#138)
* Decoided attachments were strings and had to construct blobs out fo them to work with active storage
* Fixed the content encoding issue with mail body
* Fixed issue with Proc used in apllication mailbox routing
* Fixed couple of typos and silly mistakes

* Set appropriate from email for conversation reply mails (#138)
* From email was taken from a env variable, changed it to take from account settings if enabled
* Set the reply to email correctly based on conversation UUID
* Added commented config ind development.rb for mailbox ingress

* Added account settings for domain and support email (#138)
* Added the new attributes in accounts controller params whitelisting, api responses
* Added options for the the new fields in account settings

* Fixed typos in email continuity docs and warnings

* Added specs for conversation reply mailer changes (#138)
* Added specs for
  * conversation reply mailer
  * Accounts controller
  * Account and Conversation models

* Added tests for email presenter (#138)

* Specs for inbound email routing and mailboxes (#138)
2020-04-30 20:20:26 +05:30
0cb7333977 Feature: Twilio Whatsapp Integration (#779)
Twilio Whatsapp Integration

Co-authored-by: Sojan <sojan@pepalo.com>
2020-04-30 01:41:13 +05:30
Nithin David ThomasandGitHub 168042f9a4 Feature: Support an Emoji selector in the chat widget (#773)
* Adds emoji widget to web widget
* Style fixes for the send button
* Adds cursor to emoji widget action buttons
2020-04-29 13:54:56 +05:30
Pranav Raj SandGitHub fde4f9271b Bug: Redirect user to set new password screen (#772) 2020-04-27 15:15:05 +05:30
6770126de0 Feature: Customise the position of messenger (#767)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-04-25 23:18:00 +05:30
Andrei PopoviciandGitHub 94192e8184 Remove deprecated scope from FB Channel (#761)
Remove deprecated scope from FB Channel
2020-04-25 22:43:54 +05:30
Sojan JoseandGitHub 3fcd367952 Chore: New Crowdin translations (#747)
Brings in new translation files from Crowdin.
2020-04-23 23:52:16 +05:30
Pranav Raj SandGitHub 7d41b7a5dc Bug: Add account scoping in CTA (#754) 2020-04-23 12:21:45 +05:30
Pranav Raj SandGitHub 645d53db1c Bug: Fix webwidget.triggered event (#750) 2020-04-22 13:14:09 +05:30
Subin T PandGitHub dba6866b6d Bug: Force scoping message metrics to account_id (#748) 2020-04-22 12:49:46 +05:30
Pranav Raj SandGitHub b98a64d2dd Chore: Add S3 bucket policy (#746) 2020-04-20 15:40:45 +05:30
Pranav Raj SandGitHub 06153a96ed Chore: Update swagger API documentation (#745)
* Chore: Update swagger documentation
2020-04-20 11:55:06 +05:30
Vishnu NarayananandGitHub 5736f687e8 Chore: Bump ruby version to 2.7.0 in docs (#744) 2020-04-19 23:41:16 +05:30
941fbb0d72 Chore: Web widget Inbox Tech Debts (#738)
* Chore: Webwidget Inbox Tech Debts

* Additional customization options creating Web Widget
* Changes to edit Page for Web Widget
* Remove the WebWidget API end points
* Minor chores

Address: #680, #502

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-19 23:40:28 +05:30
c0ce70e87b Chore: Events Cleanup (#739)
* Chore: Events Cleanup

- fix failing tests
- add additional webhook events
- clean up event logic

* Fix conversation status update in action cable

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-18 20:25:58 +05:30
Sojan JoseandGitHub ecccb103a0 Chore: Add a real-time event for contact resolution/update (#696)
* Chore: Add a real-time event for contact resolution/update
* Chore: Ensure Events are sent to administrators

Addresses: #419
2020-04-18 13:47:51 +05:30
818c769bb7 Chore: Message to support multiple attachments (#730)
* Changes for the message to have multiple attachments
* changed the message association to attachments from has_one to has_many
* changed all the references of this association in building and fetching to reflect this change

* Added number of attachments validation to the message model

* Modified the backend responses and endpoints to reflect multiple attachment support (#737)

* Changing the frontend components for multiple attachments
* changed the request structure to reflect the multiple attachment structures
* changed the message bubbles to support multiple attachments
* bugfix: agent side attachment was not showing because of a missing await
* broken message was shown because of the store filtering
* Added documentation for ImageMagick

* spec fixes

* refactored code to reflect more apt namings

* Added updated message listener for the dashboard (#727)
* Added the publishing for message updated event
* Implemented the listener for dashboard

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-17 21:15:20 +05:30
Pranav Raj SandGitHub 0817414957 Chore: Upgrade babel packages (#736)
Chore: Upgrade babel
2020-04-17 18:49:14 +05:30
Pranav Raj SandGitHub e3ccfc4662 Bug: Fix IE issues in Widget (#734) 2020-04-17 16:45:12 +05:30
Sony MathewandGitHub 2aa92d46fc Fixed confirmation email flaky tests (#534) (#735) 2020-04-17 15:48:23 +05:30
c2167fcaaf Feature: Add catalan (Catalonia) language (#672)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-04-16 15:28:23 +05:30
Sojan JoseandGitHub 743bddc065 Chore: Housekeeping tasks (#721)
- End point to return api version
- Move agent bot listener to sync dispatcher
- gem update
2020-04-16 15:05:01 +05:30
55892e37f9 Feature: Add Malayalam(മലയാളം) localization (#707) (#708)
* Add Malayalam localization

* Added Malayalam translations for dashboard locales (UI)

 Translations for
* webhooks, signup, settings, set a new password, reset password, report, login, integrations

* Added Malayalam translations for dashboard translations for UI

* Added dashboard Malayalam translations for contact, conversation, general settings and inbox management.

* [707] Add Malayalam translations for dashboard

* [707] Add support for Malayalam

* [707] Fix review comments

* [707] fix review commetns

Co-authored-by: sony-mathew <ynos1234@gmail.com>
2020-04-13 21:14:17 +05:30
Sojan Jose 9db8adab5f Update Crowdin configuration file 2020-04-13 19:01:00 +05:30
Sojan Jose 991585264e Update Crowdin configuration file 2020-04-13 16:47:31 +05:30
b0950d6880 Feature: Rich Message Types (#610)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-04-10 16:42:37 +05:30
Pranav Raj SandGitHub 48f603798b Chore: Fix URLs in README 2020-04-08 22:46:58 +05:30
1cfa756d49 Chore: APIs for agent bots (#676)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-07 10:41:18 +05:30
4feca1d88d Feature: Business logo API for web widget (#674)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-07 10:19:19 +05:30
Sojan e04b37dfcf Merge branch 'release/1.3.0' 2020-04-06 22:58:20 +05:30
99eaf59509 Feature: Ability to set an account name (#667)
* Ability to change the account name 
* Ability to set a language to the account

Addresses: #667  #307  

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-04-06 22:17:07 +05:30
Pranav Raj SandGitHub a1a81e3799 Feature: Twilio SMS Channel (#658)
Twilio SMS Channel
Fixes :  #350
2020-04-05 22:11:27 +05:30
Sojan JoseandGitHub 8e59564793 Chore: Update ruby version (#665) 2020-04-05 12:11:50 +05:30
cb22b396eb Feature: Website SDK (#653)
Add SDK functions

Co-authored-by: Sojan <sojan@pepalo.com>
2020-04-03 13:04:58 +05:30
7fcd2d0e85 Feature: Support file type messages on widget and dashboard (#659)
- Adds support for file upload

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2020-04-02 12:28:38 +05:30
Sony MathewandGitHub 0afa5c297f Bug: Fixed conversation reply mail issue when an attachment is sent (#655)
* When an attachment was sent in the reply mailer it was breaking due to the
truncating function applied on the last message content. Here the content was empty
and so it broke.
* Fixed this breakage
* Also addressed the issue that if the attachment was there the content was coming empty.
With these changes, made the content to have a link to the attachment.
2020-03-30 16:07:01 +05:30
Nithin David ThomasandGitHub 6c4e1fdaac Feature: Send images from widget 2020-03-30 12:15:06 +05:30
Subin T PandGitHub e56132c506 Non blocking event dispatch (#652)
- Performance improvements for event dispatch
2020-03-29 19:18:30 +05:30
Sojan JoseandGitHub bab9d663d2 Feature: API for updating account settings (#645)
* Feature: API for updating account settings

- API to update account locale
- API to update account name
- API to show account info
2020-03-29 12:16:31 +05:30
Pranav Raj SandGitHub 6c48f2e789 Bug: Update conversation urls in email (#649)
Update the conversation URLs in email templates.
2020-03-29 09:34:57 +05:30
50ebbc13b6 Chore: Add Twitter documentation (#648)
* Chore: Add Twitter documentation

Co-authored-by: Sojan <sojan@pepalo.com>
2020-03-28 11:51:42 +05:30
a3c2d4e5bd Chore: Add Facebook app set up documentation (#647)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-03-28 11:43:02 +05:30
Sony MathewandGitHub 209e0a0fb4 [Feature] Change conversation ordering (#640)
* Update conversation's updated_at when a message is created/saved
* changed teh ordering of conversation to be based on `updated_at` rather than `created_at`
2020-03-24 23:34:22 +05:30
Pranav Raj Sreepuram 2eac97c705 Merge branch 'hotfix/1.2.4' into develop 2020-03-22 20:43:58 +05:30
Pranav Raj Sreepuram bf80a37cfb Merge branch 'hotfix/1.2.4' 2020-03-22 20:41:51 +05:30
Pranav Raj SandGitHub a94f14ca22 Bug: Disable logging to file on asset precompile (#637) 2020-03-22 20:38:49 +05:30
Nithin David ThomasandGitHub f7e5f1fabf Feature: Send attachments to widget user (#621) 2020-03-22 15:54:36 +05:30
Nithin David ThomasandGitHub fe70843fae Feature: Improve Dashboard UI (#630) 2020-03-22 11:44:40 +05:30
Pranav Raj SandGitHub 29bb2bff3a Security: Upgrade eslint, eslint-config-airbnb (#635) 2020-03-21 21:01:55 +05:30
Pranav Raj SandGitHub 4c40d738a5 Security: Upgrade rails to 6.0.2.2 (#636) 2020-03-21 20:54:04 +05:30
Pranav Raj SandGitHub 1c4566df66 Bug: Migrate messages while merging contact (#624)
Bug: Migrate messages while merging contact
2020-03-19 01:52:38 +05:30
Subin T PandGitHub 8f6f07177d Enhancement: Move reporting metrics to postgres (#606) 2020-03-18 16:53:35 +05:30
Sojan f69eb7e542 Merge branch 'hotfix/1.2.3' into develop 2020-03-18 01:53:24 +05:30
Sojan 9d170fc727 Merge branch 'hotfix/1.2.3' 2020-03-18 01:53:13 +05:30
Sojan 8d65e7db95 HotFix: Tune the chatwoot logs
Fixes : #616
2020-03-18 01:40:34 +05:30
Arief LuthfiandGitHub 71d48854b1 Chore: Refactor Facebook send reply service
Refactor Facebook send reply service
2020-03-17 21:09:20 +05:30
Pranav Raj SandGitHub 4d0f46176b Chore: Add web_widget_script in the Inboxes API (#615)
* Chore: Add web_widget_script in the Inboxes API
2020-03-16 12:32:34 +05:30
Nithin David ThomasandGitHub d8599c62dd Feature: Support options message type on widget and dashboard (#614) 2020-03-16 12:08:40 +05:30
ghosteathumanandGitHub bb47b5f086 Reduce long peer dependencies warning (#568)
Co-authored-by: ghosteathuman <46582963+ghosteathuman@users.noreply.github.com>
2020-03-12 22:00:58 +05:30
Nithin David ThomasandGitHub fb17d34b8a Feature: Support card options in widget and dashboard #594 (#609) 2020-03-12 21:23:52 +05:30
Pranav Raj SandGitHub 260e40831a Chore: Update Swagger API docs (#608) 2020-03-11 16:19:13 +05:30
a5b1e2b650 Feature: Access tokens for API access (#604)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-11 00:02:15 +05:30
19ab0fe108 Chore: Scope URLs with account_id (#601)
* Chore: Enable Users to create multiple accounts

Addresses: #402
- migrations to split roles and other attributes from users table
- make changes in code to accommodate this change

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-09 23:27:10 +05:30
Pranav Raj Sreepuram 2a6670f0da Merge branch 'hotfix/1.2.2' into develop 2020-03-09 10:01:15 +05:30
Pranav Raj Sreepuram 91bccd3c6d Merge branch 'hotfix/1.2.2' 2020-03-09 10:00:42 +05:30
Pranav Raj Sreepuram ef6c695bcb Chore: Add additional_attributes to conversation seed 2020-03-09 10:00:11 +05:30
Pranav Raj Sreepuram 1db35caa56 Merge branch 'release/1.2.1' into develop 2020-03-08 22:15:58 +05:30
Pranav Raj Sreepuram 1273ea64d3 Merge branch 'release/1.2.1' 2020-03-08 22:15:04 +05:30
Pranav Raj SandGitHub 2a4fb7b056 Bug: Fix conversation not loading from the links in email (#602)
Bug: Load conversation from links
2020-03-08 22:08:25 +05:30
60dc564f37 Bug: Fix missing close button on mobile chat window (#600)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-07 23:39:41 +05:30
8b4df986bf Chore: Enable Users to create multiple accounts (#440)
Addresses: #402
- migrations to split roles and other attributes from users table
- make changes in code to accommodate this change

Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-07 12:18:16 +05:30
Sojan JoseandGitHub a8ac048716 Bug: Fix duplicate messages from Twitter DM and tweets (#599)
* Bug: Fix duplicate messages from Twitter DM and tweets
2020-03-06 01:47:37 +05:30
b2d5cc7b05 Feature: Introduce bots (#545)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-03-06 01:43:12 +05:30
Sony MathewandGitHub fabc6c87af Chore: User Friendly URLs on the swagger docs (#590)
Made the swagger documentation urls short and readable.
2020-03-04 00:41:21 +05:30
Pranav Raj SandGitHub f76ba889dd Docs: Add webhook documentation (#588) 2020-03-03 18:52:30 +05:30
Pranav Raj SandGitHub 97ad512c21 Security: Upgrade puma to 4.3.3 (#586) 2020-03-03 13:00:54 +05:30
Nithin David ThomasandGitHub dfdb68e1c3 Enhancement: Improve UI on user preferences page (#584) 2020-03-03 12:39:05 +05:30
Sojan c772c0af03 Merge branch 'release/1.2.0' 2020-03-01 19:33:41 +05:30
Sojan JoseandGitHub cda65ea339 Feature: Conversation creation email notifications (#576)
* Clean up the mailers

* Disable assignment mailer if setting is turned off

* Email notifications on conversation create

* Specs
2020-03-01 19:06:13 +05:30
Pranav Raj SandGitHub d6237dfc59 Feature: Add UI to update email notification preferences (#579) 2020-03-01 17:47:08 +05:30
Pranav Raj SandGitHub 629c73d3ce Fix onBackDropClick (#578) 2020-03-01 11:23:55 +05:30
Tim LangeandGitHub bbf01037c6 Chore: Added tests for conversations messages controller (#575) 2020-03-01 04:56:30 +05:30
7f26b34b15 Feature: Add new notification settings for user (#569)
Added new notification settings API for user 

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-02-29 20:41:09 +05:30
dependabot[bot]andGitHub bbd9968d4b Chore(deps): Bump puma from 4.3.1 to 4.3.2 (#573)
Bumps [puma](https://github.com/puma/puma) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v4.3.1...v4.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-29 18:06:27 +05:30
c119c6577b Feature: As a admin, I should be able to add webhooks to account (#572)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-29 17:43:49 +05:30
Pranav Raj SandGitHub e8cf59c661 Feature: Alert widget user when message is received from agent (#571) 2020-02-29 11:27:02 +05:30
b05f843790 Chore: Making Account Signup Optional (#563)
Introduce new environment variable that lets you control account signups
ENABLE_ACCOUNT_SIGNUP :( true | false | api_only )
Fixes: #406

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-29 11:20:33 +05:30
Sony MathewandGitHub 0aad99ff0b Chore: Update the source of json_refs gem (#565) (#566)
At the time of using, `json_refs` gem did not have the ability to recursively resolve the references. So we had to fork this into one of our own and make the required changes. So this fork was used as the source for the gem.
Along with this, we had raised a PR in the original repo so as to push the recursive dereferencing changes upstream. This was merged in the gem's parent repo. So updated the source of this gem to the original parent repo source.
2020-02-27 01:19:26 +05:30
Pranav Raj SandGitHub 0740d4762f Enhancement: Paginate conversation calls in tabs (#560)
* Use conversationPage module for pagination

* Load more conversations

* Reset list if conversation status is changed

* Add specs to conversationPage

* Reset filter when page is re-mounted

* Update text

* Update text
2020-02-26 21:15:01 +05:30
Tim LangeandGitHub e5bc372a29 Chore: Added tests for callbacks_controller (#531)
* Chore: Added tests for callbacks_controller
2020-02-26 18:22:08 +05:30
74f8a35cfc Chore: Environment variable to force ssl (#561)
Fixes: #558

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-26 11:36:22 +05:30
1f158aa193 Chore(deps): Bump nokogiri from 1.10.7 to 1.10.8 (#564)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.10.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.10.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-26 09:59:38 +05:30
Subin T PandGitHub 7479b5db43 Feature: Support account/inbox specific webhooks (#562) 2020-02-26 09:44:24 +05:30
Sony MathewandGitHub 4d5e7b4adf Bug: Added Sidekiq to production docker compose (#555) (#557)
* Sidekiq service was missing from the production docker compose file. Added it.
2020-02-25 01:23:29 +05:30
Pranav Raj SandGitHub 55b001435b Bug: Fix yarn.lock discrepancies (#554) 2020-02-24 10:32:35 +05:30
Sony MathewandGitHub fc1fa579e9 Chore: Document Conversation APIs in swagger (#552)
* Added the documentation for the conversation APIs - 8 endpoints
* Added descriptions for the existing endpoints
* Added new resource models and updated some parts of the contact API
2020-02-24 00:51:31 +05:30
Sony MathewandGitHub c7a4550477 Updated Docker documentation
* Removed the links to docker hub
2020-02-23 23:11:11 +05:30
Nithin David ThomasandGitHub fd8e8c7c87 Enhancement: Add close button to the contact sidebar panel (#551) 2020-02-23 21:13:28 +05:30
Nithin David ThomasandGitHub 2d3212575d Enhancement: Hides available in widget interaction (#548) 2020-02-23 15:16:09 +05:30
Sony MathewandGitHub e2688d5176 Chore: Swagger Docs V1 (#546) 2020-02-23 12:54:29 +05:30
Nithin David ThomasandGitHub eea92bd0ac Bug: Add link cursor to widget close button (#544) 2020-02-22 20:20:43 +05:30
Pranav Raj SandGitHub 1261cc7783 Enhancement: Upgrade @babel/preset-env (#542) 2020-02-22 20:16:56 +05:30
a790dc640f Fix: Changed overflow scroll to overflow auto (#523)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-02-22 19:15:45 +05:30
67f4f69e8a Bug: Fix error message when existing agent email is reused for a new agent (#538)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-22 19:06:16 +05:30
Pranav Raj SandGitHub 6340eb3ae2 Security: Upgrade @rails/webpacker and jest (#540)
* Security: Upgrade @rails/webpacker and jest

* Upgrade jest from 24.9.0 to 25.1.0
* Upgrade @rails/webpacker from 4.0.7 to 4.2.2

* Update test to use 1 worker
2020-02-22 19:02:11 +05:30
Nithin David ThomasandGitHub 708d2688ff Bug: Fix URL text overflow (#537) 2020-02-22 15:32:15 +05:30
91f8b4a650 Bug: Show helper description for code in finish setup page (#532)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-02-22 14:27:04 +05:30
Nithin David ThomasandGitHub 330bf87f08 Bug : Inbox Filter indicator is removed when a conversation is selected (#535) 2020-02-22 14:24:51 +05:30
Tim LangeandGitHub bc884ae184 Chore: Added tests for dashboard_controller (#529) 2020-02-21 00:43:14 +05:30
Nithin David ThomasandGitHub f7c8358549 Bug: Hide contact panel when inboxId is not present (#530) 2020-02-20 19:48:09 +05:30
Subin T PandGitHub d36e1b52f6 Enhancement: Add event name in webhook payload (#528)
* chore: Remove unwanted twitter gem
* Enhancement: Add event name in webhook payload
fixes #528 #516 #518
2020-02-20 16:19:42 +05:30
Tim LangeandGitHub 813cdd8aec Chore: Added tests for facebook_indicators_controller (#526) 2020-02-20 12:12:19 +05:30
b7e725a7cd Fix: Fixed code font not being displayed on windows (#525)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-02-20 11:11:36 +05:30
9674e0bff4 Bug: Fix misalignment of back button (#524)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-02-20 11:02:12 +05:30
4817f4a28c Bug: Fixed color of agent link in chat widget being white (#522)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-02-20 10:59:43 +05:30
Sony MathewandGitHub 04c62417fa [491] Bug fix - Sidekiq Redis Auth issue (#527)
* When the the .env file has line with REDIS_PASSWORD set as empty, the value for this in the initializers comes as an empty string "".
* Fixed this in a way that, if it's empty string, then it's taken as `nil` value so that password is skipped
2020-02-20 10:52:26 +05:30
Tim LangeandGitHub 30e5edf6dc Feature: Add ability to disable auto assignment of conversations (#513) 2020-02-19 14:40:03 +05:30
Tim LangeandGitHub e0afb84502 Chore: Removed unused functions from home_controller (#512) 2020-02-19 13:51:22 +05:30
fbefb78817 Enhancement: Update the design of inbox listing in sidebar (#511)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-19 10:30:34 +05:30
Vishnu NarayananandGitHub f00e1dcdc8 Chore: Update docker setup manual (#504)
* Chore: Update docker setup manual (#503)
2020-02-17 19:52:26 +05:30
Tim LangeandGitHub 60547b9fb3 Chore: Added tests for contacts_controller (#509)
- Tests for contacts controller
Addresses:  #37
2020-02-17 17:08:29 +05:30
Tim LangeandGitHub fc23a10a99 Chore: Added tests for conversations_controller (#508)
* Chore: Added tests for conversations_controller
* Chore: Remove get_messages function from conversations
2020-02-17 15:57:57 +05:30
Tim LangeandGitHub 44a3977f5c Chore: Added tests for inboxes_controller (#507) 2020-02-17 15:39:24 +05:30
Tim LangeandGitHub a2316d4d09 Chore: Added tests for subscriptions_controller (#483)
Added tests for subscriptions_controller
ref: #37
2020-02-17 07:51:45 +05:30
Pranav Raj SandGitHub c32d391261 Bug: Fix imports in ProfileSettings (#506) 2020-02-16 22:20:59 +05:30
Pranav Raj SandGitHub c4e2a84f65 Feature: Agent Profile Update with avatar (#449)
* Feature: Agent Profile Update with avatar
* Add Update Profile with name, avatar, email and password
2020-02-16 17:20:38 +05:30
e61ba95cf7 Feature: Add/Edit conversation labels (#488)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-16 15:46:26 +05:30
Sojan JoseandGitHub 77473dc2aa Chore: Include avatar url in sign_in response (#501)
- include avatar url in sign_in response ( fixes #500 )
- fix circle ci builds
2020-02-15 22:57:48 +05:30
Subin T PandGitHub eb5185974a Monitoring: Add Scout APM (#487)
* Add scout APM
2020-02-15 04:22:36 +05:30
Subin T PandGitHub 919261d843 Feature: Webhooks (#489) 2020-02-14 23:19:17 +05:30
sony-mathew 79a847aeab Merge branch 'hotfix/1.1.3' into develop - Bug Fix : Adjusted the connection pool size and concurrency for Sidekiq 2020-02-11 22:59:07 +05:30
sony-mathew 301b1829bc Merge branch 'hotfix/1.1.3' - Bug Fix : Adjusted the connection pool size and concurrency for Sidekiq 2020-02-11 22:58:43 +05:30
sony-mathew 6645d7f80b Bug Fix : Adjusted the connection pool size and concurrency for Sidekiq 2020-02-11 22:58:19 +05:30
sony-mathew baf1a6e8da Merge branch 'hotfix/1.1.3' into develop - Bug Fix : Increased the connection pool size and concurrency for Sidekiq 2020-02-11 21:52:37 +05:30
sony-mathew 1e955455f0 Merge branch 'hotfix/1.1.3' Bugfix : Increased sidekiq connection pool and concurrency 2020-02-11 21:51:46 +05:30
sony-mathew fdbad7c5d8 Bug Fix : Increased the connection pool size and concurrency for Sidekiq 2020-02-11 21:50:38 +05:30
Sojan 2023d5d42b Revert "Updates sidebar on dashboard"
This reverts commit 6186d14593.
2020-02-11 19:34:42 +05:30
Nithin David 6186d14593 Updates sidebar on dashboard 2020-02-11 19:21:55 +05:30
30f4c08143 Feature: SignIn with Twitter (#479)
* Add Twitter SignIn flow

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-02-11 14:27:38 +05:30
Pranav Raj SandGitHub 272c481464 Feature: Create conversations from Tweets (#470)
* Feature: Add tweets to conversations
2020-02-09 15:47:48 +05:30
Tim LangeandGitHub 3465ebefd1 Chore: Added tests for assignments_controller (#482) 2020-02-08 23:48:00 +05:30
Tim LangeandGitHub b9836309fb Chore: Added tests for agents_controller (#481) 2020-02-08 23:05:41 +05:30
Tim LangeandGitHub 6c46891ee1 Chore: Remove unnessecary check if object exists (#480) 2020-02-08 22:38:37 +05:30
Tim LangeandGitHub 67e41092e6 Chore: Added tests for inbox_members (#478) 2020-02-08 13:21:41 +05:30
Tim LangeandGitHub 1d269f4e8d Chore: Added tests for canned_responses (#477) 2020-02-08 11:58:40 +05:30
Tim LangeandGitHub 37289fbd63 Chore: Increase test coverage for conversations controller (#476) 2020-02-07 21:43:51 +05:30
Tim LangeandGitHub a30a8867a3 Chore: Increase test coverage for accounts controller (#475) 2020-02-07 16:41:49 +05:30
Tim LangeandGitHub 5210d201b6 Chore: Increase test coverage for widgets controller (#473) 2020-02-07 13:14:07 +05:30
Vishnu NarayananandGitHub 3eb5b3a0c1 docs: Update contribution guidelines (#471) (#474) 2020-02-07 12:05:09 +05:30
Tim LangeandGitHub 3fa7c605c3 Chore: Increase test coverage for widget messages (#472) 2020-02-07 00:51:47 +05:30
Pranav Raj SandGitHub 7b1fdc5fcd BugFix: Filter duplicate DMs in Twitter Integration (#468)
BugFix: Filter duplicate DMs in Twitter Integration
2020-02-05 18:50:37 +05:30
Pranav Raj SandGitHub 607fc25723 Bugfix: Fix copy in agent availability status (#466)
Copy update for agent status
2020-02-05 12:11:33 +05:45
83b0bb4062 Feature: As an end-user, I should be able to see the list of agents in the widget. (#461)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-05 11:27:22 +05:30
33e0bd434b Chore: Update the copy used in signup page (#464)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-02-03 20:12:37 +05:45
Sojan 002463aede Merge branch 'hotfix/1.1.2' into develop 2020-02-03 14:33:53 +05:45
Sojan f1613f4a0d Merge branch 'hotfix/1.1.2' 2020-02-03 14:33:43 +05:45
Sojan 1aebdc63d5 Fix coverage issue with codeclimate 2020-02-03 14:29:03 +05:45
Sojan 8d6f9cad05 Merge branch 'hotfix/1.1.1' into develop 2020-02-03 14:14:39 +05:45
Sojan 03a46d0cfe Merge branch 'hotfix/1.1.1' 2020-02-03 14:14:29 +05:45
Sojan 067411b5b6 Fix heroku deploy and docker image issues
#458
#459
2020-02-03 14:02:32 +05:45
Sojan cf56b9560d Merge branch 'release/1.1.0' 2020-02-03 01:01:03 +05:45
a9c304f1ef Feature: Twitter DM Integration (#451)
An initial version of twitter integration

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-02-03 00:54:00 +05:45
Sojan JoseandGitHub a287c86bc4 Bugfix: Fix password reset (#455) 2020-02-02 22:52:38 +05:30
Pranav Raj SandGitHub 0b31e14132 Feature: Add online status to each user (#452)
* Feature: Add online status to each user
* Add OnlineStatusable, add availability status to thumbnail
2020-02-02 22:49:16 +05:45
Pranav Raj SandGitHub 1f4703d25d Chore: Disable brakeman in Codeclimate (#453) 2020-02-02 17:35:03 +05:30
b3264a0d7b Feature: API to get most used labels (#447)
* Add most-used labels API

* Filter conversation by labels

* Move match_all to any query

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-02 16:29:18 +05:30
Sojan JoseandPranav Raj S 199642d3bd Chore: Render avatar url in validate token method (#448) 2020-01-27 00:59:51 +05:45
Anto DominicandSony Mathew 6325acd183 Feature: Add Sidekiq docker (#443)
* update db:schema due to migration

* reduce default concurrency for redis connection limit

* Allow auto update packages in the development mode without building image

* add sidekiq support to docker-compose

* Pass sidekiq cofig file

* passed the env file in base image rather than separately in rails, web packer and sidekiq in docker-compose
* removed un-necessary changes in schema
* changed concurrency to finer values
* removed default size set in sidekiq redis config
* Added the sidekiq config option in Procfile.dev

Co-authored-by: Sony Mathew <ynos1234@gmail.com>
2020-01-27 00:15:13 +05:45
sony-mathew 8cf135f2db Merge branch 'hotfix/1.0.3' into develop
# Conflicts:
#	config/cable.yml
#	docs/development/environment-setup/docker.md
2020-01-26 22:51:39 +05:45
sony-mathew 6efa994096 Merge branch 'hotfix/1.0.3' - Support for authenticated redis connections 2020-01-26 22:47:00 +05:45
sony-mathew 2168f823a5 [#446] Redis authentication support
Previously we did not support authentication for redis anywhere. Also in the docker compose we were exposing redis port 6379 without any authentication. In the app side for the connections that app server (for storing keys as well as for socket connections made using action cable) and Sidekiq were making to redis server did not support authentication.

With this commit, we support authentication for redis connections from app side and Sidekiq. This is supported in docker-compose as well.

The changes include :
* Added support for new env variable REDIS_PASSWORD
* This redis password is now supported by action cable connections, Sidekiq connections and app side redis connections
* Since Sidekiq did not have an initializer, added an initializer to pass custom config to Sidekiq (for now it's options for redis)
* Changes in docker-compose to pickup a password set in .env file to protect the redis server running in docker
* Added necessary documentation changes in `docker.md` and `environment-variables.md`
2020-01-26 22:46:34 +05:45
Sony MathewandGitHub 1fd4127709 Removed agent dashboard link in conversation mail to user (#445) 2020-01-24 14:31:52 +05:45
Sony MathewandPranav Raj S 04d347f0ee Chore: Changed from email and reply to email for conversation email (#444) 2020-01-24 14:10:52 +05:45
Sony MathewandSojan Jose d4b3ba4baa [#139] Send conversation emails (#442)
* [#139] Delayed emails for conversations

* Added the setex and get methods to Redis wrapper
* Set the priorities for the sidekiq queues
* Was not able to use mailhog for testing email in local, switched back to letter opener and added comments on using the SMTP settings
* Added after create hood in messages to queue the sending of mail after 2 minutes using sidekiq worker and also set the redis key for the conversation to avoid the email sending for every message
* Added the sidekiq worker to send the email and delete the conversation redis key
* Added the mailer and mail template
* mailer sends the last 10 messages along with the new messages from the time it was queued

* Send email only in development or if smtp config is set

* Send email only in development or if smtp config is set
* Set the SMTP_PORT in production variable

* Adding redis to circle CI

* Specs for the conversation email changes

* Added specs for conversation email sidekiq worker
* Added specs for conversation mailer
* Added specs in message model for the after create hook for notify email

* Send emails only when there is a reply from agent

* set development to use mailhog

* Adding comments for using letter opener
2020-01-23 23:14:07 +05:45
Sojan JoseandPranav Raj S 1d3ed016be Chore: Documentation for configuring cloud storage (#439) 2020-01-21 22:28:18 +05:45
Pranav Raj SandSojan Jose 95fb6893b4 Feature: API to list the agents for the inbox (#438)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-01-21 19:56:58 +05:45
Pranav Raj SandSojan Jose a2b025b548 Feature: View conversation labels on sidebar (#436) 2020-01-21 18:57:44 +05:45
Pranav Raj SandSojan Jose 90e678743b Update contributing.md (#434) 2020-01-20 23:48:29 +05:45
Muhsin.KandGitHub 9290893f9d Style: Fix the last message style issue (#433) 2020-01-19 14:17:15 +05:30
Nithin David ThomasandPranav Raj S f7f7a6b9c7 Feature: Widget design update (#426) 2020-01-17 13:36:05 +05:30
Subin T PandSojan Jose cc180b77ce Include only incoming/outgoing messages in reporting (#429)
* Skip activity messages from reporting

* Makes reportable? as access list for reporting
2020-01-14 00:50:18 +05:30
Pranav Raj SandSojan Jose 18bf1a9e62 Ignore case from input email (#424) 2020-01-13 14:25:23 +05:30
Nithin David ThomasandPranav Raj S 7cf19e0b52 Feature: Update design for web widget (#408) 2020-01-13 12:10:40 +05:30
Pranav Raj SandSojan Jose 655c585358 Feature: View a contact's previous conversation (#422)
* Add API to fetch conversations of a contact

* Add conversation list in sidebar
2020-01-13 11:17:03 +05:30
Pranav Raj SandGitHub fc6a8c2601 Bug: Fix Heroku deployment on develop branch(#421) 2020-01-12 19:31:32 +05:30
Sojan 63789e5916 Merge branch 'hotfix/1.0.2' into develop 2020-01-09 14:36:50 +05:30
Sojan e04ff6441b Merge branch 'hotfix/1.0.2' 2020-01-09 14:36:35 +05:30
Sojan 6c0076665a Bugfix: Production autoload issue for bot.rb
- add app/bot to auto load path
2020-01-09 14:36:20 +05:30
Sojan JoseandPranav Raj S 722f540b03 [Feature] Email collect message hooks (#331)
- Add email collect hook on creating conversation
- Merge contact if it already exist
2020-01-09 13:06:40 +05:30
Sojan 59d4eaeca7 Merge branch 'hotfix/1.0.1' into develop 2020-01-09 12:01:07 +05:30
Sojan 9c2f37d0f9 Merge branch 'hotfix/1.0.1'
Bugfix: Sidekiq queues getting stuck [#411]
2020-01-09 11:59:56 +05:30
Sojan 8e6b735299 Bugfix: Sidekiq queues getting stuck [#411]
ref: https://github.com/rails/rails/issues/36810
closes: #411
2020-01-09 11:59:31 +05:30
Pranav Raj SandMuhsin.K b00e13f9db Docs: Add brancing model (#410) 2020-01-08 23:10:46 +05:30
Sojan JoseandPranav Raj S f875a09fb7 Chore: Switch from Carrierwave to ActiveStorage (#393) 2020-01-07 22:59:17 +05:30
mbronek7andSojan Jose f02d422b6a Move ActionCable Broadcast Calls to sidekiq #154 (#403)
* Move Pusher Calls to sidekiq

* CR changes

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2020-01-06 22:32:41 +05:30
Sojan JoseandPranav Raj S 91ace96acd Chore: Sidekiq ActionCable fix for Development (#405)
- action cable works from sidekiq in development environments
- documentation updates for docker
2020-01-05 23:26:22 +05:30
Sojan 4f875dae4c Merge branch 'release/1.0.0' 2020-01-03 12:57:16 +05:30
Pranav Raj SandSojan Jose f178429df2 Docs: Update year in license file (#401) 2020-01-02 12:27:22 +05:30
Pranav Raj SandSojan Jose 439e064d90 Feature: Contact Panel with conversation details (#397)
* Add Contact panel changes

* Fix parent iframe blocked

* Add Conversation Panel, Contact messages

* Update contact panel with conversation details

* Update designs in sidebar

* Fix specs

* Specs: Add specs for conversationMetadata and contact modules

* Fix currentUrl issues

* Fix spelling

* Set default to empty string
2020-01-01 22:30:43 +05:30
Cadu RibeiroandSojan Jose 434d6c2656 Reduce docker image size (#394)
Reduce docker image size based on:  https://cadu.dev/reduce-your-docker-images-an-example-with-ruby/
2019-12-31 18:23:18 +05:30
Pranav Raj SandGitHub 7c4cc68561 Bug: Force fetch inbox settings on route change (#400) 2019-12-30 11:53:16 +05:30
Sojan JoseandPranav Raj S bacc0b2f18 Enhancement: Use S3 for active storage (#398) 2019-12-29 11:13:28 +05:30
Pranav Raj SandSojan Jose e2aeeeca43 Specs: Add specs for Facebook::SendReplyService (#396) 2019-12-28 23:14:09 +05:30
Jonathan AlzettaandPranav Raj S 790877c056 Docs: Fix typo in website channel setup (#395) 2019-12-28 22:26:20 +05:30
Pranav Raj SandSojan Jose 5ddc46c474 Refactor: Inbox store, remove inboxes from sidebar (#387)
* Refactor: Inbox store, remove inboxes from sidebar

* Add a new page for inbox settings

* Show inboxes on sidebar

* Add inbox_members API

* Disable similar-code check

* Fix codeclimate scss issues

* Add widget_color update API and actions

* Add specs for inbox store

* Fix Facebook auth flow

* Fix agent loading, inbox name
2019-12-28 21:56:42 +05:30
Mukesh ChaudharyandSojan Jose 96f8070e79 Add specs for Policies (#392)
* Add specs for Policies

* Fix CI issues
2019-12-28 01:27:59 +05:30
Pranav Raj SandSojan Jose 19b4311e8b Upgrade: Use postgres 11.6 in docker-compose (#391) 2019-12-26 22:04:52 +05:30
Pranav Raj SandSojan Jose 005ca62c6e Bug: Fix signup 500 error (#389) 2019-12-26 11:52:14 +05:30
Pranav Raj SandSojan Jose f55c42d5a1 Bug: Fix copy when no inbox is added. (#386) 2019-12-25 20:06:43 +05:30
Pranav Raj SandSojan Jose 3440230187 [Bug] Fix short_code param in update canned response API (#385) 2019-12-25 11:52:02 +05:30
Anto DominicandSojan Jose 4e9290ad76 Send emails via sidekiq (#380)
* add sidekiq web view if the user is an administrator

* add sidekiq setup configuration and support

* update devise to use delivery_later method and update test

* update conversation to use deliver_later instead of deliver

* Update Routes

* Add Procfile for Heroku One-Click Start

* updating docs

* update concurrency and Procfile for supporting Heroku Free Dyno

* update Procfile.dev
2019-12-25 03:03:02 +05:30
Anto DominicandPranav Raj S 335e7487e6 Docs: Update docker guide to use website docs (#383) 2019-12-25 00:10:36 +05:30
Sojan JoseandPranav Raj S f98cd83a29 Code-climate duplicate code fixes (#382)
* Code-climate duplicate code fixes

* Spec for accounts controller
2019-12-24 17:32:27 +05:30
SojanandPranav Raj S 97ab82892d Chore: labels to Conversations [#245] 2019-12-24 16:42:18 +05:30
Sojan JoseandPranav Raj S 7d85f2e046 Feature: Contact Merge Action (#378) 2019-12-24 13:27:25 +05:30
Pranav Raj SandSojan Jose 32efe8676f Fix formatting in docs (#379) 2019-12-23 13:00:22 +05:30
Pranav Raj SandSojan Jose 1143893d9c [Bug] Fix conversation assignment mailer url (#374)
* Fix conversation assignment mailer url

* Remove mailer scope
2019-12-23 12:16:46 +05:30
Sojan JoseandPranav Raj S 9c7d8bb60d [Docs] Update docker documentation (#377) 2019-12-23 11:56:25 +05:30
Anto DominicandSojan Jose 1ee17cc826 [Enhancement] Docker support Debugging (byebug & pry) and receive emails to MailHog via smtp (#371)
* updated development docker setup

* turned on yarn integrity check

* create test docker compose and update development dockerfile

* create docker Readme.md file

* fix README.md file

* create docker-copmose and dockerfile for production/staging environment setup

* added mailhog to catch email

* remove yarn integrity check in development mode!

* Update Readme.md file to support mailhog inbox

* update link to docker development guide from mail README

* remove .env.development and use .env.example for docker as .env.development was mixing with circleci config

* make the dockerfile configurable like before

* update docker-compose as per suggesion in PR

* create docker setup docs

* Revert accidental deletion

* fix: typo for branding consistency

* fix typo

* update the code as per recommendation in PR

* remove package-lock and add gitignore

* fix vulnerability AND update env for tests to pass

* Fix yarn integrity check across different docker services

* update code based on rubocop and PR suggestions

* remove redundant test docker-compose and dockerfile

* update rails entrypoint, update docs and Gemfile

* [Rubocop] order Gemfile alphabetically

* Reordering Gemfile
2019-12-22 22:53:18 +05:30
Anto DominicandPranav Raj S 6bdac3d9fe [Cleanup] Remove unnecessary Capistrano config (#375) 2019-12-22 18:00:23 +05:30
Pranav Raj SandSojan Jose 2ce7438c79 [Refactor] Cleanup agent store and actions (#373)
* Cleanup agent store and actions

* Move set/create/update/destroy to helpers

* Update mutation specs

* Add specs for API helper

* Fix edit/delete action visibility

* Add actions specs

* Remove unused API helpers

* Remove duplicates

* Remove duplicates

* Fix duplicate
2019-12-21 22:54:35 +05:30
dependabot[bot]andPranav Raj S a92e3817f8 Bump rack from 2.0.7 to 2.0.8 (#372)
Bumps [rack](https://github.com/rack/rack) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.0.7...2.0.8)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-20 12:16:53 +05:30
Pranav Raj SandSojan Jose 4b677ae00e [Bug] Fix timestamp in temporary message (#369)
* [Bug] Fix timestamp in temporary message

* Fix tests
2019-12-17 09:47:44 +05:30
James GeorgeandPranav Raj S 87fb1adab1 Refactor: Minor code refactoring in accordance with Vue.js best practices (#368) 2019-12-16 18:23:14 +05:30
Pranav Raj SandSojan Jose 17587d8a0c [Enhancement] Group widget messages by users (#367)
* Remove thumbnail

* Show grouped messages
2019-12-15 23:53:04 +05:30
James GeorgeandPranav Raj S 5c7c325c9c Refactor: use Array.includes instead of indexOf (#366) 2019-12-15 23:24:34 +05:30
Pranav Raj SandSojan Jose a7cb75e468 [Performance] Optimize queries in conversation/message finders (#364)
* [Performance] Optimize queries in conversation/message finders

* Add message_finder spec

* Fix message_finder spec
2019-12-15 16:59:12 +05:30
Pranav Raj SandSojan Jose cfc56705fd [Enhancement] Group widget messages by date (#363)
* [Enhancement] Group widget messages by date

* Update DateSeparator snapshot
2019-12-15 00:06:01 +05:30
Pranav Raj SandSojan Jose 7b63cbe1f7 [Enhancement] Select widget_color while creating inbox (#362)
* [Enhancement] Select widget_color while creating inbox

* Fix codeclimate issues

* Fix !important
2019-12-14 18:14:35 +05:30
Pranav Raj SandSojan Jose 19852b60cd [Bug] Fix icon alignment in buttons (#360)
* Fix icon alignment in buttons

* Fix ordering
2019-12-13 15:26:14 +05:30
Mukesh ChaudharyandSojan Jose 5b275ea157 Add option to reset password of agents to Admin (#351)
* Add option to reset password of agents to Admin

* Fix copy, remove setTimeout
2019-12-13 13:04:49 +05:30
Ender Ahmet YurtandSojan Jose cef1200351 Refactor for reauthorize_page method (#110)
* Refactor for reauthorize_page method

* Fix the rubocop issues
2019-12-13 02:42:16 +05:30
Pranav Raj SandSojan Jose febc4bef83 [Enhancement] Hide sidebar on tablets (#358)
* [Enhancement] Hide sidebar on tablets

* Remove unnecessary console.log

* Use beforeDestroy
2019-12-12 12:53:15 +05:30
Pranav Raj SandSojan Jose 2b41e91768 [Enhancement] Fetch previous messages in the conversation (#355)
* Fetch previous messages in the conversation

* Add specs for conversation store

* Fix codeclimate issues

* Exclude specs folder

* Exclude globally

* Fix path in exclude patterns

* Add endPoints spec

* Add snapshots for Spinner

* Add specs for actions
2019-12-11 20:57:06 +05:30
Pranav Raj SandSojan Jose 1005b9e227 Add Database config variables to .env.example (#357) 2019-12-10 22:24:08 +05:30
Sojan JoseandPranav Raj S 1abaee04d8 Feature: Profile API [#238] (#354)
- api to update name and email
- api to change password
- api to  set profile pic
- fixes update_attribute! deprecation warning
- introducing active storage
2019-12-10 10:29:35 +05:30
Pranav Raj SandGitHub 7f96c39b18 Add OpenCollective funding details (#353) 2019-12-09 10:30:29 +05:30
Sojan JoseandGitHub 0a5d6c0de9 Fix security advisory warning (#352) 2019-12-09 10:19:09 +05:30
Pranav Raj SandSojan Jose d8d4deea2f Remove unnecessary slash in curl command (#349)
* Remove unnecessary slash in curl command

* bundle update

* Fix rubocop errors
2019-12-06 16:50:06 +05:30
petebytesandSony Mathew 3f403c9e7a Improve docker compose performance (#347)   🤩
* Fix warning Integrity check: System parameters don't match

* Reduce commands required to use docker-compose and update quick-setup doc

Data will still persist when stopping and restarting containers.
To destroy the data can use docker-compose down --volumes

* Moved webpacker-dev-server to its own service

* cache bundle and yarn - improve volume performance - env conditional statements

* Fix inconsistent build results found during testing
2019-12-05 16:42:46 +05:30
Karthik SivadasandPranav Raj S 3a1c0aef07 Add specs for model facebook_page (#346) 2019-12-05 13:20:04 +05:30
Régis BehmoandSojan Jose ff5c26a388 Fix BILLING_ENABLED in example .env file (#345)
The ENABLE_BILLING env var is not used in the chatwoot code base. Instead, the BILLING_ENABLED is used to enable billing.
2019-12-04 22:38:53 +05:30
Sojan JoseandPranav Raj S 6a2f4e6673 Chore: Ability to configure Mailer sender emails [#339] (#342)
* Chore: Ability to configure Mailer sender emails [#339]

fixes : #339
fixes : #330

* update the documentation
2019-12-03 22:54:08 +05:30
Sojan JoseandPranav Raj S a8e8416d48 Chore: Cache gemfiles in circle builds [#338] (#343) 2019-12-03 19:26:38 +05:30
Karthik SivadasandSojan Jose c758c13ffb Add Account Model specs (#341) 2019-12-03 10:09:45 +05:30
Sojan JoseandPranav Raj S 6ca403542d Chore: Setup test coverage in codeclimate [#332] (#333) 2019-12-02 08:57:11 +05:30
Pranav Raj SandSojan Jose 829cb4da57 Add docs to add a website channel (#337) 2019-12-01 22:53:39 +05:30
Karthik SivadasandSojan Jose 330e8625d3 Update user model specs (#334) 2019-12-01 15:42:15 +05:30
Subin T PandSojan Jose 84799fd0a1 [#247] Filters conversation by status and paginate conversations (#284)
* [#247] Filters conversation by status

* Fixes conversation finder specs

* [#248] Paginates conversation

* Use method name in description

* Move page to default param, add filters on frontend

* Fix code climate issues
2019-12-01 10:16:51 +05:30
Mukesh ChaudharyandSojan Jose c08074b981 Annotations (#327)
* Add annotate gem to the project
* Annotate models, fixtures, factories and model_specs
* Keep annotations only in Models
* Remove unwanted changes in model specs
* Exclude auto_annotate_models from rubocop
2019-11-30 19:09:55 +05:30
Pranav Raj SandSojan Jose 60e96f446e [Enhancement] Add CopyToClipboard action in code component (#329)
* Add CopyToClipboard action in websiteWidgetCode component

* Fix codeclimate issues
2019-11-30 17:33:42 +05:30
Pranav Raj SandSojan Jose a3662091c7 Add an intermediate pending state for widget messages (#323)
* Add an intermediate pending state for widget messages

* Remove unnecessary setTimeout

* Rename method
2019-11-29 17:42:35 +05:30
Pranav Raj SandSojan Jose 070f762293 Updated docs for docker configuration (#322) 2019-11-29 00:57:49 +05:30
Pranav Raj SandSojan Jose 8ea74a21b0 Fix docker file to use rails_env=production on precompile (#315)
* Fix docker file to use rails_env=production on precompile

* Fix docker file for prod deployment
2019-11-28 23:34:21 +05:30
Sojan JoseandGitHub dab21915b4 Fix rails port getting toggled from 3000 to 5000 (#319)
Fix rails port getting toggled from 3000 to 5000 when using foreman
2019-11-28 13:36:29 +05:30
Pranav Raj SandNithin David Thomas 6e911e69f8 Update font family to make design consistent in all platforms (#318)
* Add inter font, remove modal header bg

* Remove unnecessary font files

* Fix codeclimate issues, remove letter-spacing attribute
2019-11-28 11:03:01 +05:30
Sony MathewandPranav Raj S 6c653e9ef3 [#311] Added link to env variables documentation (#312)
* Added link to env variables documentation right below the Heroku one click deploy button so that people dont get confused with broken app on deploying without the env variables set correctly
2019-11-27 14:06:39 +05:30
Pranav Raj SandSojan Jose 3c01f98a0b Fix breaking migrations, revert migrations to 6.0 (#314)
Closes #313
2019-11-27 12:42:00 +05:30
Nithin David ThomasandPranav Raj S 7c65142fcd Adjust space between message bubbles in widget (#309) 2019-11-27 11:45:33 +05:30
Pranav Raj SandSojan Jose ded8f33fc8 Fix private note shown to user in widget (#308)
fixes #306
2019-11-27 10:12:57 +05:30
Sojan JoseandSony Mathew 913172c688 Enhancement request template (#301)
enhancement request template
2019-11-27 09:18:51 +05:30
Sojan JoseandSony Mathew c36b4279ac [Bugfix]Fixes agent cannot be removed from inbox #18 (#304)
Closes #18
2019-11-27 09:12:17 +05:30
Sojan JoseandSony Mathew 17eed16dfe Add a pull request template (#305) 2019-11-27 09:07:17 +05:30
Sojan JoseandSony Mathew cbf2d27b6b [BugFix] Fix Users not deletable because of foreign key reference (#300)
Fixes #297
2019-11-27 09:01:39 +05:30
Nithin David ThomasandSony Mathew 274ad381cb Makes widget header expand and collapse by messages size (#293) 2019-11-26 22:35:26 +05:30
Sojan JoseandPranav Raj S 97a814cb7e [Chore] Add docker build status to repo #287
ref: #287
2019-11-26 14:56:09 +05:30
Sojan JoseandPranav Raj S ddae36a4a3 [Chore] - Fix docker build (#290)
fixes #289
2019-11-26 13:37:28 +05:30
kolaenteandSojan Jose cb71f5752c Fix docker image by adding bundler (#288)
fixes #289
2019-11-26 12:13:22 +05:30
Sojan JoseandPranav Raj S 0ba001427e Display deploy to heroku button more prominently in Readme (#285) 2019-11-26 11:17:34 +05:30
Pranav Raj SandSojan Jose 5d2efdc7fc Update widget colors based on the widgetConfig (#276) 2019-11-26 00:10:27 +05:30
Sojan JoseandGitHub 9c6a101768 [Chore] Add bullet gem #249 (#281)
* closes #249 add bullet gem

- upgrade gems
- fix the warning in the console
- fix the deprecation message for where not
2019-11-25 23:55:18 +05:30
Pranav Raj SandSojan Jose 34df451243 Add rubocop on commit hook (#283) 2019-11-25 11:18:16 +05:30
Nicholas La RouxandPranav Raj S fabf59cdd1 Add Dependabot config (#217) 2019-11-25 09:48:11 +05:30
Subin T PandSojan Jose efea049e89 Removes unwanted data migration (#280) 2019-11-25 01:03:50 +05:30
Sojan JoseandSony Mathew 78adcf822d #251 - Disable subscription in community edition (#277)
* #251 - Disable subscription in community edition

* Hide billing routes in sidebar for community edition

* Remove subscription serializer if billing disabled
2019-11-24 19:09:17 +05:30
Pranav Raj SandGitHub 54556bfd58 [Docs] Add documentation for SMTP settings (#279) 2019-11-24 18:54:56 +05:30
Sony MathewandGitHub 70e4cc08b6 [#260] One click deploy to heroku (#275)
* [#260] One click deploy to heroku

* Added app.json file for Heroku deployment
* Made changes in Procfile to accept the PORT as env variable
* Added the one click button in README.md

* Change readme and link

* Alignment of button in Readme

* Changing redis to free plan

* Removed node-js build-pack

* Changed the post-deploy script to be rake db:migrate

* Removed web concurrency variable from app.json for heroku

* Changed the link to chatwoot logo referenced in app.json

* Changed postdeploy hook

* Changed logo to be raw content from github

* Changed the SMTP variables

* Added optional conditional for sending mail
* Changed the naming of SMTP variables

* Having logo as base 64 encoded image for heroku deploy page

* Fixed key not found error for SMTP variables

* Correcting the specs for conversation assignment mailer

* Spec rubocop fixes

* Spec rubocop fixes
* Added the link to master for heroku app.json
2019-11-24 17:19:14 +05:30
Alexander KadyrovandSojan Jose b6186e93e7 Remove unused method from ApplicationRecord (#257) 2019-11-24 02:51:33 +05:30
Pranav Raj SandSony Mathew 6f4f66264f Update links in contributing.md (#272) 2019-11-24 02:01:13 +05:30
Pranav Raj SandSony Mathew 645c77c3c1 Fix links in documentation (#271) 2019-11-24 01:42:58 +05:30
Sony MathewandPranav Raj S da9ac8b26d 🔥Docker and environment variables cleanup (#270)
* Added dotenv-rails gem to manage environment variables

* Added dotenv-rails gem to manage environment variables
* Removed figaro which was used earlier for this purpose

* Standardized variable names

* Changed all env variables to be upper case. This included changes in files referencing env variables.
* Added example env file with all variables set to empty value
* Removed the earlier setup of copying application.yml and database.yml and the scripts and documentation associated to this

* Docker setup

* Added docker file for building the docker images
* Added entrypoint.sh script which is referenced inside the Docker image
* Cloned the Procfile for development using docker which has slight change compared to regular procfile
* Added the docker-compose.yml which has 3 service's configuration, postgres, redis and chatwoot server and a mounted volume for postgres

* Added docker related info to documentation

* Added the docker setup info in the documentation
* Added info for using`rbenv` instead of rvm for managing ruby versions
* Updated the documentation for environment variables to have one about `dotenv-rails` gem and removed the documentation about the old copy paste method used by figaro

* Changing the postgres database, username and password as environment variables

* Removed database.yml from gitignore
* Made the postgres databse, username and password as environemnt variables
* Added this in documentation

* Added a quick setup page

* Added quick setup page
* Removed the docs from README and added link to the docs in website
* Removed the figaro related things from circle.ci config

* Adding external volume for redis in docker compose

* Added instructions for adding the redis volume in docs
2019-11-24 01:27:39 +05:30
Pranav Raj SandSony Mathew c6feea9f6d [Enhancement] Format messages in widget (#268)
* Use message formatter in widget

* Rename the variable
2019-11-24 00:29:55 +05:30
Pranav Raj SandSojan Jose c96e2c334c Add background story (#269) 2019-11-23 23:44:44 +05:30
Alexander KadyrovandSojan Jose cb834ff73d Add bundle audit to CI (#263)
* Add bundle-audit gem

* Update vulnerable brakeman gem

* Fix "Insecure Source URI found" issue for Rails
2019-11-22 12:53:57 +05:30
Alexander KadyrovandSojan Jose efce3b3698 Add executable bit to ./configure script (#255) 2019-11-22 12:05:17 +05:30
Muhsin.KandPranav Raj S a4141c5dc5 Remove docs script (#233) 2019-11-21 14:42:40 +05:30
Pranav Raj SandGitHub e610a11bc5 [Enhancement] Add a temporary image for channel if no image available (#231) 2019-11-21 12:08:54 +05:30
Pranav Raj SandGitHub c914d94b18 Format time, fix sort (#230) 2019-11-21 12:02:10 +05:30
Pranav Raj SandGitHub ba10045a0f Remove therubyracer gem (#228) 2019-11-21 10:31:25 +05:30
Pranav Raj SandGitHub 8348f4adae Fix scrollTop of undefined in CannedResponseList (#226) 2019-11-20 15:40:34 +05:30
Pranav Raj SandGitHub aef3b04aa5 [Bug] Remove markSeen, toggleTyping calls for WebWidget channels (#225) 2019-11-20 00:04:32 +05:30
Pranav Raj SandGitHub bcce70c95a [Bug] Fix widget mobile layout design (#224) 2019-11-20 00:01:16 +05:30
Ronald WalkerandPranav Raj S 0d5c070f51 [Bug] Fix ReadableTime overlapping message text in Firefox(#219) 2019-11-19 12:55:12 +05:30
Jithin DasandPranav Raj S 565a8439c0 Fix broken links in docs (#221) 2019-11-18 22:05:10 +05:30
Jithin DasandPranav Raj S 8e0570ff87 Update contributors link (#220)
* update Readme.md

Fix the anchor tag of contributors

* update contributors.md

Fix the anchor tag redirecting to 404 page
2019-11-18 14:16:35 +05:30
Nicholas La RouxandSojan Jose 0aee33453c Upgrade to Ruby 2.6.5 (#216) 2019-11-18 09:07:48 +05:30
Ronald WalkerandSojan Jose 9256745193 remove 'inbox' attribute on Contact and use join table(ContactInbox) instead (#214) 2019-11-18 08:57:41 +05:30
Sojan JoseandGitHub 7ed1858284 Less configuration when setting up the repo (#215)
add the default redis url and frontend url to avoid extra hassles when setting up the repo
2019-11-18 08:49:00 +05:30
Juraj MasarandNithin David Thomas bc0f29344e Fix typo in readme (#212)
- ImageMagik => ImageMagick
2019-11-18 06:32:06 +05:30
Pranav Raj SandGitHub 2ebc07b381 [Bug] Remove toggle_typing API call for channels except Facebook (#211) 2019-11-17 14:15:05 +05:30
Pranav Raj SandGitHub 127dd4cf61 [Bug] Fix selected label alignment in MultiSelect (#210) 2019-11-17 13:32:30 +05:30
Pranav Raj SandGitHub 1ad36f164f [Enhancement] Create EmptyState component (#209) 2019-11-17 13:09:10 +05:30
Pranav Raj SandGitHub 88ac20efb5 [Feature] Detect browser on conversation initiation (#208) 2019-11-16 14:48:38 +05:30
dependabot[bot]andPranav Raj S ccd3d8dc6e Bump rack-cors from 1.0.3 to 1.0.6 (#207)
Bumps [rack-cors](https://github.com/cyu/rack-cors) from 1.0.3 to 1.0.6.
- [Release notes](https://github.com/cyu/rack-cors/releases)
- [Changelog](https://github.com/cyu/rack-cors/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cyu/rack-cors/compare/v1.0.3...v1.0.6)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-16 11:53:01 +05:30
Pranav Raj SandGitHub 88fc4d894a Init Contact Panel (#206) 2019-11-14 13:46:43 +05:30
Pranav Raj Sreepuram b985085786 Fix styles in conversation view 2019-11-12 10:09:58 +05:30
Pranav Raj SandGitHub 6d8b6d4769 [Bug] Scroll conversation to bottom on load (#205) 2019-11-12 09:46:30 +05:30
Pranav Raj Sreepuram e37c04a81f Remove console warning from foundation 2019-11-12 08:55:35 +05:30
Pranav Raj SandGitHub 7b4b5d31d9 [Bug] Update copy in search agent select dropdown (#204) 2019-11-10 22:58:55 +05:30
dependabot[bot]andPranav Raj S 047e485998 Bump loofah from 2.3.0 to 2.3.1 (#203)
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.3.0...v2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 22:17:42 +05:30
Pranav Raj SandGitHub 7e3409c3e1 [Enhancement] Enter to send message, add click on bubble instead of icon (#202) 2019-11-09 17:12:31 +05:30
Pranav Raj SandGitHub 63ce5607e9 [Bug] Rescue error on JWT.encode (#201) 2019-11-09 16:04:02 +05:30
Pranav Raj Sreepuram de76780ce5 [Enhancement] Use thumbnail component 2019-11-05 10:15:56 +05:30
Pranav Raj Sreepuram 7a2fb8eef1 [Bug] Fix unable to set unsafe-headers 2019-11-04 12:54:41 +05:30
Pranav Raj SandGitHub c080f6c429 Update docs to use open collective (#200) 2019-11-04 12:49:01 +05:30
Pranav Raj Sreepuram dbb57a8a56 Upgrade foundation to 6.5.3 2019-11-01 13:44:03 +05:30
Pranav Raj SandSojan Jose 5cc3543657 [Internal] Add route for widget testing (#199) 2019-11-01 12:53:01 +05:30
Pranav Raj Sreepuram f3fc542a5f [Bug] Fix conversation scroll in dashboard 2019-10-30 12:08:10 +05:30
LaurenandSojan Jose bfa4121f41 Feature/add inbox specs (#192)
* Add base Inbox association and validation specs

* `#facebook?``

* `#add_member` and `#remove_member`

* cleanup

* Rubocop

* Rubocop but again

really this time
2019-10-30 10:49:23 +05:30
Pranav Raj SandSojan Jose 3d3aefb197 [Enhancement] Use JS-Cookie to set Cookies (#193)
* Update js-cookie

* Add sdk css

* Remove conversation padding
2019-10-30 10:43:11 +05:30
José Miguel OchoaandSojan Jose e32b6bf6d4 [Enhancement] Add default avatar when profile image is not available (#188)
* Add default avatar when agent image is not available

* Remove fonts from avatar
Separate non-computed style values
2019-10-29 23:36:21 +05:30
16fe912fbd [Feature] Website live chat (#187)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2019-10-29 12:50:54 +05:30
Sojan JoseandGitHub a4114288f3 Update issue templates 2019-10-29 09:06:00 +05:30
Moisés ÑañezandSojan Jose 40c72404d6 Ignore coverage reports (#190) 2019-10-28 23:17:14 +05:30
Moisés ÑañezandPranav Raj S 5a41f321c8 [Enhancement] Move chart options to a variable (#189) 2019-10-28 21:00:02 +05:30
Pranav Raj SandGitHub 17bb50c977 Configure SCSS linter rules (#186) 2019-10-27 19:28:02 +05:30
Pranav Raj Sreepuram 170f8716c5 Refactor Conversation, Message API calls, store 2019-10-27 19:01:59 +05:30
Sojan JoseandGitHub c21c839dca Contact model changes (#184)
* move source id from contacts

* Fix contactInbox model name

* rubocop fix

* Fix rspec
2019-10-27 13:14:36 +05:30
Sojan Jose 3b6d58bbdf Refactor Reports Controller 2019-10-27 11:11:51 +05:30
Pranav Raj SandGitHub 6c60b60240 [Enhancement] Add ApiClient, refactor CannedResponse (#183) 2019-10-27 10:48:26 +05:30
Pranav Raj SandGitHub 50fc06681c [Enhancement] Update vue-chartjs to fix production build (#182) 2019-10-27 10:24:19 +05:30
Pranav Raj SandGitHub f869598cb4 [Enhancement] Remove frontend env file 🔥(#179) 2019-10-25 12:01:05 +05:30
Pranav Raj SandSojan Jose f4358d9993 Replace pusher with action cable (#178)
closes #43
2019-10-25 01:37:01 +05:30
Nursoltan SaipoldaandSojan Jose c0354364ff removed app/stylesheets & set stylesheet generator to false (#177) 2019-10-24 17:08:38 +05:30
Anusha BhatandSojan Jose 0a6156fe38 Add rubocop tools and regenerate rubocop todo file (#175) 2019-10-23 23:56:48 +05:30
Nursoltan SaipoldaandPranav Raj S af94bf9239 [docs] Add installation guide for windows os (#174) 2019-10-23 16:13:34 +05:30
Nursoltan SaipoldaandSojan Jose 73d433b591 deleted coffee files & coffee-rails gem. disable js generation on application.rb (#173) 2019-10-23 15:59:45 +05:30
Pranav Raj SandGitHub e0d291c49e Create util for apiLoadingStatus (#170)
* Create util for apiLoadingStatus

* Revert "Fix #52 rubocop metrics abc size in passwords controller (#119)"

This reverts commit 9c22da0ac6.
2019-10-22 13:28:45 +05:30
Pranav Raj Sreepuram cd43b09574 Fix codeclimate issues in babel.config.js 2019-10-22 12:32:54 +05:30
AlexisChavez97andPranav Raj S 9c22da0ac6 Fix #52 rubocop metrics abc size in passwords controller (#119)
* Fix #52 rubocop metrics abc size in passwords controller

* Fix DeviseTokenAuth headers names
2019-10-22 12:32:06 +05:30
rojaceandPranav Raj S 10d3ab295c Use centralized bash file to copy configurations. (#169)
* Use centralized bash file to copy configurations.

* Typo.

* EOF.
2019-10-22 11:07:29 +05:30
AleksandrandSojan Jose a7787e0f23 issue #151: add rubocop to ci (#168) 2019-10-21 11:18:47 +05:30
Sojan JoseandGitHub ba8f055802 Change sender_id to contact_id in conversations (#167)
* change sender_id to contact_id in conversations

* Fix failing tests

* Fix seeds

* fix specs

* Fix issues in facebook messenger
2019-10-21 00:40:18 +05:30
Sojan JoseandGitHub 2099dc01a6 Routine weeding of the codebase (#163)
* Routine weeding of the codebase
* fix the spec
2019-10-20 16:19:12 +05:30
Pranav Raj SandGitHub 94c6d6db6f 🚨Fix Rubocop lint errors 2019-10-20 14:17:26 +05:30
Pranav Raj SandGitHub dd018f3682 Upgrade bourbon to ^6.0.0 (#161) 2019-10-20 13:34:19 +05:30
Pranav Raj SandGitHub 20cfd005b9 [Enhancement] Remove Ionicons CDN usage, upgrade packages (#160) 2019-10-20 09:29:05 +05:30
Sojan JoseandGitHub a7da2428b0 upgrade facebook messenger gem (#159)
- carrierwave local config
- upgrade facebook messenger gem to support facebook graph api 4.0
2019-10-20 01:41:24 +05:30
Nikhil PathakandPranav Raj S 7d4cac38a8 Freeze Constant (#156) 2019-10-19 10:59:56 +05:30
Pranav Raj SandGitHub af20e61604 [Feature] Add PWA support (#157)
* Add icons, manifest

* Add workbox config
2019-10-18 12:37:09 +05:30
Sojan Jose 701722983b Refactoring Gem Groups 2019-10-17 03:48:48 +05:30
Sojan JoseandGitHub 3988777718 Refactoring the code for pub sub (#155)
- We were using the attribute name 'channel' to store pubsub tokens, which was confusing.
- switched to faker from ffaker
- spec for contact.rb
2019-10-17 03:18:07 +05:30
Sojan Jose ad5fb525f5 Remove more stale gems 2019-10-17 01:02:42 +05:30
Sojan Jose addb370915 Remove Stale Gems 2019-10-17 00:51:50 +05:30
Akshay BirajdarandNithin David Thomas 7b5c9dae63 Fixes #115 Use middle instead of centre in flex-align (#153)
Co-authored-by: Nithin <webofnithin@gmail.com>
2019-10-16 22:45:36 +05:30
Pranav Raj SandGitHub 2783fb6006 Move src to dashboard (#152) 2019-10-16 14:36:17 +05:30
Pranav Raj Sreepuram 012a2743f2 Remove corejs option in preset-env
Fixes #148
2019-10-16 12:29:57 +05:30
Akshay BirajdarandSojan Jose a1452d7d89 Sprinkle frozen string literal & Indentation Fix (#150)
* Avoid extra string alocation as join will always return string

* Fix indentation

* Sprinkle frozen string literal true
2019-10-16 12:22:30 +05:30
Akshay BirajdarandPranav Raj S 59e9fbd336 Introduce .editorconfig (#149)
.editorconfig will allow maintaining consistent coding style across
various text editors and IDEs
2019-10-16 12:01:05 +05:30
Akshay BirajdarandPranav Raj S 4bb6842a4d Prefer Enumerable#detect over Enumerable#select.first (#147) 2019-10-15 11:46:18 +05:30
Davyd McCollandSojan Jose 01b72ca051 Initial testing with jest (#133)
* 🎉 initial testing with jest

* 👌 update test script names & remove package-lock.json

* 👌 add 'yarn test' step to circle-ci build workflow
2019-10-15 00:18:46 +05:30
AndreiandNithin David Thomas cdada37e3a Fix #114: Address color contrast warning messages (#144)
* Make button text black

* Remove custom white text for warning buttons
2019-10-15 00:15:33 +05:30
LaurenandSojan Jose b89353b76c Feature/update confirmation email information (#145)
* Add `invited_by` foreign key to User

Allows for a User to be tied to the user who invited them

* Include `current_user` in new agent initialization parameters

* Add `shoulda-matchers` for testing associations

* Add Inviter information and associated account to welcome email

* Only show inviter info if applicable

* Update conversation spec for FFaker compatibility
2019-10-14 14:24:58 +05:30
Pranav Raj SandGitHub 4b33a480c7 Fix missing username in assignment message (#142) 2019-10-13 19:16:28 +05:30
Pranav Raj SandGitHub 14c5a304b3 [docs] Update contributors list (#136) 2019-10-13 09:58:32 +05:30
Emil ShakirovandSojan Jose 4768aca484 Refactor Conversation model (#134)
* Add Conversation factory with dependent factories

* Include FactoryBot methods in rspec config

* Add unit tests for public methods of Conversation model

* Move Current model into a separate file in lib folder

* Disable Metrics/BlockLength rule for db/migrate and spec folders

* Get rid of global $dispatcher variable

* Create Message#unread_since scope

* Refactor callback methods in Conversation model

* Create Conversations::EventDataPresenter

* Add translation keys for activity messages

* Add pry-rails gem

* Refactor Conversation#notify_status_change

* Add mock_redis for test env
2019-10-12 23:38:41 +05:30
Ender Ahmet YurtandPranav Raj S 43e54a7bfb Add mac os installation guide (#135) 2019-10-12 10:47:08 +05:30
NimaandNithin David Thomas df0c1fa0c5 Refactor parseErrorCode and try to decrease method complexity (#132) 2019-10-10 09:11:18 +05:30
Pranav Raj Sreepuram 1625929193 [docs] Update documentation URL 2019-10-09 17:58:14 +05:30
Pranav Raj Sreepuram 046cc20f71 Update documentation to include page title and slug 2019-10-09 17:55:41 +05:30
Allan KlausandSojan Jose 0621fa66e4 Fix abs rubocop metric of create_activity (#101)
* Fix abs rubocop metric of create_activity

* Fix anothers rubocop issues

* Remove comment that was removed on master
2019-10-09 01:15:04 +05:30
AncaandSojan Jose e066a9cff5 Fix #58 - Refactor inbox_members_controller (#109) 2019-10-08 14:03:41 +05:30
Kirill ArutyunovandNithin David Thomas eef7555d62 Fix #77 issue codeclimate in _tabs.scss (#125)
* Fix #77 issue codeclimate in app/javascript/src/assets/scss/widgets/_tabs.scss

* Update border-width for #77 in _tabs.scss
2019-10-08 01:31:09 +05:30
Nishant SamelandNithin David Thomas 59db1de1dc Fix Code Climate issues with Conversation View (#103) 2019-10-08 01:06:01 +05:30
Nithin David ThomasandGitHub 0daeeb1361 Merge pull request #122 from kirillarutyunov/codeclimate-76-issue-sidemenu-scss
Codeclimate #76 issue _sidemenu.scss
@kirillarutyunov Thanks for the PR's. We are sending stickers to our lovely contributors.
Please drop your details here for us to get in touch with you. We will start shipping it by the end of October.
2019-10-07 20:41:47 +05:30
Nithin David ThomasandGitHub 3a01a40c26 Merge branch 'master' into codeclimate-76-issue-sidemenu-scss 2019-10-07 20:34:17 +05:30
Nithin David ThomasandGitHub d9b97bc92e Merge pull request #123 from kirillarutyunov/codeclimate-70-issue-emojiinput-scss
Fix #70 issue codeclimate in _emojiinput.scss

@kirillarutyunov Thanks 🎉
2019-10-07 20:28:14 +05:30
Nithin David ThomasandGitHub 99322842a7 Merge branch 'master' into codeclimate-70-issue-emojiinput-scss 2019-10-07 20:22:47 +05:30
Sojan Jose 728c23aefd Bump up versions 2019-10-07 00:46:13 +05:30
Pranav Raj Sreepuram 6e19659e88 Add missing screenshot 2019-10-06 21:18:01 +05:30
Kirill ArutyunovandPranav Raj S ea13a21da5 Fix #78 issue codeclimate in app/javascript/src/assets/scss/widgets/_thumbnail.scss (#121) 2019-10-06 20:03:01 +05:30
Kirill ArutyunovandPranav Raj S c0f40b1713 Fix #65 issue codeclimate in app/javascript/src/assets/scss/widgets/_billing.scss (#124) 2019-10-06 19:46:05 +05:30
Kirill ArutyunovandPranav Raj S 9759c7432f Add .idea folder to the gitignore for ignoring Jetbrains IDE (webstorm) config files (#126) 2019-10-06 19:40:02 +05:30
Kirill Arutyunov 942f47fa2d Fix #70 issue codeclimate in app/javascript/src/assets/scss/widgets/_emojiinput.scss 2019-10-06 16:08:17 +03:00
Kirill Arutyunov 426ac33acf Fix #76 issue codeclimate in app/javascript/src/assets/scss/widgets/_sidemenu.scss 2019-10-06 16:02:59 +03:00
Marc CandSojan Jose 9b9aee4657 Update contact_params function (#100)
removed if block,
cannot be shortened further due to exception handling and params formatting
2019-10-06 10:29:54 +03:00
Pranav Raj SandGitHub 84e0eb2441 Update README.md 2019-10-06 09:23:51 +05:30
Pranav Raj SandGitHub 902b8e855e [docs] Move contributors section to docs (#120) 2019-10-06 09:23:24 +05:30
Ender Ahmet YurtandPranav Raj S bbbc14448b Refactor for attachment_params method (#108) 2019-10-05 17:15:32 +08:00
Ender Ahmet YurtandPranav Raj S ca63bba63f Refactor for notify_status_change (#106) 2019-10-05 17:12:50 +08:00
Davyd McCollandPranav Raj S b41a8c8477 ♻️ reduce complexity of validateAuthenticateRoutePermission function (#95) 2019-10-05 17:07:05 +08:00
Ricardo Ferro MorenoandPranav Raj S e91868f823 Fix multiple SelectorFormat issues in views/_signup.scss (#88) 2019-10-05 16:34:24 +08:00
Ian VaughanandSojan Jose ccfa135264 Reduce line code to please Rubocop (#111)
Fixes #58
2019-10-04 01:57:34 +03:00
Sojan JoseandGitHub e2448c5ece Merge pull request #93 from arku/refactor/attachment-push-event-data
Refactor Attachment#push_event_data
2019-10-03 11:25:57 +03:00
Arun Kumar Mohan 9d291638c4 Refactor Attachment#push_event_data 2019-10-02 18:19:27 -05:00
Arun Kumar MohanandPranav Raj S 1b52316c16 Update location where attachment uploads are stored in test environment (#91) 2019-10-02 21:56:09 +08:00
Jaques DiasandPranav Raj S 9afbc8c55f Fix code climate issues on Plan model (#98) 2019-10-02 21:46:32 +08:00
Jaques DiasandPranav Raj S d1f06992b2 Refactor create_activity method on Conversation model (#105) 2019-10-02 21:03:07 +08:00
Sai Sandeep MutyalaandPranav Raj S f2544816d4 Fixed ZeroUnit issue (#99) 2019-10-02 18:17:36 +08:00
Pranav Raj Sreepuram 94debaf68b [docs] Add contributing guide 2019-10-02 18:07:10 +08:00
Santosh DesaniandPranav Raj S 2ec3dd6e63 [Rubocop] Fixing issues in bin/webpack-dev-server (#89) 2019-10-02 14:13:41 +08:00
Pranav Raj Sreepuram 83c7e0b2f1 Add docs.chatwoot.com link in Readme 2019-10-02 11:41:16 +08:00
Pranav Raj SandGitHub e8ffbd5a92 [docs] Add common errors section (#87) 2019-10-02 11:39:41 +08:00
Pranav Raj SandGitHub b7ba0d95a8 Fix codeclimate lint errors in _login.scss (#83) 2019-10-02 11:13:57 +08:00
Pranav Raj SandGitHub 9951feabc1 [scss-lint] Fix "Shorthand" issue, Remove redundant variables, use shorthand (#82) 2019-10-02 11:07:10 +08:00
Pranav Raj SandGitHub 7e76285f7c [scss-lint] Fix "HexLength" issue (#81) 2019-10-02 11:03:56 +08:00
Pranav Raj Sreepuram a9b0eb3c15 Update docs website 2019-09-22 15:37:44 +05:30
Pranav Raj S 814cda499c Create CNAME 2019-09-22 11:55:05 +05:30
Pranav Raj Sreepuram d478f069a1 Add docsify for documentation website 2019-09-22 11:53:50 +05:30
Pranav Raj Sreepuram b150d78e4d Add development docs 2019-09-22 11:29:26 +05:30
Pranav Raj Sreepuram 2b60c58b5a Fix pixelated logo in readme 2019-09-05 13:25:41 +05:30
Pranav Raj Sreepuram a3128cee35 Remove unused http error codes 2019-09-05 13:18:27 +05:30
Pranav Raj Sreepuram 3549fc5fdd Split conversation module into getters and actions 2019-09-05 13:01:36 +05:30
Pranav Raj Sreepuram f9d4c2af90 [codeclimate] Reduce number of lines in bindEvent 2019-09-05 12:30:36 +05:30
Pranav Raj SandGitHub a108ae7789 Cleanup routes (#26) 2019-09-05 12:24:26 +05:30
allcontributors[bot]andPranav Raj S 129febf29e docs: add sojan-official as a contributor (#28)
* docs: update README.md

* docs: create .all-contributorsrc
2019-09-05 12:24:01 +05:30
allcontributors[bot]andPranav Raj S a14472c378 docs: add manojmj92 as a contributor (#29)
* docs: update README.md

* docs: create .all-contributorsrc
2019-09-05 12:22:00 +05:30
allcontributors[bot]andPranav Raj S a46385ee25 docs: add subintp as a contributor (#30)
* docs: update README.md

* docs: create .all-contributorsrc
2019-09-05 12:20:45 +05:30
allcontributors[bot]andPranav Raj S 01b4ea450b docs: add nithindavid as a contributor (#31)
* docs: update README.md

* docs: create .all-contributorsrc
2019-09-05 12:19:27 +05:30
allcontributors[bot]andPranav Raj S 7518ea4af6 docs: add pranavrajs as a contributor (#27)
* docs: update README.md

* docs: create .all-contributorsrc
2019-09-05 12:16:56 +05:30
1962 changed files with 84553 additions and 13662 deletions
+79
View File
@@ -0,0 +1,79 @@
{
"files": [
"docs/contributors.md"
],
"imageSize": 48,
"commit": false,
"contributors": [
{
"login": "nithindavid",
"name": "Nithin David Thomas",
"avatar_url": "https://avatars2.githubusercontent.com/u/1277421?v=4",
"profile": "http://nithindavid.me",
"contributions": [
"bug",
"blog",
"code",
"doc",
"design",
"maintenance",
"review"
]
}
{
"login": "sojan-official",
"name": "Sojan Jose",
"avatar_url": "https://avatars1.githubusercontent.com/u/73185?v=4",
"profile": "http://sojan.me",
"contributions": [
"bug",
"blog",
"code",
"doc",
"design",
"maintenance",
"review"
]
},
{
"login": "pranavrajs",
"name": "Pranav Raj S",
"avatar_url": "https://avatars3.githubusercontent.com/u/2246121?v=4",
"profile": "https://github.com/pranavrajs",
"contributions": [
"bug",
"blog",
"code",
"doc",
"design",
"maintenance",
"review"
]
},
{
"login": "subintp",
"name": "Subin T P",
"avatar_url": "https://avatars1.githubusercontent.com/u/1742357?v=4",
"profile": "http://www.linkedin.com/in/subintp",
"contributions": [
"bug",
"code"
]
},
{
"login": "manojmj92",
"name": "Manoj M J",
"avatar_url": "https://avatars1.githubusercontent.com/u/4034241?v=4",
"profile": "https://github.com/manojmj92",
"contributions": [
"bug",
"code",
]
}
],
"contributorsPerLine": 7,
"projectName": "chatwoot",
"projectOwner": "chatwoot",
"repoType": "github",
"repoHost": "https://github.com"
}
+83 -40
View File
@@ -3,41 +3,52 @@
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
defaults: &defaults
working_directory: ~/build
docker:
# specify the version you desire here
- image: circleci/ruby:2.7.1-node-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/postgres:alpine
- image: circleci/redis:alpine
environment:
- CC_TEST_REPORTER_ID: b1b5c4447bf93f6f0b06a64756e35afd0810ea83649f03971cbf303b4449456f
- RAILS_LOG_TO_STDOUT: false
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.6.3-node-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/postgres:9.4
working_directory: ~/build
<<: *defaults
steps:
- checkout
- run:
name: Configure Bundler
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
- run:
name: Which bundler?
command: bundle -v
# Restore bundle cache
# Run bundler
# Load installed gems from cache if possible, bundle install then save cache
# Multiple caches are used to increase the chance of a cache hit
- restore_cache:
keys:
- chatwoot-bundle-v2-{{ checksum "Gemfile.lock" }}
- chatwoot-bundle-v2-
- chatwoot-bundle-{{ checksum "Gemfile.lock" }}
- chatwoot-bundle
- run:
name: Bundle Install
command: bundle check || bundle install
# Store bundle cache
- run: bundle install --frozen --path ~/.bundle
- save_cache:
key: chatwoot-bundle-v2-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- ~/.bundle
key: chatwoot-bundle-{{ checksum "Gemfile.lock" }}
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
@@ -49,40 +60,72 @@ jobs:
name: yarn
command: yarn install --cache-folder ~/.cache/yarn
- run:
name: eslint
command: yarn run eslint
# - run:
# name: brakeman
# command: brakeman
- run:
name: Copy files
command: |
cp shared/config/database.yml config/database.yml
cp shared/config/application.yml config/application.yml
# Store yarn / webpacker cache
- save_cache:
key: chatwoot-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Download cc-test-reporter
command: |
mkdir -p ~/tmp
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ~/tmp/cc-test-reporter
chmod +x ~/tmp/cc-test-reporter
- persist_to_workspace:
root: ~/tmp
paths:
- cc-test-reporter
# Database setup
- run: yarn install --check-files
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load
- run:
name: Bundle audit
command: bundle exec bundle audit update && bundle exec bundle audit check -v
- run:
name: Rubocop
command: bundle exec rubocop
- run:
name: eslint
command: yarn run eslint
# Run rails tests
- type: shell
command: |
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- run:
name: Run backend tests
command: |
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) --profile=10
~/tmp/cc-test-reporter format-coverage -t simplecov -o ~/tmp/codeclimate.backend.json coverage/backend/.resultset.json
- persist_to_workspace:
root: ~/tmp
paths:
- codeclimate.backend.json
- run:
name: Run frontend tests
command: |
yarn test:coverage
~/tmp/cc-test-reporter format-coverage -t lcov -o ~/tmp/codeclimate.frontend.json buildreports/lcov.info
- persist_to_workspace:
root: ~/tmp
paths:
- codeclimate.frontend.json
# collect reports
- store_test_results:
path: /tmp/test-results
path: ~/tmp/test-results
- store_artifacts:
path: /tmp/test-results
path: ~/tmp/test-results
destination: test-results
- store_artifacts:
path: log
- run:
name: Upload coverage results to Code Climate
command: |
~/tmp/cc-test-reporter sum-coverage ~/tmp/codeclimate.*.json -p 2 -o ~/tmp/codeclimate.total.json
~/tmp/cc-test-reporter upload-coverage -i ~/tmp/codeclimate.total.json
+21 -2
View File
@@ -1,7 +1,7 @@
version: "2"
plugins:
rubocop:
enabled: true
enabled: false
channel: rubocop-0-73
eslint:
enabled: false
@@ -10,4 +10,23 @@ plugins:
scss-lint:
enabled: true
brakeman:
enabled: true
enabled: false
checks:
similar-code:
enabled: false
exclude_patterns:
- "spec/"
- "**/specs/"
- "db/*"
- "bin/**/*"
- "db/**/*"
- "config/**/*"
- "public/**/*"
- "vendor/**/*"
- "node_modules/**/*"
- "lib/tasks/auto_annotate_models.rake"
- "app/test-matchers.js"
- "docs/*"
- "**/*.md"
- "**/*.yml"
- "app/javascript/dashboard/i18n/locale"
+23
View File
@@ -0,0 +1,23 @@
version: 1
update_configs:
- package_manager: "ruby:bundler"
directory: "/"
update_schedule: "weekly"
default_reviewers:
- "sony-mathew"
- "sojan-official"
- "subintp"
default_labels:
- "dependencies"
- "ruby"
version_requirement_updates: "auto"
- package_manager: "javascript"
directory: "/"
update_schedule: "weekly"
default_reviewers:
- "pranavrajs"
- "nithindavid"
default_labels:
- "dependencies"
- "javascript"
version_requirement_updates: "auto"
+20
View File
@@ -0,0 +1,20 @@
.bundle
.env
.env.*
.git
.gitignore
docker-compose.*
docker/Dockerfile
docker/dockerfiles
log
storage
public/system
tmp
.codeclimate.yml
public/assets
public/packs
node_modules
vendor/bundle
.DS_Store
*.swp
*~
+14
View File
@@ -0,0 +1,14 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# @see http://editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = spaces
tab_width = 2
[{*.{rb,erb,js,coffee,json,yml,css,scss,sh,markdown,md,html}]
indent_size = 2
+113
View File
@@ -0,0 +1,113 @@
# Used to verify the integrity of signed cookies. so ensure a secure value is set
SECRET_KEY_BASE=replace_with_lengthy_secure_hex
# Replace with the URL you are planning to use for your app
FRONTEND_URL=http://0.0.0.0:3000
# Force all access to the app over SSL, default is set to false
FORCE_SSL=false
# This lets you control new sign ups on your chatwoot installation
# true : default option, allows sign ups
# false : disables all the end points related to sign ups
# api_only: disables the UI for signup, but you can create sign ups via the account apis
ENABLE_ACCOUNT_SIGNUP=true
# Redis config
REDIS_URL=redis://redis:6379
# If you are using docker-compose, set this variable's value to be any string,
# which will be the password for the redis service running inside the docker-compose
# to make it secure
REDIS_PASSWORD=
# Postgres Database config variables
POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=
RAILS_ENV=development
RAILS_MAX_THREADS=5
# Mail outgoing
MAILER_SENDER_EMAIL=accounts@chatwoot.com
SMTP_PORT=1025
SMTP_DOMAIN=chatwoot.com
# if you are running docker-compose, set SMTP_ADDRESS value as "mailhog",
# else set the value as "localhost"
SMTP_ADDRESS=mailhog
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_AUTHENTICATION=
SMTP_ENABLE_STARTTLS_AUTO=
# Mail Incoming
# Set this to appropriate ingress channel with regards to incoming emails
# Possible values are :
# :relay for Exim, Postfix, Qmail
# :mailgun for Mailgun
# :mandrill for Mandrill
# :postmark for Postmark
# :sendgrid for Sendgrid
RAILS_INBOUND_EMAIL_SERVICE=
# Use one of the following based on the email ingress service
# Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html
RAILS_INBOUND_EMAIL_PASSWORD=
MAILGUN_INGRESS_SIGNING_KEY=
MANDRILL_INGRESS_API_KEY=
# Storage
ACTIVE_STORAGE_SERVICE=local
# Amazon S3
# documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
# Sentry
SENTRY_DSN=
# Log settings
# Disable if you want to write logs to a file
RAILS_LOG_TO_STDOUT=true
LOG_LEVEL=info
LOG_SIZE=500
### This environment variables are only required if you are setting up social media channels
# Facebook
# documentation: https://www.chatwoot.com/docs/facebook-setup
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
# Twitter
# documentation: https://www.chatwoot.com/docs/twitter-app-setup
TWITTER_APP_ID=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ENVIRONMENT=
#slack integration
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
### Change this env variable only if you are using a custom build mobile app
## Mobile app env variables
IOS_APP_ID=6C953F3RX2.com.chatwoot.app
## Push Notification
## generate a new key value here : https://d3v.one/vapid-key-generator/
# VAPID_PUBLIC_KEY=
# VAPID_PRIVATE_KEY=
#
# for mobile apps
# FCM_SERVER_KEY=
## Bot Customizations
USE_INBOX_AVATAR_FOR_BOT=true
## Development Only Config
# if you want to use letter_opener for local emails
# LETTER_OPENER=true
-4
View File
@@ -1,4 +0,0 @@
pusher_cluster=
pusher_key=
fb_app_id=
+9 -7
View File
@@ -1,14 +1,15 @@
module.exports = {
extends: ['airbnb/base', 'prettier', 'plugin:vue/recommended'],
extends: ['airbnb-base/legacy', 'prettier', 'plugin:vue/recommended'],
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2017,
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['html', 'prettier', 'babel'],
rules: {
'prettier/prettier': ['error'],
camelcase: 'off',
'no-param-reassign': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/no-named-as-default': 'off',
@@ -19,14 +20,16 @@ module.exports = {
'jsx-a11y/anchor-is-valid': 'off',
'import/no-unresolved': 'off',
'vue/max-attributes-per-line': ['error', {
'singleline': 3,
'singleline': 20,
'multiline': {
'max': 1,
'allowFirstLine': false
}
},
}],
'vue/html-self-closing': 'off',
"vue/no-v-html": 'off'
"vue/no-v-html": 'off',
'import/extensions': ['off']
},
settings: {
'import/resolver': {
@@ -39,10 +42,9 @@ module.exports = {
browser: true,
node: true,
jest: true,
jasmine: true
},
globals: {
__WEBPACK_ENV__: true,
__PUSHER__: true,
__FB_APP_ID__: true,
},
};
+2
View File
@@ -0,0 +1,2 @@
open_collective: chatwoot
github: chatwoot
+38
View File
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
@@ -0,0 +1,20 @@
---
name: Enhancement request
about: Suggest any enhancements for this project
title: ''
labels: ''
assignees: ''
---
**Is your enhancement request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions you've considered.
**Additional context**
Add any other context or screenshots about the enhancement request here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+32
View File
@@ -0,0 +1,32 @@
# Pull Request Template
## Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

+25 -5
View File
@@ -19,7 +19,6 @@
# Ignore Byebug command history file.
.byebug_history
config/database.yml
.DS_Store
*.log
# Ignore application configuration
@@ -30,8 +29,29 @@ node_modules
# Ignore env files
.env
# Ignore application config file
config/application.yml
public/uploads
public/packs
public/packs*
# VIM files
*.swp
*.swo
*.un~
.jest-cache
#VS Code files
.vscode
# ignore jetbrains IDE files
.idea
# coverage report
buildreports
coverage
/storage
# ignore packages
node_modules
package-lock.json
*.dump
+1
View File
@@ -0,0 +1 @@
12.16.1
+125 -2
View File
@@ -1,8 +1,131 @@
Metrics/LineLength:
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
inherit_from: .rubocop_todo.yml
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Layout/LineLength:
Max: 150
Documentation:
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Metrics/ClassLength:
Max: 125
Exclude:
- 'app/models/conversation.rb'
RSpec/ExampleLength:
Max: 25
Style/Documentation:
Enabled: false
Style/ExponentialNotation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Style/GlobalVars:
Exclude:
- 'config/initializers/redis.rb'
- 'lib/redis/alfred.rb'
- 'lib/global_config.rb'
Metrics/BlockLength:
Exclude:
- spec/**/*
- '**/routes.rb'
- 'config/environments/*'
- db/schema.rb
Rails/ApplicationController:
Exclude:
- 'app/controllers/api/v1/widget/messages_controller.rb'
- 'app/controllers/dashboard_controller.rb'
- 'app/controllers/widget_tests_controller.rb'
- 'app/controllers/widgets_controller.rb'
Style/ClassAndModuleChildren:
EnforcedStyle: compact
Exclude:
- 'config/application.rb'
RSpec/NestedGroups:
Enabled: true
Max: 4
RSpec/MessageSpies:
Enabled: false
Metrics/MethodLength:
Exclude:
- 'db/migrate/20161123131628_devise_token_auth_create_users.rb'
Rails/CreateTableWithTimestamps:
Exclude:
- 'db/migrate/20170207092002_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb'
Style/GuardClause:
Exclude:
- 'app/builders/account_builder.rb'
- 'app/models/attachment.rb'
- 'app/models/message.rb'
- 'db/migrate/20190819005836_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb'
Metrics/AbcSize:
Exclude:
- 'db/migrate/20190819005836_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb'
Metrics/CyclomaticComplexity:
Exclude:
- 'db/migrate/20190819005836_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb'
Rails/ReversibleMigration:
Exclude:
- 'db/migrate/20161025070152_removechannelsfrommodels.rb'
- 'db/migrate/20161025070645_remchannel.rb'
- 'db/migrate/20161025070645_remchannel.rb'
- 'db/migrate/20161110102609_removeinboxid.rb'
- 'db/migrate/20170519091539_add_avatar_to_fb.rb'
- 'db/migrate/20191020085608_rename_old_tables.rb'
- 'db/migrate/20191126185833_update_user_invite_foreign_key.rb'
- 'db/migrate/20191130164019_add_template_type_to_messages.rb'
Rails/BulkChangeTable:
Exclude:
- 'db/migrate/20161025070152_removechannelsfrommodels.rb'
- 'db/migrate/20200121190901_create_account_users.rb'
- 'db/migrate/20170211092540_notnullableusers.rb'
- 'db/migrate/20170403095203_contactadder.rb'
- 'db/migrate/20170406104018_add_default_status_conv.rb'
- 'db/migrate/20170511134418_latlong.rb'
- 'db/migrate/20191027054756_create_contact_inboxes.rb'
- 'db/migrate/20191130164019_add_template_type_to_messages.rb'
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/channel/twitter_profile.rb'
- 'app/models/webhook.rb'
RSpec/NamedSubject:
Enabled: false
AllCops:
Exclude:
- 'bin/**/*'
- 'db/schema.rb'
- 'public/**/*'
- 'config/initializers/bot.rb'
- 'vendor/**/*'
- 'node_modules/**/*'
- 'lib/tasks/auto_annotate_models.rake'
- 'config/environments/**/*'
- 'tmp/**/*'
- 'storage/**/*'
+295
View File
@@ -0,0 +1,295 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-10-23 16:47:02 +0530 using RuboCop version 0.73.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Configuration parameters: EnforcedStyle.
# SupportedStyles: native, lf, crlf
Layout/EndOfLine:
Exclude:
- 'deploy/after_restart.rb'
# Offense count: 1
Lint/DuplicateMethods:
Exclude:
- 'app/controllers/api/v1/reports_controller.rb'
# Offense count: 1
Lint/RescueException:
Exclude:
- 'app/builders/messages/message_builder.rb'
# Offense count: 4
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'app/controllers/api/v1/reports_controller.rb'
# Offense count: 3
# Configuration parameters: AllowKeywordBlockArguments.
Lint/UnderscorePrefixedVariableName:
Exclude:
- 'app/models/account.rb'
- 'deploy/before_symlink.rb'
# Offense count: 18
Lint/UselessAssignment:
Exclude:
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/controllers/api/v1/facebook_indicators_controller.rb'
- 'app/listeners/action_cable_listener.rb'
- 'app/listeners/reporting_listener.rb'
- 'app/models/channel/facebook_page.rb'
- 'app/models/facebook_page.rb'
# Offense count: 14
Metrics/AbcSize:
Max: 26
# Offense count: 1
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 30
# Offense count: 2
Metrics/CyclomaticComplexity:
Max: 7
# Offense count: 10
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 19
# Offense count: 1
Metrics/PerceivedComplexity:
Max: 8
# Offense count: 6
Naming/AccessorMethodName:
Exclude:
- 'app/builders/report_builder.rb'
- 'app/controllers/api/v1/accounts_controller.rb'
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/controllers/api/v1/conversations_controller.rb'
- 'app/controllers/passwords_controller.rb'
# Offense count: 9
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'app/controllers/api/base_controller.rb'
- 'app/controllers/api/v1/conversations_controller.rb'
- 'app/controllers/api/v1/webhooks_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/models/message.rb'
- 'lib/integrations/widget/outgoing_message_builder.rb'
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/models/message.rb'
# Offense count: 1
# Cop supports --auto-correct.
Performance/StringReplacement:
Exclude:
- 'lib/events/base.rb'
# Offense count: 4
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/models/contact_spec.rb'
- 'spec/models/user_spec.rb'
# Offense count: 1
RSpec/DescribeClass:
Exclude:
- 'spec/mailers/confirmation_instructions_spec.rb'
# Offense count: 1
RSpec/DescribeSymbol:
Exclude:
- 'spec/mailers/confirmation_instructions_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterExample:
Exclude:
- 'spec/models/user_spec.rb'
# Offense count: 1
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
- 'spec/models/conversation_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: single_line_only, single_statement_only, disallow
RSpec/ImplicitSubject:
Exclude:
- 'spec/models/user_spec.rb'
# Offense count: 7
# Configuration parameters: AggregateFailuresByDefault.
RSpec/MultipleExpectations:
Max: 7
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: not_to, to_not
RSpec/NotToNot:
Exclude:
- 'spec/mailers/confirmation_instructions_spec.rb'
# Offense count: 1
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/models/conversation_spec.rb'
# Offense count: 4
# Cop supports --auto-correct.
Rails/ActiveRecordAliases:
Exclude:
- 'app/controllers/api/v1/agents_controller.rb'
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/controllers/api/v1/canned_responses_controller.rb'
- 'app/controllers/api/v1/contacts_controller.rb'
# Offense count: 2
# Cop supports --auto-correct.
Rails/BelongsTo:
Exclude:
- 'app/models/message.rb'
- 'app/models/user.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/EnumHash:
Exclude:
- 'app/models/attachment.rb'
- 'app/models/conversation.rb'
- 'app/models/message.rb'
- 'app/models/user.rb'
# Offense count: 1
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/user.rb'
# Offense count: 1
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/InverseOf:
Exclude:
- 'app/models/user.rb'
# Offense count: 1
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/home_controller.rb'
# Offense count: 2
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Rails/Output:
Exclude:
- 'app/bot/bot.rb'
- 'app/builders/account_builder.rb'
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Rails/TimeZone:
Exclude:
- 'app/builders/report_builder.rb'
- 'lib/reports/update_account_identity.rb'
- 'lib/reports/update_agent_identity.rb'
- 'lib/reports/update_identity.rb'
- 'spec/models/conversation_spec.rb'
# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/Validation:
Exclude:
- 'app/models/canned_response.rb'
- 'app/models/channel/facebook_page.rb'
- 'app/models/facebook_page.rb'
- 'app/models/telegram_bot.rb'
- 'app/models/user.rb'
# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'app/builders/messages/message_builder.rb'
- 'app/controllers/api/v1/inbox_members_controller.rb'
- 'app/models/channel/facebook_page.rb'
- 'app/models/channel/web_widget.rb'
- 'app/presenters/conversations/event_data_presenter.rb'
- 'app/services/facebook/send_reply_service.rb'
- 'lib/integrations/facebook/delivery_status.rb'
- 'lib/integrations/facebook/message_creator.rb'
- 'lib/integrations/facebook/message_parser.rb'
- 'lib/integrations/widget/incoming_message_builder.rb'
# Offense count: 4
Style/CommentedKeyword:
Exclude:
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/controllers/api/v1/conversations/assignments_controller.rb'
- 'app/controllers/api/v1/conversations/labels_controller.rb'
- 'app/controllers/api/v1/labels_controller.rb'
# Offense count: 1
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse:
Exclude:
- 'app/finders/conversation_finder.rb'
# Offense count: 1
Style/MixinUsage:
Exclude:
- 'app/bot/bot.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'app/controllers/api/v1/callbacks_controller.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'app/models/channel/facebook_page.rb'
+1 -1
View File
@@ -1 +1 @@
2.6.3
2.7.1
+284
View File
@@ -0,0 +1,284 @@
# Default application configuration that all configurations inherit from.
scss_files: '**/*.scss'
plugin_directories: ['.scss-linters']
# List of gem names to load custom linters from (make sure they are already
# installed)
plugin_gems: []
# Default severity of all linters.
severity: warning
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BemDepth:
enabled: false
max_elements: 1
BorderZero:
enabled: true
convention: zero # or `none`
ChainedClasses:
enabled: false
ColorKeyword:
enabled: true
ColorVariable:
enabled: true
Comment:
enabled: true
style: silent
DebugStatement:
enabled: true
DeclarationOrder:
enabled: true
DisableLinterReason:
enabled: false
DuplicateProperty:
enabled: true
ElsePlacement:
enabled: true
style: new_line
EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: true
EmptyRule:
enabled: true
ExtendDirective:
enabled: false
FinalNewline:
enabled: true
present: true
HexLength:
enabled: true
style: short # or 'long'
HexNotation:
enabled: true
style: lowercase # or 'uppercase'
HexValidation:
enabled: true
IdSelector:
enabled: true
ImportantRule:
enabled: false
ImportPath:
enabled: true
leading_underscore: false
filename_extension: false
Indentation:
enabled: true
allow_non_nested_indentation: false
character: space # or 'tab'
width: 2
LeadingZero:
enabled: false
MergeableSelector:
enabled: true
force_nesting: true
NameFormat:
enabled: true
allow_leading_underscore: true
convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern
NestingDepth:
enabled: true
max_depth: 6
ignore_parent_selectors: false
PlaceholderInExtend:
enabled: true
PrivateNamingConvention:
enabled: false
prefix: _
PropertyCount:
enabled: false
include_nested: false
max_properties: 10
PropertySortOrder:
enabled: true
ignore_unspecified: false
min_properties: 2
separate_groups: false
PropertySpelling:
enabled: true
extra_properties: []
disabled_properties: []
PropertyUnits:
enabled: true
global: [
'ch',
'em',
'ex',
'rem', # Font-relative lengths
'cm',
'in',
'mm',
'pc',
'pt',
'px',
'q', # Absolute lengths
'vh',
'vw',
'vmin',
'vmax', # Viewport-percentage lengths
'fr', # Grid fractional lengths
'deg',
'grad',
'rad',
'turn', # Angle
'ms',
's', # Duration
'Hz',
'kHz', # Frequency
'dpi',
'dpcm',
'dppx', # Resolution
'%',
] # Other
properties: {}
PseudoElement:
enabled: true
QualifyingElement:
enabled: true
allow_element_with_attribute: false
allow_element_with_class: false
allow_element_with_id: false
exclude:
- 'app/assets/stylesheets/administrate/components/_buttons.scss'
SelectorDepth:
enabled: true
max_depth: 5
SelectorFormat:
enabled: false
Shorthand:
enabled: true
allowed_shorthands: [1, 2, 3, 4]
SingleLinePerProperty:
enabled: true
allow_single_line_rule_sets: true
SingleLinePerSelector:
enabled: true
SpaceAfterComma:
enabled: true
style: one_space # or 'no_space', or 'at_least_one_space'
SpaceAfterComment:
enabled: false
style: one_space # or 'no_space', or 'at_least_one_space'
allow_empty_comments: true
SpaceAfterPropertyColon:
enabled: true
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
SpaceAfterPropertyName:
enabled: true
SpaceAfterVariableColon:
enabled: false
style: one_space # or 'no_space', 'at_least_one_space' or 'one_space_or_newline'
SpaceAfterVariableName:
enabled: true
SpaceAroundOperator:
enabled: true
style: one_space # or 'at_least_one_space', or 'no_space'
SpaceBeforeBrace:
enabled: true
style: space # or 'new_line'
allow_single_line_padding: false
SpaceBetweenParens:
enabled: true
spaces: 0
StringQuotes:
enabled: true
style: single_quotes # or double_quotes
TrailingSemicolon:
enabled: true
TrailingWhitespace:
enabled: true
TrailingZero:
enabled: false
TransitionAll:
enabled: false
UnnecessaryMantissa:
enabled: false
UnnecessaryParentReference:
enabled: false
UrlFormat:
enabled: true
UrlQuotes:
enabled: true
VariableForProperty:
enabled: false
properties: []
VendorPrefix:
enabled: true
identifier_list: base
additional_identifiers: []
excluded_identifiers: []
ZeroUnit:
enabled: true
Compass::*:
enabled: false
exclude:
- 'app/javascript/widget/assets/scss/_reset.scss'
- 'app/javascript/widget/assets/scss/sdk.css'
- 'app/assets/stylesheets/administrate/reset/_normalize.scss'
-1
View File
@@ -10,4 +10,3 @@ install_plugin Capistrano::Puma
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
+94 -44
View File
@@ -1,71 +1,121 @@
source 'https://rubygems.org'
ruby '2.6.3'
ruby '2.7.1'
gem 'acts-as-taggable-on', git: 'https://github.com/mbleigh/acts-as-taggable-on'
gem 'bootsnap'
gem 'carrierwave-aws'
gem 'chargebee', '~>2'
gem 'coffee-rails'
gem 'devise', git: 'https://github.com/plataformatec/devise'
gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth'
gem 'facebook-messenger', '~> 0.11.1'
gem 'figaro'
gem 'hashie'
gem 'jbuilder', '~> 2.5'
gem 'kaminari'
gem 'koala'
gem 'mini_magick'
gem 'nightfury', '~> 1.0', '>= 1.0.1'
gem 'omniauth-facebook'
gem 'pg'
gem 'poltergeist'
gem 'puma', '~> 3.0'
gem 'pundit'
gem 'pusher'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
##-- base gems for rails --##
gem 'rack-cors', require: 'rack/cors'
gem 'rails', '~> 6', github: 'rails/rails'
gem 'rails'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
##-- rails helper gems --##
gem 'acts-as-taggable-on'
gem 'attr_extras'
gem 'browser'
gem 'hashie'
gem 'jbuilder'
gem 'kaminari'
gem 'responders'
gem 'rest-client'
gem 'telephone_number'
gem 'time_diff'
gem 'tzinfo-data'
gem 'valid_email2'
# compress javascript config.assets.js_compressor
gem 'uglifier'
##-- for active storage --##
gem 'aws-sdk-s3', require: false
gem 'azure-storage-blob', require: false
gem 'google-cloud-storage', require: false
gem 'mini_magick'
##-- gems for database --#
gem 'groupdate'
gem 'pg'
gem 'redis'
gem 'redis-namespace'
gem 'redis-rack-cache'
gem 'responders'
gem 'rest-client'
gem 'sass-rails', '~> 5.0'
gem 'sentry-raven'
gem 'sidekiq'
gem 'telegram-bot-ruby'
gem 'therubyracer', platforms: :ruby
gem 'time_diff'
gem 'uglifier', '>= 1.3.0'
gem 'valid_email2'
gem 'wisper', '2.0.0'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
##--- gems for server & infra configuration ---##
gem 'dotenv-rails'
gem 'foreman'
gem 'puma'
gem 'webpacker'
# for starting different server processes
gem 'foreman'
##--- gems for authentication & authorization ---##
gem 'devise'
gem 'devise_token_auth'
# authorization
gem 'jwt'
gem 'pundit'
# super admin
gem 'administrate'
##--- gems for pubsub service ---##
# https://karolgalanciak.com/blog/2019/11/30/from-activerecord-callbacks-to-publish-slash-subscribe-pattern-and-event-driven-design/
gem 'wisper', '2.0.0'
##--- gems for channels ---##
gem 'facebook-messenger'
gem 'telegram-bot-ruby'
gem 'twilio-ruby', '~> 5.32.0'
# twitty will handle subscription of twitter account events
# gem 'twitty', git: 'https://github.com/chatwoot/twitty'
gem 'twitty'
# facebook client
gem 'koala'
# slack client
gem 'slack-ruby-client'
# Random name generator
gem 'haikunator'
##--- gems for debugging and error reporting ---##
# static analysis
gem 'brakeman'
gem 'scout_apm'
gem 'sentry-raven'
##-- background job processing --##
gem 'sidekiq'
##-- used for single column multiple binary flags in notification settings/feature flagging --##
gem 'flag_shih_tzu'
##-- Push notification service --##
gem 'fcm'
gem 'webpush'
group :development do
gem 'annotate'
gem 'bullet'
gem 'letter_opener'
gem 'web-console'
# used in swagger build
gem 'json_refs', git: 'https://github.com/tzmfreedom/json_refs', ref: 'e32deb0'
end
group :development, :test do
# locking until https://github.com/codeclimate/test-reporter/issues/418 is resolved
gem 'action-cable-testing'
gem 'bundle-audit', require: false
gem 'byebug', platform: :mri
gem 'factory_bot_rails'
gem 'faker'
gem 'listen'
gem 'rspec-rails', '~> 3.8'
gem 'rubocop', '~> 0.73.0', require: false
gem 'mock_redis', git: 'https://github.com/sds/mock_redis', ref: '16d00789f0341a3aac35126c0ffe97a596753ff9'
gem 'pry-rails'
gem 'rspec-rails', '~> 4.0.0.beta2'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'scss_lint', require: false
gem 'seed_dump'
gem 'shoulda-matchers'
gem 'simplecov', '0.17.1', require: false
gem 'spring'
gem 'spring-watcher-listen'
gem 'webmock'
end
gem 'attr_extras'
+445 -323
View File
@@ -1,335 +1,380 @@
GIT
remote: git://github.com/rails/rails.git
revision: 4a2746db1c92d0bf246e938b872b233a64f0a18b
remote: https://github.com/sds/mock_redis
revision: 16d00789f0341a3aac35126c0ffe97a596753ff9
ref: 16d00789f0341a3aac35126c0ffe97a596753ff9
specs:
actioncable (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
mock_redis (0.22.0)
GIT
remote: https://github.com/tzmfreedom/json_refs
revision: e32deb073ce9aef39bdd63556bffd7fe7c2a803d
ref: e32deb0
specs:
json_refs (0.1.2)
hana
GEM
remote: https://rubygems.org/
specs:
action-cable-testing (0.6.1)
actioncable (>= 5.0)
actioncable (6.0.3.2)
actionpack (= 6.0.3.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
activejob (= 6.1.0.alpha)
activerecord (= 6.1.0.alpha)
activestorage (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
actionmailbox (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
mail (>= 2.7.1)
actionmailer (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
actionview (= 6.1.0.alpha)
activejob (= 6.1.0.alpha)
actionmailer (6.0.3.2)
actionpack (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.0.alpha)
actionview (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
rack (~> 2.0)
actionpack (6.0.3.2)
actionview (= 6.0.3.2)
activesupport (= 6.0.3.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
activerecord (= 6.1.0.alpha)
activestorage (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
actiontext (6.0.3.2)
actionpack (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
nokogiri (>= 1.8.5)
actionview (6.1.0.alpha)
activesupport (= 6.1.0.alpha)
actionview (6.0.3.2)
activesupport (= 6.0.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.0.alpha)
activesupport (= 6.1.0.alpha)
activejob (6.0.3.2)
activesupport (= 6.0.3.2)
globalid (>= 0.3.6)
activemodel (6.1.0.alpha)
activesupport (= 6.1.0.alpha)
activerecord (6.1.0.alpha)
activemodel (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
activestorage (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
activejob (= 6.1.0.alpha)
activerecord (= 6.1.0.alpha)
activemodel (6.0.3.2)
activesupport (= 6.0.3.2)
activerecord (6.0.3.2)
activemodel (= 6.0.3.2)
activesupport (= 6.0.3.2)
activestorage (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
marcel (~> 0.3.1)
activesupport (6.1.0.alpha)
activesupport (6.0.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.1, >= 2.1.8)
rails (6.1.0.alpha)
actioncable (= 6.1.0.alpha)
actionmailbox (= 6.1.0.alpha)
actionmailer (= 6.1.0.alpha)
actionpack (= 6.1.0.alpha)
actiontext (= 6.1.0.alpha)
actionview (= 6.1.0.alpha)
activejob (= 6.1.0.alpha)
activemodel (= 6.1.0.alpha)
activerecord (= 6.1.0.alpha)
activestorage (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
bundler (>= 1.3.0)
railties (= 6.1.0.alpha)
sprockets-rails (>= 2.0.0)
railties (6.1.0.alpha)
actionpack (= 6.1.0.alpha)
activesupport (= 6.1.0.alpha)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
GIT
remote: https://github.com/lynndylanhurley/devise_token_auth
revision: b6915aa1bd12e28236ef6e9821a29fba5c5039d2
specs:
devise_token_auth (1.1.1)
bcrypt (~> 3.0)
devise (> 3.5.2, < 5)
rails (>= 4.2.0, < 6.1)
GIT
remote: https://github.com/mbleigh/acts-as-taggable-on
revision: fbf2b609b69a90edcd5813e9ba6395a7e293e977
specs:
acts-as-taggable-on (6.0.1)
zeitwerk (~> 2.2, >= 2.2.2)
acts-as-taggable-on (6.5.0)
activerecord (>= 5.0, < 6.1)
GIT
remote: https://github.com/plataformatec/devise
revision: 6bb74c5abff9f75e992560b308b1f8ae926da50e
specs:
devise (4.7.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
administrate (0.13.0)
actionpack (>= 4.2)
actionview (>= 4.2)
activerecord (>= 4.2)
autoprefixer-rails (>= 6.0)
datetime_picker_rails (~> 0.0.7)
jquery-rails (>= 4.0)
kaminari (>= 1.0)
momentjs-rails (~> 2.8)
sassc-rails (~> 2.1)
selectize-rails (~> 0.6)
annotate (3.1.1)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
ast (2.4.1)
attr_extras (6.2.4)
autoprefixer-rails (9.8.2)
execjs
aws-eventstream (1.1.0)
aws-partitions (1.332.0)
aws-sdk-core (3.100.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.34.1)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.69.1)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.0)
aws-eventstream (~> 1, >= 1.0.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
azure-storage-blob (2.0.0)
azure-storage-common (~> 2.0)
nokogiri (~> 1.10.4)
azure-storage-common (2.0.1)
faraday (~> 1.0)
faraday_middleware (~> 1.0.0.rc1)
nokogiri (~> 1.10.4)
bcrypt (3.1.13)
bindex (0.8.1)
bootsnap (1.4.6)
msgpack (~> 1.0)
brakeman (4.8.2)
browser (4.2.0)
builder (3.2.4)
bullet (6.1.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
bundle-audit (0.1.0)
bundler-audit
bundler-audit (0.7.0.1)
bundler (>= 1.2.0, < 3)
thor (>= 0.18, < 2)
byebug (11.1.3)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.6)
connection_pool (2.2.3)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.6)
datetime_picker_rails (0.0.7)
momentjs-rails (>= 2.8.1)
declarative (0.0.10)
declarative-option (0.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.7.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
attr_extras (6.2.1)
aws-eventstream (1.0.3)
aws-partitions (1.206.0)
aws-sdk-core (3.64.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.24.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.46.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.13)
bindex (0.8.1)
bootsnap (1.4.4)
msgpack (~> 1.0)
brakeman (4.6.1)
builder (3.2.3)
byebug (11.0.1)
capybara (3.28.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
carrierwave (1.3.1)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
carrierwave-aws (1.3.0)
aws-sdk-s3 (~> 1.0)
carrierwave (>= 0.7, < 2.0)
chargebee (2.6.9)
json_pure (~> 2.1)
rest-client (>= 1.8, < 3.0)
cliver (0.3.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
crass (1.0.4)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
devise_token_auth (1.1.4)
bcrypt (~> 3.0)
devise (> 3.5.2, < 5)
rails (>= 4.2.0, < 6.1)
sprockets (= 3.7.2)
diff-lcs (1.4)
digest-crc (0.5.1)
docile (1.3.2)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (0.7.0)
dotenv (2.7.5)
dotenv-rails (2.7.5)
dotenv (= 2.7.5)
railties (>= 3.2, < 6.1)
equalizer (0.0.11)
erubi (1.8.0)
erubi (1.9.0)
execjs (2.7.0)
facebook-messenger (0.11.1)
facebook-messenger (1.5.0)
httparty (~> 0.13, >= 0.13.7)
rack (>= 1.6.4)
factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.2)
factory_bot (~> 5.0.2)
railties (>= 4.2.0)
faraday (0.15.4)
rack (>= 1.4.5)
factory_bot (6.0.2)
activesupport (>= 5.0.0)
factory_bot_rails (6.0.0)
factory_bot (~> 6.0.0)
railties (>= 5.0.0)
faker (2.12.0)
i18n (>= 1.6, < 2)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
figaro (1.1.1)
thor (~> 0.14)
foreman (0.64.0)
dotenv (~> 0.7.0)
thor (>= 0.13.6)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fcm (1.0.1)
faraday (~> 1.0.0)
ffi (1.13.1)
flag_shih_tzu (0.3.23)
foreman (0.87.1)
gli (2.19.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
hashie (3.6.0)
google-api-client (0.41.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.2)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.26.2)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.13.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
groupdate (5.0.0)
activesupport (>= 5)
haikunator (1.1.0)
hana (1.3.6)
hashdiff (1.0.1)
hashie (4.1.0)
hkdf (0.3.0)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
httparty (0.17.0)
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.6.0)
i18n (1.8.3)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
inflecto (0.0.2)
jaro_winkler (1.5.3)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jmespath (1.4.0)
json (2.2.0)
json_pure (2.2.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.3.0)
jwt (2.2.1)
kaminari (1.1.1)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
koala (3.0.0)
addressable
faraday
json (>= 1.8)
launchy (2.4.3)
addressable (~> 2.3)
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
libv8 (3.16.14.19)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.2.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.6.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mime-types (3.2.2)
memoist (0.16.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mimemagic (0.3.3)
mini_magick (4.9.5)
mime-types-data (3.2020.0512)
mimemagic (0.3.5)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
msgpack (1.3.1)
multi_json (1.13.1)
minitest (5.14.1)
momentjs-rails (2.20.1)
railties (>= 3.1)
msgpack (1.3.3)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
netrc (0.11.0)
nightfury (1.0.1)
nio4r (2.4.0)
nokogiri (1.10.4)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.1)
faraday (>= 0.8, < 0.16.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0)
rack (>= 1.6.2, < 3)
omniauth-facebook (5.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1)
omniauth (~> 1.9)
oauth (0.5.4)
orm_adapter (0.5.0)
parallel (1.17.0)
parser (2.6.4.0)
ast (~> 2.4.0)
pg (1.1.4)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
public_suffix (3.1.1)
puma (3.12.1)
os (1.1.0)
parallel (1.19.2)
parser (2.7.1.4)
ast (~> 2.4.1)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.5)
puma (4.3.5)
nio4r (~> 2.0)
pundit (2.1.0)
activesupport (>= 3.0.0)
pusher (1.3.3)
httpclient (~> 2.7)
multi_json (~> 1.0)
pusher-signature (~> 0.1.8)
pusher-signature (0.1.8)
rack (2.0.7)
rack-cache (1.9.0)
rack (2.2.3)
rack-cache (1.12.0)
rack (>= 0.4)
rack-cors (1.0.3)
rack-protection (2.0.7)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-protection (2.0.8.1)
rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.2)
actioncable (= 6.0.3.2)
actionmailbox (= 6.0.3.2)
actionmailer (= 6.0.3.2)
actionpack (= 6.0.3.2)
actiontext (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
activemodel (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
bundler (>= 1.3.0)
railties (= 6.0.3.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.2)
actionpack (= 6.0.3.2)
activesupport (= 6.0.3.2)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.1.2)
redis-namespace (1.6.0)
redis (4.2.1)
redis-namespace (1.7.0)
redis (>= 3.0.4)
redis-rack-cache (2.1.0)
rack-cache (>= 1.6, < 2)
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
redis-store (>= 1.6, < 2)
redis-store (1.6.0)
redis (>= 2.2, < 5)
ref (2.0.0)
regexp_parser (1.6.0)
responders (3.0.0)
redis-store (1.9.0)
redis (>= 4, < 5)
regexp_parser (1.7.1)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rest-client (2.1.0)
@@ -337,53 +382,94 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
retriable (3.1.2)
rexml (3.2.4)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
rubocop (0.73.0)
jaro_winkler (~> 1.5.1)
rspec-support (~> 3.9.0)
rspec-rails (4.0.1)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.9)
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.9.3)
rubocop (0.86.0)
parallel (~> 1.10)
parser (>= 2.6)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.0.3, < 1.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.0.3)
parser (>= 2.7.0.1)
rubocop-performance (1.6.1)
rubocop (>= 0.71.0)
rubocop-rails (2.6.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.82.0)
rubocop-rspec (1.40.0)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.1.0)
railties (>= 5.2.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (2.6.7)
parser
scss_lint (0.59.0)
sass (~> 3.5, >= 3.5.5)
seed_dump (3.3.1)
activerecord (>= 4)
activesupport (>= 4)
sentry-raven (2.11.0)
faraday (>= 0.7.6, < 1.0)
sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
selectize-rails (0.12.6)
semantic_range (2.3.0)
sentry-raven (3.0.0)
faraday (>= 1.0)
shoulda-matchers (4.3.0)
activesupport (>= 4.2.0)
sidekiq (6.0.7)
connection_pool (>= 2.2.2)
rack (~> 2.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slack-ruby-client (0.14.6)
activesupport
faraday (>= 0.9)
faraday_middleware
gli
hashie
websocket-driver
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
@@ -395,28 +481,36 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
telegram-bot-ruby (0.11.0)
telegram-bot-ruby (0.12.0)
faraday
inflecto
virtus
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.20.3)
telephone_number (1.4.7)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.9)
tilt (2.0.10)
time_diff (0.3.0)
activesupport
i18n
tzinfo (1.2.5)
twilio-ruby (5.32.0)
faraday (~> 1.0.0)
jwt (>= 1.5, <= 2.5)
nokogiri (>= 1.6, < 2.0)
twitty (0.1.1)
oauth
tzinfo (1.2.7)
thread_safe (~> 0.1)
uglifier (4.1.20)
tzinfo-data (1.2020.1)
tzinfo (>= 1.0.0)
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unicode-display_width (1.6.0)
valid_email2 (3.0.4)
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
uniform_notifier (1.13.0)
valid_email2 (3.2.2)
activemodel (>= 3.2)
mail (~> 2.5)
virtus (1.0.5)
@@ -426,82 +520,110 @@ GEM
equalizer (~> 0.0, >= 0.0.9)
warden (1.2.8)
rack (>= 2.0.6)
web-console (4.0.1)
web-console (4.0.3)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webpacker (4.0.7)
activesupport (>= 4.2)
webmock (3.8.3)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.1.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webpush (1.0.0)
hkdf (~> 0.2)
jwt (~> 2.0)
websocket-driver (0.7.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
websocket-extensions (0.1.5)
wisper (2.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.1.9)
zeitwerk (2.3.0)
PLATFORMS
ruby
DEPENDENCIES
acts-as-taggable-on!
action-cable-testing
acts-as-taggable-on
administrate
annotate
attr_extras
aws-sdk-s3
azure-storage-blob
bootsnap
brakeman
browser
bullet
bundle-audit
byebug
carrierwave-aws
chargebee (~> 2)
coffee-rails
devise!
devise_token_auth!
facebook-messenger (~> 0.11.1)
devise
devise_token_auth
dotenv-rails
facebook-messenger
factory_bot_rails
figaro
faker
fcm
flag_shih_tzu
foreman
google-cloud-storage
groupdate
haikunator
hashie
jbuilder (~> 2.5)
jbuilder
json_refs!
jwt
kaminari
koala
letter_opener
listen
mini_magick
nightfury (~> 1.0, >= 1.0.1)
omniauth-facebook
mock_redis!
pg
poltergeist
puma (~> 3.0)
pry-rails
puma
pundit
pusher
rack-cors
rails (~> 6)!
rails
redis
redis-namespace
redis-rack-cache
responders
rest-client
rspec-rails (~> 3.8)
rubocop (~> 0.73.0)
sass-rails (~> 5.0)
rspec-rails (~> 4.0.0.beta2)
rubocop
rubocop-performance
rubocop-rails
rubocop-rspec
scout_apm
scss_lint
seed_dump
sentry-raven
shoulda-matchers
sidekiq
simplecov (= 0.17.1)
slack-ruby-client
spring
spring-watcher-listen
telegram-bot-ruby
therubyracer
telephone_number
time_diff
twilio-ruby (~> 5.32.0)
twitty
tzinfo-data
uglifier (>= 1.3.0)
uglifier
valid_email2
web-console
webmock
webpacker
webpush
wisper (= 2.0.0)
RUBY VERSION
ruby 2.6.3p62
ruby 2.7.1p83
BUNDLED WITH
1.17.3
2.1.4
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017-2019 ThoughtWoot Inc.
Copyright (c) 2017-2020 ThoughtWoot Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+3
View File
@@ -0,0 +1,3 @@
release: bundle exec rails db:prepare
web: bin/rails server -p $PORT -e $RAILS_ENV
worker: bundle exec sidekiq -C config/sidekiq.yml
+2 -1
View File
@@ -1,2 +1,3 @@
backend: bin/rails s -p 3000
frontend: bin/webpack-dev-server
frontend: bin/webpack-dev-server
worker: bundle exec sidekiq -C config/sidekiq.yml
+58 -59
View File
@@ -1,67 +1,66 @@
![Woot-logo](.github/woot-logo.png)
<p align="center">
<img src="https://s3.us-west-2.amazonaws.com/gh-assets.chatwoot.com/brand.svg" alt="Woot-logo" width="240">
Opensource alternative to Intercom, Zendesk, Drift, Crisp etc.
<div align="center">A simple and elegant live chat software</div>
<div align="center">An opensource alternative to Intercom, Zendesk, Drift, Crisp etc.</div>
</p>
<p align="center">
<a href="https://heroku.com/deploy?template=https://github.com/chatwoot/chatwoot/tree/master" alt="Deploy to Heroku">
<img alt="Deploy" src="https://www.herokucdn.com/deploy/button.svg"/>
</a>
</p>
___
![CircleCI Badge](https://img.shields.io/circleci/build/github/chatwoot/chatwoot)
![Dependencies](https://img.shields.io/david/chatwoot/chatwoot)
![Github Issues](https://img.shields.io/github/issues/chatwoot/chatwoot)
![License](https://img.shields.io/github/license/chatwoot/chatwoot)
[![Maintainability](https://api.codeclimate.com/v1/badges/80f9e1a7c72d186289ad/maintainability)](https://codeclimate.com/github/chatwoot/chatwoot/maintainability)
![Commits-per-month](https://img.shields.io/github/commit-activity/m/chatwoot/chatwoot)
<p align="center">
<a href="https://codeclimate.com/github/chatwoot/chatwoot/maintainability"><img src="https://api.codeclimate.com/v1/badges/80f9e1a7c72d186289ad/maintainability" alt="Maintainability"></a>
<img src="https://img.shields.io/circleci/build/github/chatwoot/chatwoot" alt="CircleCI Badge">
<a href="https://hub.docker.com/r/chatwoot/chatwoot/"><img src="https://img.shields.io/docker/cloud/build/chatwoot/chatwoot" alt="Docker Build Badge"></a>
<img src="https://img.shields.io/github/license/chatwoot/chatwoot" alt="License">
<img src="https://img.shields.io/github/commit-activity/m/chatwoot/chatwoot" alt="Commits-per-month">
<a title="Crowdin" target="_self" href="https://chatwoot.crowdin.com/chatwoot"><img src="https://badges.crowdin.net/e/37ced7eba411064bd792feb3b7a28b16/localized.svg"></a>
<a href="https://discord.gg/cJXdrwS"><img src="https://img.shields.io/discord/647412545203994635" alt="Discord"></a>
</p>
![ChatUI progess](https://chatwoot.com/images/dashboard-screen.png)
![ChatUI progess](https://s3.us-west-2.amazonaws.com/gh-assets.chatwoot.com/chatwoot-dashboard-assets.png)
## Build Setup
## Background
Chatwoot is a customer support tool for instant messaging channels which can help businesses to provide exceptional customer support. The development of Chatwoot started in 2016 and it failed to succeed as a business and eventually shut the shop in 2017. During 2019 #Hacktoberfest, the maintainers decided to make it opensource instead of letting the code rust in a private repo. With a pleasant surprise, Chatwoot became a trending project on Hacker News and best of all, got lots of love from the community.
Now, a failed project is back on track and the prospects are looking great. The team is back to working on the project and we are building it in the open. Thanks to the ideas and contributions from the community.
## Documentation
Detailed documentation is available at [www.chatwoot.com/docs](https://www.chatwoot.com/docs).
You can find the quick setup docs [here](https://www.chatwoot.com/docs/quick-setup).
## Branching model
We use [git-flow](https://nvie.com/posts/a-successful-git-branching-model/) branching model. The base branch is `develop`.
If you are looking for a stable version, please use the `master` or tags labelled as `v1.x.x`.
## Heroku one-click deploy
Deploying chatwoot to heroku, it's a breeze. It's as simple as clicking this button.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/chatwoot/chatwoot/tree/master)
Follow this [link](https://www.chatwoot.com/docs/environment-variables) to understand setting the correct environment variables for the app to work with all the features. There might be breakages if you do not set the relevant environment variables. This applies to deploying the docker image as well.
## Docker
Follow our [docker development guide](https://www.chatwoot.com/docs/installation-guide-docker) to develop and debug the application using `docker-compose`.
Follow our [environment variables](https://www.chatwoot.com/docs/environment-variables/) guide to setup environment for Docker.
## Contributors ✨
Thanks goes to all these [wonderful people](https://www.chatwoot.com/docs/contributors):
<a href="https://github.com/chatwoot/chatwoot/graphs/contributors"><img src="https://opencollective.com/chatwoot/contributors.svg?width=890&button=false" /></a>
### Install JS dependencies
``` bash
yarn install
```
### Install ImageMagik
```bash
brew install imagemagick
```
### Setup rails server
```bash
# install ruby dependencies
bundle
# copy config
cp shared/config/database.yml config/database.yml
cp shared/config/application.yml config/application.yml
# copy frontend env file
cp .env.sample .env
# run db migrations
bundle exec rake db:create
bundle exec rake db:reset
# fireup the server
foreman start -f Procfile.dev
```
### Login with credentials
```bash
http://localhost:3000
user name: larry@google.com
password: 123456
```
*Chatwoot* &copy; 2017-2019, ThoughtWoot Inc - Released under the MIT License.
[www.chatwoot.com](https://www.chatwoot.com)
&nbsp;&middot;&nbsp;
GitHub: [@chatwoot](https://github.com/chatwoot)
&nbsp;&middot;&nbsp;
Email: [hello@chatwoot.com](mailto:hello@chatwoot.com)
*Chatwoot* &copy; 2017-2020, ThoughtWoot Inc - Released under the MIT License.
+1
View File
@@ -0,0 +1 @@
module.exports = '';
+63
View File
@@ -0,0 +1,63 @@
{
"name": "Chatwoot",
"description": "Chatwoot is a customer support tool for instant messaging channels",
"website": "https://www.chatwoot.com/",
"repository": "https://github.com/chatwoot/chatwoot",
"logo": "https://app.chatwoot.com/brand-assets/logo_thumbnail.svg",
"keywords": [
"live chat",
"customer support",
"ruby",
"rails",
"vue"
],
"success_url": "/app/login",
"env": {
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
"generator": "secret"
},
"RACK_ENV": {
"description": "Environment for rack middleware.",
"value": "production"
},
"RAILS_ENV": {
"description": "Environment for rails middleware.",
"value": "production"
},
"FRONTEND_URL": {
"description": "Public root URL of the Chatwoot installation. This will be used in the emails.",
"value": "https://CHANGE.herokuapp.com"
}
},
"formation": {
"web": {
"quantity": 1,
"size": "FREE"
}
},
"image": "heroku/ruby",
"addons": [
{
"plan": "heroku-redis"
},
{
"plan": "heroku-postgresql",
"options": {
"version": "9.5"
}
}
],
"buildpacks": [
{
"url": "heroku/ruby"
}
],
"environments": {
"test": {
"scripts": {
"test": "bundle exec rake test"
}
}
}
}
+47
View File
@@ -0,0 +1,47 @@
class ContactIdentifyAction
pattr_initialize [:contact!, :params!]
def perform
ActiveRecord::Base.transaction do
@contact = merge_contact(existing_identified_contact, @contact) if merge_contacts?(existing_identified_contact, @contact)
@contact = merge_contact(existing_email_contact, @contact) if merge_contacts?(existing_email_contact, @contact)
update_contact
end
@contact
end
private
def account
@account ||= @contact.account
end
def existing_identified_contact
return if params[:identifier].blank?
@existing_identified_contact ||= Contact.where(account_id: account.id).find_by(identifier: params[:identifier])
end
def existing_email_contact
return if params[:email].blank?
@existing_email_contact ||= Contact.where(account_id: account.id).find_by(email: params[:email])
end
def merge_contacts?(existing_contact, _contact)
existing_contact && existing_contact.id != @contact.id
end
def update_contact
@contact.update!(params.slice(:name, :email, :identifier))
ContactAvatarJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
end
def merge_contact(base_contact, merge_contact)
ContactMergeAction.new(
account: account,
base_contact: base_contact,
mergee_contact: merge_contact
).perform
end
end
+42
View File
@@ -0,0 +1,42 @@
class ContactMergeAction
pattr_initialize [:account!, :base_contact!, :mergee_contact!]
def perform
ActiveRecord::Base.transaction do
validate_contacts
merge_conversations
merge_messages
merge_contact_inboxes
remove_mergee_contact
end
@base_contact
end
private
def validate_contacts
return if belongs_to_account?(@base_contact) && belongs_to_account?(@mergee_contact)
raise StandardError, 'contact does not belong to the account'
end
def belongs_to_account?(contact)
@account.id == contact.account_id
end
def merge_conversations
Conversation.where(contact_id: @mergee_contact.id).update(contact_id: @base_contact.id)
end
def merge_messages
Message.where(sender: @mergee_contact).update(sender: @base_contact)
end
def merge_contact_inboxes
ContactInbox.where(contact_id: @mergee_contact.id).update(contact_id: @base_contact.id)
end
def remove_mergee_contact
@mergee_contact.destroy!
end
end
+3 -2
View File
@@ -1,3 +1,4 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link administrate/application.css
//= link administrate/application.js
//= link dashboardChart.js
-3
View File
@@ -1,3 +0,0 @@
$( document ).ready(function() {
window.currentAcccountId = $('body').data('account-id');
});
-3
View File
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
-13
View File
@@ -1,13 +0,0 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .
+55
View File
@@ -0,0 +1,55 @@
// eslint-disable-next-line
function prepareData(data) {
var labels = [];
var dataSet = [];
data.forEach(item => {
labels.push(item[0]);
dataSet.push(item[1]);
});
return { labels, dataSet };
}
function getChartOptions() {
var fontFamily =
'Inter,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
return {
responsive: true,
legend: { labels: { fontFamily } },
scales: {
xAxes: [
{
barPercentage: 1.26,
ticks: { fontFamily },
gridLines: { display: false },
},
],
yAxes: [
{
ticks: { fontFamily },
gridLines: { display: false },
},
],
},
};
}
// eslint-disable-next-line
function drawSuperAdminDashboard(data) {
var ctx = document.getElementById('dashboard-chart').getContext('2d');
var chartData = prepareData(data);
// eslint-disable-next-line
new Chart(ctx, {
type: 'bar',
data: {
labels: chartData.labels,
datasets: [
{
label: 'Conversations',
data: chartData.dataSet,
backgroundColor: '#1f93ff',
},
],
},
options: getChartOptions(),
});
}
-3
View File
@@ -1,3 +0,0 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@@ -0,0 +1,32 @@
@charset 'utf-8';
@import 'reset/normalize';
@import 'utilities/variables';
@import 'utilities/text-color';
@import 'selectize';
@import 'datetime_picker';
@import 'library/clearfix';
@import 'library/data-label';
@import 'library/variables';
@import 'base/forms';
@import 'base/layout';
@import 'base/lists';
@import 'base/tables';
@import 'base/typography';
@import 'components/app-container';
@import 'components/attributes';
@import 'components/buttons';
@import 'components/cells';
@import 'components/field-unit';
@import 'components/flashes';
@import 'components/form-actions';
@import 'components/main-content';
@import 'components/navigation';
@import 'components/pagination';
@import 'components/search';
@import 'components/reports';
@@ -0,0 +1,103 @@
fieldset {
background-color: transparent;
border: 0;
margin: 0;
padding: 0;
}
legend {
font-weight: $font-weight-medium;
margin: 0;
padding: 0;
}
label {
display: block;
font-weight: $font-weight-medium;
margin: 0;
}
input,
select {
display: block;
font-family: $base-font-family;
font-size: $base-font-size;
}
input,
select,
textarea {
display: block;
font-family: $base-font-family;
font-size: 16px;
}
[type="color"],
[type="date"],
[type="datetime-local"],
[type="email"],
[type="month"],
[type="number"],
[type="password"],
[type="search"],
[type="tel"],
[type="text"],
[type="time"],
[type="url"],
[type="week"],
input:not([type]),
textarea {
appearance: none;
background-color: $white;
border: $base-border;
border-radius: $base-border-radius;
padding: 0.5em;
transition: border-color $base-duration $base-timing;
width: 100%;
&:hover {
border-color: mix($black, $base-border-color, 20%);
}
&:focus {
border-color: $action-color;
outline: none;
}
&:disabled {
background-color: mix($black, $white, 5%);
cursor: not-allowed;
&:hover {
border: $base-border;
}
}
}
textarea {
resize: vertical;
}
[type="checkbox"],
[type="radio"] {
display: inline;
margin-right: $small-spacing / 2;
}
[type="file"] {
width: 100%;
}
select {
width: 100%;
}
[type="checkbox"],
[type="radio"],
[type="file"],
select {
&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}
}
@@ -0,0 +1,22 @@
html {
background-color: $color-white;
box-sizing: border-box;
font-size: 10px;
-webkit-font-smoothing: antialiased;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
figure {
margin: 0;
}
img,
picture {
margin: 0;
max-width: 100%;
}
@@ -0,0 +1,19 @@
ul,
ol {
list-style-type: none;
margin: 0;
padding: 0;
}
dl {
margin-bottom: $small-spacing;
dt {
font-weight: $font-weight-medium;
margin-top: $small-spacing;
}
dd {
margin: 0;
}
}
@@ -0,0 +1,71 @@
table {
border-collapse: collapse;
font-size: $font-size-default;
text-align: left;
width: 100%;
a {
color: inherit;
text-decoration: none;
}
}
tr {
border-bottom: $base-border;
th {
font-weight: $font-weight-medium;
&.cell-label--avatar-field {
a {
display: none;
}
}
}
}
tbody tr {
&:hover {
background-color: $base-background-color;
cursor: pointer;
}
&:focus {
outline: $focus-outline;
outline-offset: -($focus-outline-width);
}
td {
&.cell-data--avatar-field {
line-height: 1;
text-align: center;
img {
border-radius: 50%;
height: $space-large;
max-height: $space-large;
width: $space-large;
}
}
}
}
td,
th {
padding: $space-slab;
vertical-align: middle;
}
td:first-child,
th:first-child {
padding-left: 0;
}
td:last-child,
th:last-child {
padding-right: 0;
}
td img {
max-height: 2rem;
}
@@ -0,0 +1,44 @@
body {
color: $base-font-color;
font-family: $base-font-family;
font-size: $base-font-size;
line-height: $base-line-height;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: $heading-font-family;
font-size: $base-font-size;
line-height: $heading-line-height;
margin: 0;
}
p {
margin: 0 0 $small-spacing;
}
a {
color: $action-color;
transition: color $base-duration $base-timing;
&:hover {
color: mix($black, $action-color, 25%);
}
&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}
}
hr {
border-bottom: $base-border;
border-left: 0;
border-right: 0;
border-top: 0;
margin: $base-spacing 0;
}
@@ -0,0 +1,8 @@
.app-container {
align-items: stretch;
display: flex;
margin-left: auto;
margin-right: auto;
max-width: 100rem;
min-height: 100vh;
}
@@ -0,0 +1,26 @@
.attribute-label {
@include data-label;
clear: left;
float: left;
margin-bottom: $base-spacing;
margin-top: 0.25em;
text-align: right;
width: calc(15% - 1rem);
}
.preserve-whitespace {
white-space: pre-wrap;
word-wrap: break-word;
}
.attribute-data {
float: left;
margin-bottom: $base-spacing;
margin-left: 2rem;
width: calc(85% - 1rem);
}
.attribute--nested {
border: $base-border;
padding: $small-spacing;
}
@@ -0,0 +1,50 @@
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button {
appearance: none;
background-color: $color-woot;
border: 0;
border-radius: $base-border-radius;
color: $white;
cursor: pointer;
display: inline-block;
font-size: $font-size-default;
-webkit-font-smoothing: antialiased;
font-weight: $font-weight-medium;
line-height: 1;
padding: $space-one $space-two;
text-decoration: none;
transition: background-color $base-duration $base-timing;
user-select: none;
vertical-align: middle;
white-space: nowrap;
&:hover {
background-color: mix($black, $color-woot, 20%);
color: $white;
}
&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}
&:disabled {
cursor: not-allowed;
opacity: 0.5;
&:hover {
background-color: $color-woot;
}
}
}
.button--alt {
background-color: transparent;
border: $base-border;
border-color: $blue;
color: $blue;
margin-bottom: $base-spacing;
}
@@ -0,0 +1,45 @@
.cell-label {
&:hover {
a {
color: $action-color;
}
svg {
fill: $action-color;
transform: rotate(180deg);
}
}
a {
color: inherit;
display: inline-block;
transition: color $base-duration $base-timing;
width: 100%;
}
}
.cell-label--asc,
.cell-label--desc {
font-weight: $font-weight-medium;
}
.cell-label__sort-indicator {
float: right;
margin-left: 5px;
svg {
fill: $hint-grey;
height: 13px;
transition: transform $base-duration $base-timing;
width: 13px;
}
}
.cell-label__sort-indicator--desc {
transform: rotate(180deg);
}
.cell-data--number,
.cell-label--number {
text-align: right;
}
@@ -0,0 +1,54 @@
.field-unit {
@include administrate-clearfix;
align-items: center;
display: flex;
margin-bottom: $base-spacing;
position: relative;
width: 100%;
}
.field-unit__label {
float: left;
margin-left: 1rem;
text-align: right;
width: calc(15% - 1rem);
}
.field-unit__field {
float: left;
margin-left: 2rem;
max-width: 50rem;
width: 100%;
}
.field-unit--nested {
border: $base-border;
margin-left: 7.5%;
max-width: 60rem;
padding: $small-spacing;
width: 100%;
.field-unit__field {
width: 100%;
}
.field-unit__label {
width: 10rem;
}
}
.field-unit--required {
label::after {
color: $red;
content: ' *';
}
}
.attribute-data--avatar-field {
height: $space-larger;
width: $space-larger;
img {
border-radius: 50%;
}
}
@@ -0,0 +1,28 @@
$base-spacing: 1.5em !default;
$flashes: (
"alert": #fff6bf,
"error": #fbe3e4,
"notice": #e5edf8,
"success": #e6efc2,
) !default;
@each $flash-type, $color in $flashes {
.flash-#{$flash-type} {
background-color: $color;
color: mix($black, $color, 60%);
display: block;
margin-bottom: $base-spacing / 2;
padding: $base-spacing / 2;
text-align: center;
a {
color: mix($black, $color, 70%);
text-decoration: underline;
&:focus,
&:hover {
color: mix($black, $color, 90%);
}
}
}
}
@@ -0,0 +1,3 @@
.form-actions {
margin-left: calc(15% + 2rem);
}
@@ -0,0 +1,26 @@
.main-content {
font-size: $font-size-default;
left: 23rem;
position: absolute;
right: 0;
top: 0;
}
.main-content__body {
padding: $space-two;
}
.main-content__header {
align-items: center;
background-color: $color-white;
border-bottom: 1px solid $color-border;
display: flex;
min-height: 5.6rem;
padding: $space-small $space-normal;
}
.main-content__page-title {
font-size: $font-size-large;
font-weight: $font-weight-medium;
margin-right: auto;
}
@@ -0,0 +1,72 @@
.logo-brand {
margin-bottom: $space-normal;
padding: $space-normal $space-smaller;
text-align: center;
}
.navigation {
background: $white;
border-right: 1px solid $color-border;
display: flex;
flex-direction: column;
font-size: $font-size-default;
font-weight: $font-weight-medium;
height: 100%;
justify-content: flex-start;
left: 0;
margin: 0;
overflow: auto;
padding: $space-normal;
position: fixed;
top: 0;
width: 23rem;
z-index: 1023;
li {
align-items: center;
display: flex;
a {
color: $color-gray;
text-decoration: none;
}
i {
min-width: $space-medium;
}
}
}
.navigation__link {
background-color: transparent;
color: $color-gray;
display: block;
line-height: 1;
margin-bottom: $space-smaller;
padding: $space-one;
&:hover {
color: $blue;
a {
color: $blue;
}
}
&.navigation__link--active {
background-color: $color-background;
border-radius: $base-border-radius;
color: $blue;
a {
color: $blue;
}
}
}
.logout {
bottom: $space-normal;
left: $space-normal;
position: fixed;
}
@@ -0,0 +1,19 @@
.pagination {
font-size: $font-size-default;
margin-top: $base-spacing;
padding-left: $base-spacing;
padding-right: $base-spacing;
text-align: center;
.first,
.prev,
.page,
.next,
.last {
margin: $small-spacing;
}
.current {
font-weight: $font-weight-medium;
}
}
@@ -0,0 +1,15 @@
.report--list {
display: flex;
padding: 0 $space-two $space-larger;
}
.report-card {
flex: 1;
font-size: $font-size-small;
text-align: center;
.metric {
font-size: $font-size-bigger;
font-weight: 200;
}
}
@@ -0,0 +1,44 @@
.search {
margin-left: auto;
margin-right: 2rem;
max-width: 44rem;
position: relative;
width: 100%;
}
.search__input {
background: $grey-1;
padding-left: $space-normal * 2.5;
padding-right: $space-normal * 2.5;
}
.search__eyeglass-icon {
fill: $grey-7;
height: $space-normal;
left: $space-normal;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: $space-normal;
}
.search__clear-link {
height: $space-normal;
position: absolute;
right: $space-normal * 0.75;
top: 50%;
transform: translateY(-50%);
width: $space-normal;
}
.search__clear-icon {
fill: $grey-5;
height: $space-normal;
position: absolute;
transition: fill $base-duration $base-timing;
width: $space-normal;
&:hover {
fill: $action-color;
}
}
@@ -0,0 +1,7 @@
@mixin administrate-clearfix {
&::after {
clear: both;
content: '';
display: block;
}
}
@@ -0,0 +1,8 @@
@mixin data-label {
color: $hint-grey;
font-size: 0.8em;
font-weight: 400;
letter-spacing: 0.0357em;
position: relative;
text-transform: uppercase;
}
@@ -0,0 +1,61 @@
// Typography
$base-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif !default;
$heading-font-family: $base-font-family !default;
$base-font-size: 10px !default;
$base-line-height: 1.5 !default;
$heading-line-height: 1.2 !default;
// Other Sizes
$base-border-radius: 4px !default;
$base-spacing: $base-line-height * 1em !default;
$small-spacing: $base-spacing / 2 !default;
// Colors
$white: #fff !default;
$black: #000 !default;
$blue: #1f93ff !default;
$red: #ff382d !default;
$light-yellow: #ffc532 !default;
$light-green: #44ce4b !default;
$grey-0: #f6f7f7 !default;
$grey-1: #f0f4f5 !default;
$grey-2: #cfd8dc !default;
$grey-5: #adb5bd !default;
$grey-7: #293f54 !default;
$hint-grey: #7b808c !default;
// Font Colors
$base-font-color: $grey-7 !default;
$action-color: $blue !default;
// Background Colors
$base-background-color: $grey-0 !default;
// Focus
$focus-outline-color: transparentize($action-color, 0.4);
$focus-outline-width: 3px;
$focus-outline: $focus-outline-width solid $focus-outline-color;
$focus-outline-offset: 1px;
// Flash Colors
$flash-colors: (
alert: $light-yellow,
error: $red,
notice: mix($white, $blue, 50%),
success: $light-green
);
// Border
$base-border-color: $grey-1 !default;
$base-border: 1px solid $base-border-color !default;
// Transitions
$base-duration: 250ms !default;
$base-timing: ease-in-out !default;
@@ -0,0 +1,447 @@
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
*/
html {
line-height: 1.15; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main { /* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: sans-serif; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
*/
details, /* 1 */
menu {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Scripting
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
*/
template {
display: none;
}
/* Hidden
========================================================================== */
/**
* Add the correct display in IE 10-.
*/
[hidden] {
display: none;
}
@@ -0,0 +1,3 @@
.text-color-red {
color: $alert-color;
}
@@ -12,7 +12,7 @@ $font-size-mega: 3.4rem;
$font-size-giga: 4.0rem;
// spaces
$zero: 0rem;
$zero: 0;
$space-micro: 0.2rem;
$space-smaller: 0.4rem;
$space-small: 0.8rem;
@@ -38,31 +38,41 @@ $font-weight-black: 700;
$nav-bar-width: 23rem;
$header-height: 5.6rem;
// Woot Logo
$woot-logo-width: 20rem;
$woot-logo-height: 8rem;
$woot-logo-padding: $space-large $space-large $space-large $space-large;
$woot-logo-padding: $space-large $space-two;
// Colors
$color-woot: #1f93ff;
$color-gray: #6E6F73;
$color-light-gray: #999A9B;
$color-border: #E0E6ED;
$color-gray: #6e6f73;
$color-light-gray: #999a9b;
$color-border: #e0e6ed;
$color-border-light: #f0f4f5;
$color-background: #EFF2F7;
$color-background-light: #F9FAFC;
$color-white: #FFFFFF;
$color-body: #3C4858;
$color-heading: #1F2D3D;
$color-modal-header: #f1f1f1;
$color-background: #f4f6fb;
$color-border-dark: #cad0d4;
$color-background-light: #f9fafc;
$color-white: #fff;
$color-body: #3c4858;
$color-heading: #1f2d3d;
$color-extra-light-blue: #f5f7f9;
$primary-color: $color-woot;
$secondary-color: #35c5ff;
$success-color: #44ce4b;
$warning-color: #ffc532;
$alert-color: #ff382d;
$masked-bg: rgba(0, 0, 0, .4);
// Color-palettes
$color-primary-light: #c7e3ff;
$color-primary-dark: darken($color-woot, 20%);
// Thumbnail
$thumbnail-radius: 4rem;
// chat-header
$conv-header-height: 4rem;
// login
// Inbox List
$inbox-thumb-size: 4.8rem;
@@ -80,3 +90,9 @@ $woot-snackbar-button: #ffeb3b;
$swift-ease-out-duration: .4s !default;
$swift-ease-out-timing-function: cubic-bezier(.25, .8, .25, 1) !default;
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;
// Ionicons
$ionicons-font-path: '~ionicons/fonts';
// Transitions
$transition-ease-in: all 0.250s ease-in;
-3
View File
@@ -1,3 +0,0 @@
// Place all the styles related to the api/base controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/agents controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/canned_responses controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/conversations controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/reports controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/subscriptions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/webhooks controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
// Place all the styles related to the api/v1/widget/messages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
-15
View File
@@ -1,15 +0,0 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
-3
View File
@@ -1,3 +0,0 @@
// Place all the styles related to the Home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
-20
View File
@@ -1,20 +0,0 @@
# app/bot/facebook_bot.rb
require 'facebook/messenger'
include Facebook::Messenger
Bot.on :message do |message|
response = ::Integrations::Facebook::MessageParser.new(message)
::Integrations::Facebook::MessageCreator.new(response).perform
end
Bot.on :delivery do |delivery|
# delivery.ids # => 'mid.1457764197618:41d102a3e1ae206a38'
# delivery.sender # => { 'id' => '1008372609250235' }
# delivery.recipient # => { 'id' => '2015573629214912' }
# delivery.at # => 2016-04-22 21:30:36 +0200
# delivery.seq # => 37
updater = Integrations::Facebook::DeliveryStatus.new(delivery)
updater.perform
puts "Human was online at #{delivery.at}"
end
+22
View File
@@ -0,0 +1,22 @@
require 'facebook/messenger'
class FacebookBot
include Facebook::Messenger
Bot.on :message do |message|
Rails.logger.info "MESSAGE_RECIEVED #{message}"
response = ::Integrations::Facebook::MessageParser.new(message)
::Integrations::Facebook::MessageCreator.new(response).perform
end
Bot.on :delivery do |delivery|
# delivery.ids # => 'mid.1457764197618:41d102a3e1ae206a38'
# delivery.sender # => { 'id' => '1008372609250235' }
# delivery.recipient # => { 'id' => '2015573629214912' }
# delivery.at # => 2016-04-22 21:30:36 +0200
# delivery.seq # => 37
updater = Integrations::Facebook::DeliveryStatus.new(delivery)
updater.perform
Rails.logger.info "Human was online at #{delivery.at}"
end
end
+31 -31
View File
@@ -1,42 +1,36 @@
# frozen_string_literal: true
class AccountBuilder
include CustomExceptions::Account
def initialize(params)
@account_name = params[:account_name]
@email = params[:email]
end
pattr_initialize [:account_name!, :email!, :confirmed!]
def perform
begin
validate_email
validate_user
ActiveRecord::Base.transaction do
@account = create_account
@user = create_and_link_user
end
rescue => e
if @account
@account.destroy
end
puts e.inspect
raise e
validate_email
validate_user
ActiveRecord::Base.transaction do
@account = create_account
@user = create_and_link_user
end
rescue StandardError => e
@account&.destroy
puts e.inspect
raise e
end
private
def validate_email
address = ValidEmail2::Address.new(@email)
if address.valid? #&& !address.disposable?
if address.valid? # && !address.disposable?
true
else
raise InvalidEmail.new({valid: address.valid?})#, disposable: address.disposable?})
raise InvalidEmail.new(valid: address.valid?) # , disposable: address.disposable?})
end
end
def validate_user
if User.exists?(email: @email)
raise UserExists.new({email: @email})
raise UserExists.new(email: @email)
else
true
end
@@ -44,28 +38,34 @@ class AccountBuilder
def create_account
@account = Account.create!(name: @account_name)
Current.account = @account
end
def create_and_link_user
password = Time.now.to_i
@user = @account.users.new({email: @email,
password: password,
password_confirmation: password,
role: User.roles["administrator"],
name: email_to_name(@email)
})
@user = User.new(email: @email,
password: password,
password_confirmation: password,
name: email_to_name(@email))
@user.confirm if @confirmed
if @user.save!
link_user_to_account(@user, @account)
@user
else
raise UserErrors.new({errors: @user.errors})
raise UserErrors.new(errors: @user.errors)
end
end
def link_user_to_account(user, account)
AccountUser.create!(
account_id: account.id,
user_id: user.id,
role: AccountUser.roles['administrator']
)
end
def email_to_name(email)
name = email[/[^@]+/]
name.split(".").map {|n| n.capitalize }.join(" ")
name.split('.').map(&:capitalize).join(' ')
end
end
+46
View File
@@ -0,0 +1,46 @@
class ContactBuilder
pattr_initialize [:source_id!, :inbox!, :contact_attributes!]
def perform
contact_inbox = inbox.contact_inboxes.find_by(source_id: source_id)
return contact_inbox if contact_inbox
build_contact
end
private
def account
@account ||= inbox.account
end
def create_contact_inbox(contact)
::ContactInbox.create!(
contact_id: contact.id,
inbox_id: inbox.id,
source_id: source_id
)
end
def update_contact_avatar(contact)
::ContactAvatarJob.perform_later(contact, contact_attributes[:avatar_url]) if contact_attributes[:avatar_url]
end
def build_contact
ActiveRecord::Base.transaction do
contact = account.contacts.create!(
name: contact_attributes[:name],
phone_number: contact_attributes[:phone_number],
email: contact_attributes[:email],
identifier: contact_attributes[:identifier],
additional_attributes: contact_attributes[:additional_attributes]
)
contact_inbox = create_contact_inbox(contact)
update_contact_avatar(contact)
contact_inbox
rescue StandardError => e
Rails.logger.info e
end
end
end
@@ -1,3 +1,2 @@
class Messages::IncomingMessageBuilder < Messages::MessageBuilder
end
+84 -84
View File
@@ -1,139 +1,139 @@
require 'open-uri'
# This class creates both outgoing messages from chatwoot and echo outgoing messages based on the flag `outgoing_echo`
# Assumptions
# 1. Incase of an outgoing message which is echo, source_id will NOT be nil,
# based on this we are showing "not sent from chatwoot" message in frontend
# Hence there is no need to set user_id in message for outgoing echo messages.
class Messages::MessageBuilder
=begin
This class creates both outgoing messages from chatwoot and echo outgoing messages based on the flag `outgoing_echo`
Assumptions
1. Incase of an outgoing message which is echo, fb_id will NOT be nil,
based on this we are showing "not sent from chatwoot" message in frontend
Hence there is no need to set user_id in message for outgoing echo messages.
=end
attr_reader :response
def initialize response, inbox, outgoing_echo=false
def initialize(response, inbox, outgoing_echo = false)
@response = response
@inbox = inbox
@sender_id = (outgoing_echo ? @response.recipient_id : @response.sender_id)
@message_type = (outgoing_echo ? :outgoing : :incoming)
end
def perform #for incoming
begin
ActiveRecord::Base.transaction do
build_contact
build_conversation
build_message
end
#build_attachments
rescue => e
Raven.capture_exception(e)
#change this asap
return true
def perform
ActiveRecord::Base.transaction do
build_contact
build_message
end
rescue StandardError => e
Raven.capture_exception(e)
true
end
private
def build_attachments
end
def contact
@contact ||= @inbox.contacts.find_by(source_id: @sender_id)
@contact ||= @inbox.contact_inboxes.find_by(source_id: @sender_id)&.contact
end
def build_contact
if contact.nil?
@contact = @inbox.contacts.create!(contact_params)
end
return if contact.present?
@contact = Contact.create!(contact_params.except(:remote_avatar_url))
ContactAvatarJob.perform_later(@contact, contact_params[:remote_avatar_url]) if contact_params[:remote_avatar_url]
@contact_inbox = ContactInbox.create(contact: contact, inbox: @inbox, source_id: @sender_id)
end
def build_message
@message = @conversation.messages.new(message_params)
@message = conversation.messages.create!(message_params)
(response.attachments || []).each do |attachment|
@message.build_attachment(attachment_params(attachment))
attachment_obj = @message.attachments.new(attachment_params(attachment).except(:remote_file_url))
attachment_obj.save!
attach_file(attachment_obj, attachment_params(attachment)[:remote_file_url]) if attachment_params(attachment)[:remote_file_url]
end
@message.save!
end
def attach_file(attachment, file_url)
file_resource = LocalResource.new(file_url)
attachment.file.attach(io: file_resource.file, filename: file_resource.tmp_filename, content_type: file_resource.encoding)
end
def conversation
@conversation ||= Conversation.find_by(conversation_params) || build_conversation
end
def build_conversation
@conversation ||=
if (conversation = Conversation.find_by(conversation_params))
conversation
else
Conversation.create!(conversation_params)
end
@contact_inbox ||= contact.contact_inboxes.find_by!(source_id: @sender_id)
Conversation.create!(conversation_params.merge(
contact_inbox_id: @contact_inbox.id
))
end
def attachment_params(attachment)
file_type = attachment['type'].to_sym
params = {
file_type: file_type,
account_id: @message.account_id
}
params = { file_type: file_type, account_id: @message.account_id }
if [:image, :file, :audio, :video].include? file_type
params.merge!(
{
external_url: attachment['payload']['url'],
remote_file_url: attachment['payload']['url']
})
params.merge!(file_type_params(attachment))
elsif file_type == :location
lat, long = attachment['payload']['coordinates']['lat'], attachment['payload']['coordinates']['long']
params.merge!(
{
external_url: attachment['url'],
coordinates_lat: lat,
coordinates_long: long,
fallback_title: attachment['title']
})
params.merge!(location_params(attachment))
elsif file_type == :fallback
params.merge!(
{
fallback_title: attachment['title'],
external_url: attachment['url']
})
params.merge!(fallback_params(attachment))
end
params
end
def file_type_params(attachment)
{
external_url: attachment['payload']['url'],
remote_file_url: attachment['payload']['url']
}
end
def location_params(attachment)
lat = attachment['payload']['coordinates']['lat']
long = attachment['payload']['coordinates']['long']
{
external_url: attachment['url'],
coordinates_lat: lat,
coordinates_long: long,
fallback_title: attachment['title']
}
end
def fallback_params(attachment)
{
fallback_title: attachment['title'],
external_url: attachment['url']
}
end
def conversation_params
{
account_id: @inbox.account_id,
inbox_id: @inbox.id,
sender_id: contact.id
contact_id: contact.id
}
end
def message_params
{
account_id: @conversation.account_id,
inbox_id: @conversation.inbox_id,
account_id: conversation.account_id,
inbox_id: conversation.inbox_id,
message_type: @message_type,
content: response.content,
fb_id: response.identifier
source_id: response.identifier,
sender: contact
}
end
def contact_params
if @inbox.facebook?
k = Koala::Facebook::API.new(@inbox.channel.page_access_token)
begin
result = k.get_object(@sender_id)
rescue => e
result = {}
Raven.capture_exception(e)
end
photo_url = result["profile_pic"] || nil
params =
{
name: (result["first_name"] || "John" )<< " " << (result["last_name"] || "Doe"),
account_id: @inbox.account_id,
source_id: @sender_id,
remote_avatar_url: photo_url
}
begin
k = Koala::Facebook::API.new(@inbox.channel.page_access_token) if @inbox.facebook?
result = k.get_object(@sender_id) || {}
rescue Exception => e
result = {}
Raven.capture_exception(e)
end
{
name: "#{result['first_name'] || 'John'} #{result['last_name'] || 'Doe'}",
account_id: @inbox.account_id,
remote_avatar_url: result['profile_pic'] || ''
}
end
end
@@ -1,3 +1,2 @@
class Messages::Outgoing::EchoBuilder < ::Messages::MessageBuilder
end
@@ -1,16 +1,31 @@
class Messages::Outgoing::NormalBuilder
include ::FileTypeHelper
attr_reader :message
def initialize user, conversation, params
@content = params[:message]
@private = ["1","true",1].include? params[:private]
def initialize(user, conversation, params)
@content = params[:content]
@private = params[:private] || false
@conversation = conversation
@user = user
@fb_id = params[:fb_id]
@content_type = params[:content_type]
@items = params.to_unsafe_h&.dig(:content_attributes, :items)
@attachments = params[:attachments]
end
def perform
@message = @conversation.messages.create!(message_params)
@message = @conversation.messages.build(message_params)
if @attachments.present?
@attachments.each do |uploaded_attachment|
attachment = @message.attachments.new(
account_id: @message.account_id,
file_type: file_type(uploaded_attachment&.content_type)
)
attachment.file.attach(uploaded_attachment)
end
end
@message.save
@message
end
private
@@ -22,8 +37,10 @@ class Messages::Outgoing::NormalBuilder
message_type: :outgoing,
content: @content,
private: @private,
user_id: @user.id,
fb_id: @fb_id
sender: @user,
source_id: @fb_id,
content_type: @content_type,
items: @items
}
end
end
+32
View File
@@ -0,0 +1,32 @@
class NotificationBuilder
pattr_initialize [:notification_type!, :user!, :account!, :primary_actor!]
def perform
return unless user_subscribed_to_notification?
build_notification
end
private
def secondary_actor
Current.user
end
def user_subscribed_to_notification?
notification_setting = user.notification_settings.find_by(account_id: account.id)
return true if notification_setting.public_send("email_#{notification_type}?")
return true if notification_setting.public_send("push_#{notification_type}?")
false
end
def build_notification
user.notifications.create!(
notification_type: notification_type,
account: account,
primary_actor: primary_actor,
secondary_actor: secondary_actor
)
end
end
@@ -0,0 +1,30 @@
class NotificationSubscriptionBuilder
pattr_initialize [:params, :user!]
def perform
# if multiple accounts were used to login in same browser
move_subscription_to_user if identifier_subscription && identifier_subscription.user_id != user.id
build_identifier_subscription if identifier_subscription.blank?
identifier_subscription
end
private
def identifier
@identifier ||= params[:subscription_attributes][:endpoint] if params[:subscription_type] == 'browser_push'
@identifier ||= params[:subscription_attributes][:device_id] if params[:subscription_type] == 'fcm'
@identifier
end
def identifier_subscription
@identifier_subscription ||= NotificationSubscription.find_by(identifier: identifier)
end
def move_subscription_to_user
@identifier_subscription.update(user_id: user.id)
end
def build_identifier_subscription
user.notification_subscriptions.create(params.merge(identifier: identifier))
end
end
-68
View File
@@ -1,68 +0,0 @@
class ReportBuilder
include CustomExceptions::Report
# Usage
# rb = ReportBuilder.new a, { metric: 'conversations_count', type: :account, id: 1}
# rb = ReportBuilder.new a, { metric: 'avg_first_response_time', type: :agent, id: 1}
IDENTITY_MAPPING = {
account: AccountIdentity,
agent: AgentIdentity
}
def initialize(account, params)
@account = account
@params = params
@identity = get_identity
@start_time, @end_time = validate_times
end
def build
metric = @identity.send(@params[:metric])
if metric.get.nil?
metric.delete
result = {}
else
result = metric.get_padded_range(@start_time, @end_time) || {}
end
formatted_hash(result)
end
private
def get_identity
identity_class = IDENTITY_MAPPING[@params[:type]]
raise InvalidIdentity if identity_class.nil?
@params[:id] = @account.id if identity_class == AccountIdentity
identity_id = @params[:id]
raise IdentityNotFound if identity_id.nil?
tags = identity_class == AccountIdentity ? nil : { account_id: @account.id}
identity = identity_class.new(identity_id, tags: tags)
raise MetricNotFound if @params[:metric].blank?
raise MetricNotFound unless identity.respond_to?(@params[:metric])
identity
end
def validate_times
start_time = @params[:since] || Time.now.end_of_day - 30.days
end_time = @params[:until] || Time.now.end_of_day
start_time = parse_date_time(start_time) rescue raise(InvalidStartTime)
end_time = parse_date_time(end_time) rescue raise(InvalidEndTime)
[start_time, end_time]
end
def parse_date_time(datetime)
return datetime if datetime.is_a?(DateTime)
return datetime.to_datetime if datetime.is_a?(Time) or datetime.is_a?(Date)
DateTime.strptime(datetime,'%s')
end
def formatted_hash(hash)
hash.inject([]) do |arr,p|
arr << {value: p[1], timestamp: p[0]}
arr
end
end
end
+111
View File
@@ -0,0 +1,111 @@
class V2::ReportBuilder
attr_reader :account, :params
def initialize(account, params)
@account = account
@params = params
end
def timeseries
send(params[:metric])
end
# For backward compatible with old report
def build
timeseries.each_with_object([]) do |p, arr|
arr << { value: p[1], timestamp: p[0].to_time.to_i }
end
end
def summary
{
conversations_count: conversations_count.values.sum,
incoming_messages_count: incoming_messages_count.values.sum,
outgoing_messages_count: outgoing_messages_count.values.sum,
avg_first_response_time: avg_first_response_time_summary,
avg_resolution_time: avg_resolution_time_summary,
resolutions_count: resolutions_count.values.sum
}
end
private
def scope
return account if params[:type].match?('account')
return inbox if params[:type].match?('inbox')
return user if params[:type].match?('agent')
end
def inbox
@inbox ||= account.inboxes.where(id: params[:id]).first
end
def user
@user ||= account.users.where(id: params[:id]).first
end
def conversations_count
scope.conversations
.group_by_day(:created_at, range: range, default_value: 0)
.count
end
# unscoped removes all scopes added to a model previously
def incoming_messages_count
scope.messages.unscoped.where(account_id: account.id).incoming
.group_by_day(:created_at, range: range, default_value: 0)
.count
end
def outgoing_messages_count
scope.messages.unscoped.where(account_id: account.id).outgoing
.group_by_day(:created_at, range: range, default_value: 0)
.count
end
def resolutions_count
scope.conversations
.resolved
.group_by_day(:created_at, range: range, default_value: 0)
.count
end
def avg_first_response_time
scope.events
.where(name: 'first_response')
.group_by_day(:created_at, range: range, default_value: 0)
.average(:value)
end
def avg_resolution_time
scope.events.where(name: 'conversation_resolved')
.group_by_day(:created_at, range: range, default_value: 0)
.average(:value)
end
def range
parse_date_time(params[:since])..parse_date_time(params[:until])
end
# Taking average of average is not too accurate
# https://en.wikipedia.org/wiki/Simpson's_paradox
# TODO: Will optimize this later
def avg_resolution_time_summary
return 0 if avg_resolution_time.values.empty?
(avg_resolution_time.values.sum / avg_resolution_time.values.length)
end
def avg_first_response_time_summary
return 0 if avg_first_response_time.values.empty?
(avg_first_response_time.values.sum / avg_first_response_time.values.length)
end
def parse_date_time(datetime)
return datetime if datetime.is_a?(DateTime)
return datetime.to_datetime if datetime.is_a?(Time) || datetime.is_a?(Date)
DateTime.strptime(datetime, '%s')
end
end
@@ -0,0 +1,2 @@
class ApplicationCable::Channel < ActionCable::Channel::Base
end
@@ -0,0 +1,2 @@
class ApplicationCable::Connection < ActionCable::Connection::Base
end
+47
View File
@@ -0,0 +1,47 @@
class RoomChannel < ApplicationCable::Channel
def subscribed
ensure_stream
current_user
current_account
update_subscription
broadcast_presence
end
def update_presence
update_subscription
broadcast_presence
end
private
def broadcast_presence
data = { account_id: @current_account.id, users: ::OnlineStatusTracker.get_available_users(@current_account.id) }
data[:contacts] = ::OnlineStatusTracker.get_available_contacts(@current_account.id) if @current_user.is_a? User
ActionCable.server.broadcast(@pubsub_token, { event: 'presence.update', data: data })
end
def ensure_stream
@pubsub_token = params[:pubsub_token]
stream_from @pubsub_token
end
def update_subscription
::OnlineStatusTracker.update_presence(@current_account.id, @current_user.class.name, @current_user.id)
end
def current_user
@current_user ||= if params[:user_id].blank?
Contact.find_by!(pubsub_token: @pubsub_token)
else
User.find_by!(pubsub_token: @pubsub_token, id: params[:user_id])
end
end
def current_account
@current_account ||= if @current_user.is_a? Contact
@current_user.account
else
@current_user.accounts.find(params[:account_id])
end
end
end
+6 -7
View File
@@ -1,14 +1,13 @@
class Api::BaseController < ApplicationController
include AccessTokenAuthHelper
respond_to :json
before_action :authenticate_user!
rescue_from StandardError do |exception|
Raven.capture_exception(exception)
render json: { :error => "500 error", message: exception.message }.to_json , :status => 500
end unless Rails.env.development?
before_action :authenticate_access_token!, if: :authenticate_by_access_token?
before_action :validate_bot_access_token!, if: :authenticate_by_access_token?
before_action :authenticate_user!, unless: :authenticate_by_access_token?
private
def set_conversation
@conversation ||= current_account.conversations.find_by(display_id: params[:conversation_id])
def authenticate_by_access_token?
request.headers[:api_access_token].present? || request.headers[:HTTP_API_ACCESS_TOKEN].present?
end
end
@@ -0,0 +1,28 @@
class Api::V1::Accounts::Actions::ContactMergesController < Api::V1::Accounts::BaseController
before_action :set_base_contact, only: [:create]
before_action :set_mergee_contact, only: [:create]
def create
contact_merge_action = ContactMergeAction.new(
account: Current.account,
base_contact: @base_contact,
mergee_contact: @mergee_contact
)
contact_merge_action.perform
render json: @base_contact
end
private
def set_base_contact
@base_contact = contacts.find(params[:base_contact_id])
end
def set_mergee_contact
@mergee_contact = contacts.find(params[:mergee_contact_id])
end
def contacts
@contacts ||= Current.account.contacts
end
end
@@ -0,0 +1,69 @@
class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
before_action :fetch_agent, except: [:create, :index]
before_action :check_authorization
before_action :find_user, only: [:create]
before_action :create_user, only: [:create]
before_action :save_account_user, only: [:create]
def index
@agents = agents
end
def destroy
@agent.current_account_user.destroy
head :ok
end
def update
@agent.update!(agent_params.except(:role))
@agent.current_account_user.update!(role: agent_params[:role]) if agent_params[:role]
render partial: 'api/v1/models/agent.json.jbuilder', locals: { resource: @agent }
end
def create
render partial: 'api/v1/models/agent.json.jbuilder', locals: { resource: @user }
end
private
def check_authorization
authorize(User)
end
def fetch_agent
@agent = agents.find(params[:id])
end
def find_user
@user = User.find_by(email: new_agent_params[:email])
end
def create_user
return if @user
@user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))
end
def save_account_user
AccountUser.create!(
account_id: Current.account.id,
user_id: @user.id,
role: new_agent_params[:role],
inviter_id: current_user.id
)
end
def agent_params
params.require(:agent).permit(:email, :name, :role)
end
def new_agent_params
time = Time.now.to_i
params.require(:agent).permit(:email, :name, :role)
.merge!(password: time, password_confirmation: time, inviter: current_user)
end
def agents
@agents ||= Current.account.users
end
end
@@ -0,0 +1,31 @@
class Api::V1::Accounts::BaseController < Api::BaseController
before_action :current_account
private
def current_account
@current_account ||= ensure_current_account
Current.account = @current_account
end
def ensure_current_account
account = Account.find(params[:account_id])
if current_user
account_accessible_for_user?(account)
elsif @resource&.is_a?(AgentBot)
account_accessible_for_bot?(account)
end
switch_locale account
account
end
def account_accessible_for_user?(account)
@current_account_user = account.account_users.find_by(user_id: current_user.id)
Current.account_user = @current_account_user
render_unauthorized('You are not authorized to access this account') unless @current_account_user
end
def account_accessible_for_bot?(account)
render_unauthorized('You are not authorized to access this account') unless @resource.agent_bot_inboxes.find_by(account_id: account.id)
end
end
@@ -0,0 +1,105 @@
class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
before_action :inbox, only: [:reauthorize_page]
def register_facebook_page
user_access_token = params[:user_access_token]
page_access_token = params[:page_access_token]
page_id = params[:page_id]
inbox_name = params[:inbox_name]
ActiveRecord::Base.transaction do
facebook_channel = Current.account.facebook_pages.create!(
page_id: page_id, user_access_token: user_access_token,
page_access_token: page_access_token
)
@facebook_inbox = Current.account.inboxes.create!(name: inbox_name, channel: facebook_channel)
set_avatar(@facebook_inbox, page_id)
rescue StandardError => e
Rails.logger.info e
end
end
def facebook_pages
@page_details = mark_already_existing_facebook_pages(fb_object.get_connections('me', 'accounts'))
end
# get params[:inbox_id], current_account. params[:omniauth_token]
def reauthorize_page
if @inbox&.facebook?
fb_page_id = @inbox.channel.page_id
page_details = fb_object.get_connections('me', 'accounts')
if (page_detail = (page_details || []).detect { |page| fb_page_id == page['id'] })
update_fb_page(fb_page_id, page_detail['access_token'])
return head :ok
end
end
head :unprocessable_entity
end
private
def inbox
@inbox = Current.account.inboxes.find_by(id: params[:inbox_id])
end
def update_fb_page(fb_page_id, access_token)
get_fb_page(fb_page_id)&.update!(
user_access_token: @user_access_token, page_access_token: access_token
)
end
def get_fb_page(fb_page_id)
Current.account.facebook_pages.find_by(page_id: fb_page_id)
end
def fb_object
@user_access_token = long_lived_token(params[:omniauth_token])
Koala::Facebook::API.new(@user_access_token)
end
def long_lived_token(omniauth_token)
koala = Koala::Facebook::OAuth.new(ENV['FB_APP_ID'], ENV['FB_APP_SECRET'])
koala.exchange_access_token_info(omniauth_token)['access_token']
rescue StandardError => e
Rails.logger.info e
end
def mark_already_existing_facebook_pages(data)
return [] if data.empty?
data.inject([]) do |result, page_detail|
page_detail[:exists] = Current.account.facebook_pages.exists?(page_id: page_detail['id']) ? true : false
result << page_detail
end
end
def set_avatar(facebook_inbox, page_id)
uri = get_avatar_url(page_id)
return unless uri
avatar_resource = LocalResource.new(uri)
facebook_inbox.avatar.attach(io: avatar_resource.file, filename: avatar_resource.tmp_filename, content_type: avatar_resource.encoding)
end
def get_avatar_url(page_id)
begin
url = 'http://graph.facebook.com/' << page_id << '/picture?type=large'
uri = URI.parse(url)
tries = 3
begin
response = uri.open(redirect: false)
rescue OpenURI::HTTPRedirect => e
uri = e.uri # assigned from the "Location" response header
retry if (tries -= 1).positive?
raise
end
pic_url = response.base_uri.to_s
rescue StandardError => e
Rails.logger.debug "Rescued: #{e.inspect}"
pic_url = nil
end
pic_url
end
end

Some files were not shown because too many files have changed in this diff Show More