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.
- checksums.yaml +4 -4
- data/app/assets/images/mno_enterprise/login-background.jpg +0 -0
- data/app/assets/stylesheets/mno_enterprise/mail.css +27 -0
- data/app/helpers/mno_enterprise/application_helper.rb +14 -0
- data/app/helpers/mno_enterprise/impersonate_helper.rb +1 -1
- data/app/models/mno_enterprise/app.rb +2 -1
- data/app/models/mno_enterprise/base_resource.rb +1 -2
- data/app/models/mno_enterprise/impac/dashboard.rb +3 -1
- data/app/models/mno_enterprise/impac/kpi.rb +1 -1
- data/app/models/mno_enterprise/impac/widget.rb +1 -1
- data/app/models/mno_enterprise/org_invite.rb +2 -1
- data/app/models/mno_enterprise/tenant.rb +2 -4
- data/app/models/mno_enterprise/user.rb +6 -0
- data/app/pdf/mno_enterprise/invoice_pdf.rb +29 -12
- data/app/views/system_notifications/confirmation-instructions.html.erb +26 -0
- data/app/views/system_notifications/confirmation-instructions.text.erb +10 -0
- data/app/views/system_notifications/delete-request-instructions.html.erb +31 -0
- data/app/views/system_notifications/delete-request-instructions.text.erb +15 -0
- data/app/views/system_notifications/organization-invite-existing-user.html.erb +30 -0
- data/app/views/system_notifications/organization-invite-existing-user.text.erb +13 -0
- data/app/views/system_notifications/organization-invite-new-user.html.erb +30 -0
- data/app/views/system_notifications/organization-invite-new-user.text.erb +14 -0
- data/app/views/system_notifications/reconfirmation-instructions.html.erb +27 -0
- data/app/views/system_notifications/reconfirmation-instructions.text.erb +10 -0
- data/app/views/system_notifications/registration-instructions.html.erb +27 -0
- data/app/views/system_notifications/registration-instructions.text.erb +9 -0
- data/app/views/system_notifications/reset-password-instructions.html.erb +27 -0
- data/app/views/system_notifications/reset-password-instructions.text.erb +11 -0
- data/app/views/system_notifications/unlock-instructions.html.erb +27 -0
- data/app/views/system_notifications/unlock-instructions.text.erb +10 -0
- data/config/initializers/audit_log.rb +2 -0
- data/config/locales/templates/dashboard/organization/en.yml +2 -0
- data/config/locales/views/auth/registrations/en.yml +1 -1
- data/lib/devise/hooks/impersonatable.rb +14 -0
- data/lib/devise_extension.rb +9 -2
- data/lib/generators/mno_enterprise/install/templates/config/application.yml +6 -2
- data/lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb +6 -1
- data/lib/generators/mno_enterprise/install/templates/config/settings.yml +2 -0
- data/lib/generators/mno_enterprise/install/templates/config/settings/uat.yml +2 -2
- data/lib/generators/mno_enterprise/install/templates/stylesheets/main.less +4 -0
- data/lib/her_extension/model/relation.rb +0 -13
- data/lib/mandrill_client.rb +13 -41
- data/lib/mno_enterprise/concerns/models/ability.rb +12 -0
- data/lib/mno_enterprise/concerns/models/organization.rb +5 -2
- data/lib/mno_enterprise/core.rb +21 -8
- data/lib/mno_enterprise/mail_adapters/adapter.rb +51 -0
- data/lib/mno_enterprise/mail_adapters/mandrill_adapter.rb +39 -0
- data/lib/mno_enterprise/mail_adapters/smtp_adapter.rb +21 -0
- data/lib/mno_enterprise/mail_adapters/sparkpost_adapter.rb +56 -0
- data/lib/mno_enterprise/mail_adapters/test_adapter.rb +21 -0
- data/lib/mno_enterprise/mail_client.rb +28 -0
- data/lib/mno_enterprise/smtp_client.rb +32 -0
- data/lib/mno_enterprise/testing_support/factories/apps.rb +1 -2
- data/lib/mno_enterprise/testing_support/factories/impac/kpis.rb +1 -0
- data/lib/mno_enterprise/testing_support/factories/tenant.rb +1 -7
- data/lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb +1 -2
- data/lib/mno_enterprise/version.rb +1 -1
- data/spec/lib/her_extension/model/relation_spec.rb +0 -71
- data/spec/lib/mandrill_client_spec.rb +27 -42
- data/spec/lib/mno_enterprise/mail_adapters/adapter_spec.rb +29 -0
- data/spec/lib/mno_enterprise/mail_adapters/mandrill_adapter_spec.rb +53 -0
- data/spec/lib/mno_enterprise/mail_adapters/smtp_adapter_spec.rb +29 -0
- data/spec/lib/mno_enterprise/mail_adapters/sparkpost_adapter_spec.rb +60 -0
- data/spec/lib/mno_enterprise/mail_client_spec.rb +9 -0
- data/spec/lib/mno_enterprise/smtp_client_spec.rb +39 -0
- data/spec/models/mno_enterprise/ability_spec.rb +21 -0
- data/spec/models/mno_enterprise/base_resource_spec.rb +0 -22
- metadata +76 -24
- data/lib/her_extension/middleware/mnoe_raise_error.rb +0 -21
- 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
|