mno-enterprise-core 2.0.9 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/mno_enterprise/application_controller.rb +10 -20
- data/app/models/mno_enterprise/base_resource.rb +1 -2
- data/app/models/mno_enterprise/impac/dashboard.rb +24 -22
- 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/user.rb +2 -1
- data/config/initializers/audit_log.rb +2 -0
- data/config/initializers/config.rb +3 -0
- data/config/locales/models/app/en.yml +25 -0
- data/config/locales/models/app/id.yml +25 -0
- data/config/locales/models/app/zh.yml +25 -0
- data/config/locales/models/app_instance/en.yml +24 -0
- data/config/locales/models/app_instance/id.yml +24 -0
- data/config/locales/models/app_instance/zh.yml +24 -0
- data/config/locales/models/credit_card/en.yml +23 -0
- data/config/locales/models/credit_card/id.yml +23 -0
- data/config/locales/models/credit_card/zh.yml +23 -0
- data/config/locales/models/deletion_request/en.yml +9 -0
- data/config/locales/models/deletion_request/id.yml +9 -0
- data/config/locales/models/deletion_request/zh.yml +9 -0
- data/config/locales/models/impac/dashboard/en.yml +13 -0
- data/config/locales/models/impac/dashboard/id.yml +13 -0
- data/config/locales/models/impac/dashboard/zh.yml +13 -0
- data/config/locales/models/impac/widget/en.yml +13 -0
- data/config/locales/models/impac/widget/id.yml +13 -0
- data/config/locales/models/impac/widget/zh.yml +13 -0
- data/config/locales/models/invoice/en.yml +9 -0
- data/config/locales/models/invoice/id.yml +9 -0
- data/config/locales/models/invoice/zh.yml +9 -0
- data/config/locales/models/org_invite/en.yml +9 -0
- data/config/locales/models/org_invite/id.yml +9 -0
- data/config/locales/models/org_invite/zh.yml +9 -0
- data/config/locales/models/org_team/en.yml +9 -0
- data/config/locales/models/org_team/id.yml +9 -0
- data/config/locales/models/org_team/zh.yml +9 -0
- data/config/locales/models/organization/en.yml +24 -0
- data/config/locales/models/organization/id.yml +24 -0
- data/config/locales/models/organization/zh.yml +24 -0
- data/config/locales/models/user/en.yml +45 -0
- data/config/locales/models/user/id.yml +45 -0
- data/config/locales/models/user/zh.yml +44 -0
- data/config/locales/templates/components/en.yml +21 -0
- data/config/locales/templates/components/id.yml +21 -0
- data/config/locales/templates/components/zh.yml +21 -0
- data/config/locales/templates/dashboard/en.yml +60 -0
- data/config/locales/templates/dashboard/id.yml +50 -0
- data/config/locales/templates/dashboard/marketplace/en.yml +16 -0
- data/config/locales/templates/dashboard/marketplace/id.yml +14 -0
- data/config/locales/templates/dashboard/marketplace/zh.yml +14 -0
- data/config/locales/templates/dashboard/organization/en.yml +107 -0
- data/config/locales/templates/dashboard/organization/id.yml +103 -0
- data/config/locales/templates/dashboard/organization/zh.yml +103 -0
- data/config/locales/templates/dashboard/teams/en.yml +48 -0
- data/config/locales/templates/dashboard/teams/id.yml +43 -0
- data/config/locales/templates/dashboard/teams/zh.yml +43 -0
- data/config/locales/templates/dashboard/zh.yml +54 -0
- data/config/locales/templates/impac/en.yml +24 -0
- data/config/locales/templates/impac/id.yml +24 -0
- data/config/locales/templates/impac/modals/en.yml +31 -0
- data/config/locales/templates/impac/modals/id.yml +29 -0
- data/config/locales/templates/impac/modals/zh.yml +28 -0
- data/config/locales/templates/impac/widgets/common/en.yml +9 -0
- data/config/locales/templates/impac/widgets/common/id.yml +9 -0
- data/config/locales/templates/impac/widgets/common/zh.yml +9 -0
- data/config/locales/templates/impac/widgets/en.yml +66 -0
- data/config/locales/templates/impac/widgets/id.yml +58 -0
- data/config/locales/templates/impac/widgets/settings/en.yml +23 -0
- data/config/locales/templates/impac/widgets/settings/id.yml +19 -0
- data/config/locales/templates/impac/widgets/settings/zh.yml +19 -0
- data/config/locales/templates/impac/widgets/zh.yml +58 -0
- data/config/locales/templates/impac/zh.yml +24 -0
- data/config/locales/templates/modals/en.yml +9 -0
- data/config/locales/templates/modals/id.yml +9 -0
- data/config/locales/templates/modals/zh.yml +9 -0
- data/config/locales/views/auth/confirmations/en.yml +17 -0
- data/config/locales/views/auth/confirmations/id.yml +17 -0
- data/config/locales/views/auth/confirmations/zh.yml +17 -0
- data/config/locales/views/auth/passwords/en.yml +10 -0
- data/config/locales/views/auth/passwords/id.yml +10 -0
- data/config/locales/views/auth/passwords/zh.yml +10 -0
- data/config/locales/views/auth/registrations/en.yml +9 -0
- data/config/locales/views/auth/registrations/id.yml +9 -0
- data/config/locales/views/auth/registrations/zh.yml +8 -0
- data/config/locales/views/auth/sessions/en.yml +7 -0
- data/config/locales/views/auth/sessions/id.yml +7 -0
- data/config/locales/views/auth/sessions/zh.yml +7 -0
- data/config/locales/views/auth/shared/en.yml +12 -0
- data/config/locales/views/auth/shared/id.yml +11 -0
- data/config/locales/views/auth/shared/zh.yml +11 -0
- data/config/locales/views/auth/unlocks/en.yml +7 -0
- data/config/locales/views/auth/unlocks/id.yml +7 -0
- data/config/locales/views/auth/unlocks/zh.yml +7 -0
- data/config/locales/views/pages/en.yml +19 -0
- data/config/locales/views/pages/id.yml +18 -0
- data/config/locales/views/pages/zh.yml +18 -0
- data/config/locales/views/provision/en.yml +12 -0
- data/config/locales/views/provision/id.yml +11 -0
- data/config/locales/views/provision/zh.yml +11 -0
- data/config/locales/views/webhook/o_auth/en.yml +6 -0
- data/config/locales/views/webhook/o_auth/id.yml +6 -0
- data/config/locales/views/webhook/o_auth/providers/en.yml +15 -0
- data/config/locales/views/webhook/o_auth/providers/id.yml +15 -0
- data/config/locales/views/webhook/o_auth/providers/zh.yml +15 -0
- data/config/locales/views/webhook/o_auth/zh.yml +6 -0
- data/lib/devise/models/remote_authenticatable.rb +1 -1
- data/lib/devise_extension.rb +6 -2
- data/lib/generators/mno_enterprise/dummy/dummy_generator.rb +7 -0
- data/lib/generators/mno_enterprise/dummy/templates/rails/routes.rb +0 -6
- data/lib/generators/mno_enterprise/install/install_generator.rb +79 -33
- data/lib/generators/mno_enterprise/install/templates/Procfile +1 -1
- data/lib/generators/mno_enterprise/install/templates/Procfile.dev +2 -0
- data/lib/generators/mno_enterprise/install/templates/config/application.yml +11 -0
- data/lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb +18 -15
- data/lib/generators/mno_enterprise/install/templates/config/settings.yml +7 -0
- data/lib/generators/mno_enterprise/install/templates/config/settings/development.yml +6 -0
- data/lib/generators/mno_enterprise/install/templates/config/settings/production.yml +6 -0
- data/lib/generators/mno_enterprise/install/templates/config/settings/test.yml +6 -0
- data/lib/generators/mno_enterprise/install/templates/config/settings/uat.yml +6 -0
- data/lib/generators/mno_enterprise/install/templates/stylesheets/{main.less_erb → main.less} +16 -3
- data/lib/generators/mno_enterprise/templates/scripts/puma.rb +3 -3
- data/lib/her_extension/model/relation.rb +0 -13
- data/lib/mno_enterprise/concerns/controllers/auth/confirmations_controller.rb +24 -19
- data/lib/mno_enterprise/concerns/controllers/i18n.rb +16 -0
- data/lib/mno_enterprise/concerns/models/app_instance.rb +0 -4
- data/lib/mno_enterprise/concerns/models/organization.rb +1 -1
- data/lib/mno_enterprise/core.rb +20 -7
- data/lib/mno_enterprise/engine.rb +19 -0
- data/lib/mno_enterprise/testing_support/common_rake.rb +1 -1
- data/lib/mno_enterprise/testing_support/factories/impac/kpis.rb +1 -0
- data/lib/mno_enterprise/testing_support/factories/org_invite.rb +1 -5
- data/lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb +1 -2
- data/lib/mno_enterprise/testing_support/shared_contexts/rake_task.rb +21 -0
- data/lib/mno_enterprise/version.rb +1 -1
- data/lib/tasks/mno_enterprise_tasks.rake +3 -5
- data/spec/controllers/mno_enterprise/i18n_spec.rb +42 -0
- data/spec/lib/her_extension/model/relation_spec.rb +0 -71
- data/spec/lib/mno_enterprise/core_engine_spec.rb +16 -0
- data/spec/mno_enterprise_spec.rb +2 -2
- data/spec/models/mno_enterprise/base_resource_spec.rb +0 -22
- metadata +152 -18
- data/lib/her_extension/middleware/mnoe_raise_error.rb +0 -21
- data/lib/her_extension/model/associations/belongs_to_association.rb +0 -25
- data/spec/controllers/mno_enterprise/application_controller_spec.rb +0 -15
@@ -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
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
module MnoEnterprise
|
4
|
-
describe ApplicationController, type: :controller do
|
5
|
-
describe '#add_param_to_fragment' do
|
6
|
-
let(:controller) { MnoEnterprise::ApplicationController.new }
|
7
|
-
|
8
|
-
it { expect(subject.send(:add_param_to_fragment, '/#/platform/accounts', 'foo', 'bar')).to eq('/#/platform/accounts?foo=bar') }
|
9
|
-
it { expect(subject.send(:add_param_to_fragment, '/', 'foo', 'bar')).to eq('/#?foo=bar') }
|
10
|
-
it { expect(subject.send(:add_param_to_fragment, '/#/platform/dashboard/he/43?en=690', 'foo', 'bar')).to eq('/#/platform/dashboard/he/43?en=690&foo=bar') }
|
11
|
-
it { expect(subject.send(:add_param_to_fragment, '/#/platform/dashboard/he/43?en=690', 'foo', [{msg: 'yolo'}])).to eq('/#/platform/dashboard/he/43?en=690&foo=%7B%3Amsg%3D%3E%22yolo%22%7D') }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|