mno-enterprise-core 3.0.7 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/mno_enterprise/login-background.jpg +0 -0
  3. data/app/assets/stylesheets/mno_enterprise/mail.css +27 -0
  4. data/app/helpers/mno_enterprise/application_helper.rb +14 -0
  5. data/app/helpers/mno_enterprise/impersonate_helper.rb +1 -1
  6. data/app/models/mno_enterprise/app.rb +2 -1
  7. data/app/models/mno_enterprise/base_resource.rb +1 -2
  8. data/app/models/mno_enterprise/impac/dashboard.rb +3 -1
  9. data/app/models/mno_enterprise/impac/kpi.rb +1 -1
  10. data/app/models/mno_enterprise/impac/widget.rb +1 -1
  11. data/app/models/mno_enterprise/org_invite.rb +2 -1
  12. data/app/models/mno_enterprise/tenant.rb +2 -4
  13. data/app/models/mno_enterprise/user.rb +6 -0
  14. data/app/pdf/mno_enterprise/invoice_pdf.rb +29 -12
  15. data/app/views/system_notifications/confirmation-instructions.html.erb +26 -0
  16. data/app/views/system_notifications/confirmation-instructions.text.erb +10 -0
  17. data/app/views/system_notifications/delete-request-instructions.html.erb +31 -0
  18. data/app/views/system_notifications/delete-request-instructions.text.erb +15 -0
  19. data/app/views/system_notifications/organization-invite-existing-user.html.erb +30 -0
  20. data/app/views/system_notifications/organization-invite-existing-user.text.erb +13 -0
  21. data/app/views/system_notifications/organization-invite-new-user.html.erb +30 -0
  22. data/app/views/system_notifications/organization-invite-new-user.text.erb +14 -0
  23. data/app/views/system_notifications/reconfirmation-instructions.html.erb +27 -0
  24. data/app/views/system_notifications/reconfirmation-instructions.text.erb +10 -0
  25. data/app/views/system_notifications/registration-instructions.html.erb +27 -0
  26. data/app/views/system_notifications/registration-instructions.text.erb +9 -0
  27. data/app/views/system_notifications/reset-password-instructions.html.erb +27 -0
  28. data/app/views/system_notifications/reset-password-instructions.text.erb +11 -0
  29. data/app/views/system_notifications/unlock-instructions.html.erb +27 -0
  30. data/app/views/system_notifications/unlock-instructions.text.erb +10 -0
  31. data/config/initializers/audit_log.rb +2 -0
  32. data/config/locales/templates/dashboard/organization/en.yml +2 -0
  33. data/config/locales/views/auth/registrations/en.yml +1 -1
  34. data/lib/devise/hooks/impersonatable.rb +14 -0
  35. data/lib/devise_extension.rb +9 -2
  36. data/lib/generators/mno_enterprise/install/templates/config/application.yml +6 -2
  37. data/lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb +6 -1
  38. data/lib/generators/mno_enterprise/install/templates/config/settings.yml +2 -0
  39. data/lib/generators/mno_enterprise/install/templates/config/settings/uat.yml +2 -2
  40. data/lib/generators/mno_enterprise/install/templates/stylesheets/main.less +4 -0
  41. data/lib/her_extension/model/relation.rb +0 -13
  42. data/lib/mandrill_client.rb +13 -41
  43. data/lib/mno_enterprise/concerns/models/ability.rb +12 -0
  44. data/lib/mno_enterprise/concerns/models/organization.rb +5 -2
  45. data/lib/mno_enterprise/core.rb +21 -8
  46. data/lib/mno_enterprise/mail_adapters/adapter.rb +51 -0
  47. data/lib/mno_enterprise/mail_adapters/mandrill_adapter.rb +39 -0
  48. data/lib/mno_enterprise/mail_adapters/smtp_adapter.rb +21 -0
  49. data/lib/mno_enterprise/mail_adapters/sparkpost_adapter.rb +56 -0
  50. data/lib/mno_enterprise/mail_adapters/test_adapter.rb +21 -0
  51. data/lib/mno_enterprise/mail_client.rb +28 -0
  52. data/lib/mno_enterprise/smtp_client.rb +32 -0
  53. data/lib/mno_enterprise/testing_support/factories/apps.rb +1 -2
  54. data/lib/mno_enterprise/testing_support/factories/impac/kpis.rb +1 -0
  55. data/lib/mno_enterprise/testing_support/factories/tenant.rb +1 -7
  56. data/lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb +1 -2
  57. data/lib/mno_enterprise/version.rb +1 -1
  58. data/spec/lib/her_extension/model/relation_spec.rb +0 -71
  59. data/spec/lib/mandrill_client_spec.rb +27 -42
  60. data/spec/lib/mno_enterprise/mail_adapters/adapter_spec.rb +29 -0
  61. data/spec/lib/mno_enterprise/mail_adapters/mandrill_adapter_spec.rb +53 -0
  62. data/spec/lib/mno_enterprise/mail_adapters/smtp_adapter_spec.rb +29 -0
  63. data/spec/lib/mno_enterprise/mail_adapters/sparkpost_adapter_spec.rb +60 -0
  64. data/spec/lib/mno_enterprise/mail_client_spec.rb +9 -0
  65. data/spec/lib/mno_enterprise/smtp_client_spec.rb +39 -0
  66. data/spec/models/mno_enterprise/ability_spec.rb +21 -0
  67. data/spec/models/mno_enterprise/base_resource_spec.rb +0 -22
  68. metadata +76 -24
  69. data/lib/her_extension/middleware/mnoe_raise_error.rb +0 -21
  70. data/lib/her_extension/model/associations/belongs_to_association.rb +0 -25
@@ -1,21 +0,0 @@
1
- module Her
2
- module Middleware
3
- # This middleware will raise errors based on the response status
4
- # Same as Faraday::Response::RaiseError, except it will catch specific
5
- # errors codes rather than everything in 400..600
6
- class MnoeRaiseError < Faraday::Response::RaiseError
7
- def on_complete(env)
8
- case env[:status]
9
- when 407
10
- # mimic the behavior that we get with proxy requests with HTTPS
11
- raise Faraday::Error::ConnectionFailed,
12
- %(407 "Proxy Authentication Required ")
13
- when 502..504
14
- raise Faraday::Error::ConnectionFailed, response_values(env)
15
- when 401, 500
16
- raise Faraday::Error::ClientError, response_values(env)
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,25 +0,0 @@
1
- # Backport https://github.com/remiprev/her/pull/343/files
2
- # Fix belongs_to when foreign key is nil
3
- module Her
4
- module Model
5
- module Associations
6
- class BelongsToAssociation < Association
7
- # @private
8
- def fetch
9
- foreign_key_value = @parent.attributes[@opts[:foreign_key].to_sym]
10
- data_key_value = @parent.attributes[@opts[:data_key].to_sym]
11
- return @opts[:default].try(:dup) if (@parent.attributes.include?(@name) && @parent.attributes[@name].nil? && @params.empty?) || (foreign_key_value.blank? && data_key_value.blank?)
12
-
13
- return @cached_result unless @params.any? || @cached_result.nil?
14
- return @parent.attributes[@name] unless @params.any? || @parent.attributes[@name].blank?
15
-
16
- path_params = @parent.attributes.merge(@params.merge(@klass.primary_key => foreign_key_value))
17
- path = build_association_path lambda { @klass.build_request_path(path_params) }
18
- @klass.get(path, @params).tap do |result|
19
- @cached_result = result if @params.blank?
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end