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.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/mno_enterprise/application_controller.rb +10 -20
  3. data/app/models/mno_enterprise/base_resource.rb +1 -2
  4. data/app/models/mno_enterprise/impac/dashboard.rb +24 -22
  5. data/app/models/mno_enterprise/impac/kpi.rb +1 -1
  6. data/app/models/mno_enterprise/impac/widget.rb +1 -1
  7. data/app/models/mno_enterprise/user.rb +2 -1
  8. data/config/initializers/audit_log.rb +2 -0
  9. data/config/initializers/config.rb +3 -0
  10. data/config/locales/models/app/en.yml +25 -0
  11. data/config/locales/models/app/id.yml +25 -0
  12. data/config/locales/models/app/zh.yml +25 -0
  13. data/config/locales/models/app_instance/en.yml +24 -0
  14. data/config/locales/models/app_instance/id.yml +24 -0
  15. data/config/locales/models/app_instance/zh.yml +24 -0
  16. data/config/locales/models/credit_card/en.yml +23 -0
  17. data/config/locales/models/credit_card/id.yml +23 -0
  18. data/config/locales/models/credit_card/zh.yml +23 -0
  19. data/config/locales/models/deletion_request/en.yml +9 -0
  20. data/config/locales/models/deletion_request/id.yml +9 -0
  21. data/config/locales/models/deletion_request/zh.yml +9 -0
  22. data/config/locales/models/impac/dashboard/en.yml +13 -0
  23. data/config/locales/models/impac/dashboard/id.yml +13 -0
  24. data/config/locales/models/impac/dashboard/zh.yml +13 -0
  25. data/config/locales/models/impac/widget/en.yml +13 -0
  26. data/config/locales/models/impac/widget/id.yml +13 -0
  27. data/config/locales/models/impac/widget/zh.yml +13 -0
  28. data/config/locales/models/invoice/en.yml +9 -0
  29. data/config/locales/models/invoice/id.yml +9 -0
  30. data/config/locales/models/invoice/zh.yml +9 -0
  31. data/config/locales/models/org_invite/en.yml +9 -0
  32. data/config/locales/models/org_invite/id.yml +9 -0
  33. data/config/locales/models/org_invite/zh.yml +9 -0
  34. data/config/locales/models/org_team/en.yml +9 -0
  35. data/config/locales/models/org_team/id.yml +9 -0
  36. data/config/locales/models/org_team/zh.yml +9 -0
  37. data/config/locales/models/organization/en.yml +24 -0
  38. data/config/locales/models/organization/id.yml +24 -0
  39. data/config/locales/models/organization/zh.yml +24 -0
  40. data/config/locales/models/user/en.yml +45 -0
  41. data/config/locales/models/user/id.yml +45 -0
  42. data/config/locales/models/user/zh.yml +44 -0
  43. data/config/locales/templates/components/en.yml +21 -0
  44. data/config/locales/templates/components/id.yml +21 -0
  45. data/config/locales/templates/components/zh.yml +21 -0
  46. data/config/locales/templates/dashboard/en.yml +60 -0
  47. data/config/locales/templates/dashboard/id.yml +50 -0
  48. data/config/locales/templates/dashboard/marketplace/en.yml +16 -0
  49. data/config/locales/templates/dashboard/marketplace/id.yml +14 -0
  50. data/config/locales/templates/dashboard/marketplace/zh.yml +14 -0
  51. data/config/locales/templates/dashboard/organization/en.yml +107 -0
  52. data/config/locales/templates/dashboard/organization/id.yml +103 -0
  53. data/config/locales/templates/dashboard/organization/zh.yml +103 -0
  54. data/config/locales/templates/dashboard/teams/en.yml +48 -0
  55. data/config/locales/templates/dashboard/teams/id.yml +43 -0
  56. data/config/locales/templates/dashboard/teams/zh.yml +43 -0
  57. data/config/locales/templates/dashboard/zh.yml +54 -0
  58. data/config/locales/templates/impac/en.yml +24 -0
  59. data/config/locales/templates/impac/id.yml +24 -0
  60. data/config/locales/templates/impac/modals/en.yml +31 -0
  61. data/config/locales/templates/impac/modals/id.yml +29 -0
  62. data/config/locales/templates/impac/modals/zh.yml +28 -0
  63. data/config/locales/templates/impac/widgets/common/en.yml +9 -0
  64. data/config/locales/templates/impac/widgets/common/id.yml +9 -0
  65. data/config/locales/templates/impac/widgets/common/zh.yml +9 -0
  66. data/config/locales/templates/impac/widgets/en.yml +66 -0
  67. data/config/locales/templates/impac/widgets/id.yml +58 -0
  68. data/config/locales/templates/impac/widgets/settings/en.yml +23 -0
  69. data/config/locales/templates/impac/widgets/settings/id.yml +19 -0
  70. data/config/locales/templates/impac/widgets/settings/zh.yml +19 -0
  71. data/config/locales/templates/impac/widgets/zh.yml +58 -0
  72. data/config/locales/templates/impac/zh.yml +24 -0
  73. data/config/locales/templates/modals/en.yml +9 -0
  74. data/config/locales/templates/modals/id.yml +9 -0
  75. data/config/locales/templates/modals/zh.yml +9 -0
  76. data/config/locales/views/auth/confirmations/en.yml +17 -0
  77. data/config/locales/views/auth/confirmations/id.yml +17 -0
  78. data/config/locales/views/auth/confirmations/zh.yml +17 -0
  79. data/config/locales/views/auth/passwords/en.yml +10 -0
  80. data/config/locales/views/auth/passwords/id.yml +10 -0
  81. data/config/locales/views/auth/passwords/zh.yml +10 -0
  82. data/config/locales/views/auth/registrations/en.yml +9 -0
  83. data/config/locales/views/auth/registrations/id.yml +9 -0
  84. data/config/locales/views/auth/registrations/zh.yml +8 -0
  85. data/config/locales/views/auth/sessions/en.yml +7 -0
  86. data/config/locales/views/auth/sessions/id.yml +7 -0
  87. data/config/locales/views/auth/sessions/zh.yml +7 -0
  88. data/config/locales/views/auth/shared/en.yml +12 -0
  89. data/config/locales/views/auth/shared/id.yml +11 -0
  90. data/config/locales/views/auth/shared/zh.yml +11 -0
  91. data/config/locales/views/auth/unlocks/en.yml +7 -0
  92. data/config/locales/views/auth/unlocks/id.yml +7 -0
  93. data/config/locales/views/auth/unlocks/zh.yml +7 -0
  94. data/config/locales/views/pages/en.yml +19 -0
  95. data/config/locales/views/pages/id.yml +18 -0
  96. data/config/locales/views/pages/zh.yml +18 -0
  97. data/config/locales/views/provision/en.yml +12 -0
  98. data/config/locales/views/provision/id.yml +11 -0
  99. data/config/locales/views/provision/zh.yml +11 -0
  100. data/config/locales/views/webhook/o_auth/en.yml +6 -0
  101. data/config/locales/views/webhook/o_auth/id.yml +6 -0
  102. data/config/locales/views/webhook/o_auth/providers/en.yml +15 -0
  103. data/config/locales/views/webhook/o_auth/providers/id.yml +15 -0
  104. data/config/locales/views/webhook/o_auth/providers/zh.yml +15 -0
  105. data/config/locales/views/webhook/o_auth/zh.yml +6 -0
  106. data/lib/devise/models/remote_authenticatable.rb +1 -1
  107. data/lib/devise_extension.rb +6 -2
  108. data/lib/generators/mno_enterprise/dummy/dummy_generator.rb +7 -0
  109. data/lib/generators/mno_enterprise/dummy/templates/rails/routes.rb +0 -6
  110. data/lib/generators/mno_enterprise/install/install_generator.rb +79 -33
  111. data/lib/generators/mno_enterprise/install/templates/Procfile +1 -1
  112. data/lib/generators/mno_enterprise/install/templates/Procfile.dev +2 -0
  113. data/lib/generators/mno_enterprise/install/templates/config/application.yml +11 -0
  114. data/lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb +18 -15
  115. data/lib/generators/mno_enterprise/install/templates/config/settings.yml +7 -0
  116. data/lib/generators/mno_enterprise/install/templates/config/settings/development.yml +6 -0
  117. data/lib/generators/mno_enterprise/install/templates/config/settings/production.yml +6 -0
  118. data/lib/generators/mno_enterprise/install/templates/config/settings/test.yml +6 -0
  119. data/lib/generators/mno_enterprise/install/templates/config/settings/uat.yml +6 -0
  120. data/lib/generators/mno_enterprise/install/templates/stylesheets/{main.less_erb → main.less} +16 -3
  121. data/lib/generators/mno_enterprise/templates/scripts/puma.rb +3 -3
  122. data/lib/her_extension/model/relation.rb +0 -13
  123. data/lib/mno_enterprise/concerns/controllers/auth/confirmations_controller.rb +24 -19
  124. data/lib/mno_enterprise/concerns/controllers/i18n.rb +16 -0
  125. data/lib/mno_enterprise/concerns/models/app_instance.rb +0 -4
  126. data/lib/mno_enterprise/concerns/models/organization.rb +1 -1
  127. data/lib/mno_enterprise/core.rb +20 -7
  128. data/lib/mno_enterprise/engine.rb +19 -0
  129. data/lib/mno_enterprise/testing_support/common_rake.rb +1 -1
  130. data/lib/mno_enterprise/testing_support/factories/impac/kpis.rb +1 -0
  131. data/lib/mno_enterprise/testing_support/factories/org_invite.rb +1 -5
  132. data/lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb +1 -2
  133. data/lib/mno_enterprise/testing_support/shared_contexts/rake_task.rb +21 -0
  134. data/lib/mno_enterprise/version.rb +1 -1
  135. data/lib/tasks/mno_enterprise_tasks.rake +3 -5
  136. data/spec/controllers/mno_enterprise/i18n_spec.rb +42 -0
  137. data/spec/lib/her_extension/model/relation_spec.rb +0 -71
  138. data/spec/lib/mno_enterprise/core_engine_spec.rb +16 -0
  139. data/spec/mno_enterprise_spec.rb +2 -2
  140. data/spec/models/mno_enterprise/base_resource_spec.rb +0 -22
  141. metadata +152 -18
  142. data/lib/her_extension/middleware/mnoe_raise_error.rb +0 -21
  143. data/lib/her_extension/model/associations/belongs_to_association.rb +0 -25
  144. 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