mno-enterprise-api 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -0
  3. data/Rakefile +12 -0
  4. data/app/assets/javascripts/mno_enterprise/angular/loading-page.app.js.coffee +156 -0
  5. data/app/assets/javascripts/mno_enterprise/application.js +13 -0
  6. data/app/controllers/devise/password_expired_controller.rb +55 -0
  7. data/app/controllers/mno_enterprise/auth/confirmations_controller.rb +5 -0
  8. data/app/controllers/mno_enterprise/auth/omniauth_callbacks_controller.rb +30 -0
  9. data/app/controllers/mno_enterprise/auth/passwords_controller.rb +5 -0
  10. data/app/controllers/mno_enterprise/auth/registrations_controller.rb +5 -0
  11. data/app/controllers/mno_enterprise/auth/sessions_controller.rb +7 -0
  12. data/app/controllers/mno_enterprise/auth/unlocks_controller.rb +5 -0
  13. data/app/controllers/mno_enterprise/deletion_requests_controller.rb +5 -0
  14. data/app/controllers/mno_enterprise/impersonate_controller.rb +48 -0
  15. data/app/controllers/mno_enterprise/jpi/v1/admin/audit_events_controller.rb +16 -0
  16. data/app/controllers/mno_enterprise/jpi/v1/admin/base_resource_controller.rb +5 -0
  17. data/app/controllers/mno_enterprise/jpi/v1/admin/cloud_apps_controller.rb +46 -0
  18. data/app/controllers/mno_enterprise/jpi/v1/admin/invoices_controller.rb +47 -0
  19. data/app/controllers/mno_enterprise/jpi/v1/admin/organizations_controller.rb +27 -0
  20. data/app/controllers/mno_enterprise/jpi/v1/admin/tenant_invoices_controller.rb +14 -0
  21. data/app/controllers/mno_enterprise/jpi/v1/admin/users_controller.rb +63 -0
  22. data/app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb +24 -0
  23. data/app/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller.rb +36 -0
  24. data/app/controllers/mno_enterprise/jpi/v1/base_resource_controller.rb +32 -0
  25. data/app/controllers/mno_enterprise/jpi/v1/current_users_controller.rb +5 -0
  26. data/app/controllers/mno_enterprise/jpi/v1/deletion_requests_controller.rb +5 -0
  27. data/app/controllers/mno_enterprise/jpi/v1/impac/dashboards_controller.rb +5 -0
  28. data/app/controllers/mno_enterprise/jpi/v1/impac/kpis_controller.rb +80 -0
  29. data/app/controllers/mno_enterprise/jpi/v1/impac/widgets_controller.rb +63 -0
  30. data/app/controllers/mno_enterprise/jpi/v1/industry_bundle_controller.rb +25 -0
  31. data/app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb +22 -0
  32. data/app/controllers/mno_enterprise/jpi/v1/organizations_controller.rb +5 -0
  33. data/app/controllers/mno_enterprise/jpi/v1/shopping_cart_controller.rb +93 -0
  34. data/app/controllers/mno_enterprise/jpi/v1/teams_controller.rb +88 -0
  35. data/app/controllers/mno_enterprise/org_invites_controller.rb +5 -0
  36. data/app/controllers/mno_enterprise/pages_controller.rb +5 -0
  37. data/app/controllers/mno_enterprise/provision_controller.rb +5 -0
  38. data/app/controllers/mno_enterprise/status_controller.rb +27 -0
  39. data/app/controllers/mno_enterprise/webhook/o_auth_controller.rb +5 -0
  40. data/app/mailers/mno_enterprise/system_notification_mailer.rb +5 -0
  41. data/app/models/mno_enterprise/health_check.rb +16 -0
  42. data/app/views/devise/password_expired/show.html.haml +32 -0
  43. data/app/views/mno_enterprise/auth/confirmations/default/_form.html.haml +49 -0
  44. data/app/views/mno_enterprise/auth/confirmations/default/_lounge.html.haml +34 -0
  45. data/app/views/mno_enterprise/auth/confirmations/default/_show.html.haml +10 -0
  46. data/app/views/mno_enterprise/auth/confirmations/lounge.html.haml +4 -0
  47. data/app/views/mno_enterprise/auth/confirmations/material/_form.html.haml +44 -0
  48. data/app/views/mno_enterprise/auth/confirmations/material/_lounge.html.haml +18 -0
  49. data/app/views/mno_enterprise/auth/confirmations/material/_show.html.haml +21 -0
  50. data/app/views/mno_enterprise/auth/confirmations/new.html.haml +31 -0
  51. data/app/views/mno_enterprise/auth/confirmations/show.html.haml +4 -0
  52. data/app/views/mno_enterprise/auth/mailer/confirmation_instructions.html.haml +4 -0
  53. data/app/views/mno_enterprise/auth/mailer/reset_password_instructions.html.haml +6 -0
  54. data/app/views/mno_enterprise/auth/mailer/unlock_instructions.html.haml +5 -0
  55. data/app/views/mno_enterprise/auth/passwords/edit.html.haml +53 -0
  56. data/app/views/mno_enterprise/auth/passwords/new.html.haml +34 -0
  57. data/app/views/mno_enterprise/auth/registrations/default/_form.html.haml +35 -0
  58. data/app/views/mno_enterprise/auth/registrations/default/_new.html.haml +11 -0
  59. data/app/views/mno_enterprise/auth/registrations/material/_form.html.haml +30 -0
  60. data/app/views/mno_enterprise/auth/registrations/material/_new.html.haml +10 -0
  61. data/app/views/mno_enterprise/auth/registrations/new.html.haml +4 -0
  62. data/app/views/mno_enterprise/auth/sessions/default/_form.html.haml +17 -0
  63. data/app/views/mno_enterprise/auth/sessions/default/_new.html.haml +11 -0
  64. data/app/views/mno_enterprise/auth/sessions/material/_form.html.haml +26 -0
  65. data/app/views/mno_enterprise/auth/sessions/material/_new.html.haml +11 -0
  66. data/app/views/mno_enterprise/auth/sessions/new.html.haml +4 -0
  67. data/app/views/mno_enterprise/auth/shared/_links.html.haml +24 -0
  68. data/app/views/mno_enterprise/auth/unlocks/new.html.haml +10 -0
  69. data/app/views/mno_enterprise/deletion_requests/show.html.haml +131 -0
  70. data/app/views/mno_enterprise/jpi/v1/admin/audit_events/_audit_event.json.jbuilder +5 -0
  71. data/app/views/mno_enterprise/jpi/v1/admin/audit_events/index.json.jbuilder +4 -0
  72. data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/_cloud_app.json.jbuilder +1 -0
  73. data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/index.json.jbuilder +1 -0
  74. data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/show.json.jbuilder +1 -0
  75. data/app/views/mno_enterprise/jpi/v1/admin/invoices/_invoice.json.jbuilder +2 -0
  76. data/app/views/mno_enterprise/jpi/v1/admin/invoices/index.json.jbuilder +1 -0
  77. data/app/views/mno_enterprise/jpi/v1/admin/invoices/show.json.jbuilder +2 -0
  78. data/app/views/mno_enterprise/jpi/v1/admin/organizations/_credit_card.json.jbuilder +7 -0
  79. data/app/views/mno_enterprise/jpi/v1/admin/organizations/_invoices.json.jbuilder +8 -0
  80. data/app/views/mno_enterprise/jpi/v1/admin/organizations/_member.json.jbuilder +14 -0
  81. data/app/views/mno_enterprise/jpi/v1/admin/organizations/_organization.json.jbuilder +1 -0
  82. data/app/views/mno_enterprise/jpi/v1/admin/organizations/in_arrears.json.jbuilder +8 -0
  83. data/app/views/mno_enterprise/jpi/v1/admin/organizations/index.json.jbuilder +7 -0
  84. data/app/views/mno_enterprise/jpi/v1/admin/organizations/show.json.jbuilder +11 -0
  85. data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/_tenant_invoice.json.jbuilder +5 -0
  86. data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/index.json.jbuilder +1 -0
  87. data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/show.json.jbuilder +1 -0
  88. data/app/views/mno_enterprise/jpi/v1/admin/users/_user.json.jbuilder +1 -0
  89. data/app/views/mno_enterprise/jpi/v1/admin/users/index.json.jbuilder +2 -0
  90. data/app/views/mno_enterprise/jpi/v1/admin/users/show.json.jbuilder +9 -0
  91. data/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder +23 -0
  92. data/app/views/mno_enterprise/jpi/v1/app_instances/index.json.jbuilder +9 -0
  93. data/app/views/mno_enterprise/jpi/v1/app_instances/show.json.jbuilder +3 -0
  94. data/app/views/mno_enterprise/jpi/v1/billing/index.json.jbuilder +0 -0
  95. data/app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder +37 -0
  96. data/app/views/mno_enterprise/jpi/v1/impac/dashboards/_dashboard.json.jbuilder +9 -0
  97. data/app/views/mno_enterprise/jpi/v1/impac/dashboards/index.json.jbuilder +1 -0
  98. data/app/views/mno_enterprise/jpi/v1/impac/dashboards/show.json.jbuilder +1 -0
  99. data/app/views/mno_enterprise/jpi/v1/impac/kpis/_kpi.json.jbuilder +1 -0
  100. data/app/views/mno_enterprise/jpi/v1/impac/kpis/show.json.jbuilder +1 -0
  101. data/app/views/mno_enterprise/jpi/v1/impac/widgets/_widget.json.jbuilder +6 -0
  102. data/app/views/mno_enterprise/jpi/v1/impac/widgets/show.json.jbuilder +1 -0
  103. data/app/views/mno_enterprise/jpi/v1/marketplace/_app.json.jbuilder +14 -0
  104. data/app/views/mno_enterprise/jpi/v1/marketplace/index.json.jbuilder +3 -0
  105. data/app/views/mno_enterprise/jpi/v1/marketplace/show.json.jbuilder +3 -0
  106. data/app/views/mno_enterprise/jpi/v1/organizations/_arrears.json.jbuilder +11 -0
  107. data/app/views/mno_enterprise/jpi/v1/organizations/_billing.json.jbuilder +4 -0
  108. data/app/views/mno_enterprise/jpi/v1/organizations/_credit_card.json.jbuilder +7 -0
  109. data/app/views/mno_enterprise/jpi/v1/organizations/_current_user.json.jbuilder +5 -0
  110. data/app/views/mno_enterprise/jpi/v1/organizations/_invoices.json.jbuilder +8 -0
  111. data/app/views/mno_enterprise/jpi/v1/organizations/_member.json.jbuilder +13 -0
  112. data/app/views/mno_enterprise/jpi/v1/organizations/_organization.json.jbuilder +13 -0
  113. data/app/views/mno_enterprise/jpi/v1/organizations/credit_card.json.jbuilder +1 -0
  114. data/app/views/mno_enterprise/jpi/v1/organizations/index.json.jbuilder +1 -0
  115. data/app/views/mno_enterprise/jpi/v1/organizations/members.json.jbuilder +3 -0
  116. data/app/views/mno_enterprise/jpi/v1/organizations/show.json.jbuilder +15 -0
  117. data/app/views/mno_enterprise/jpi/v1/organizations/show_reduced.json.jbuilder +3 -0
  118. data/app/views/mno_enterprise/jpi/v1/shopping_cart/organizations.json.jbuilder +5 -0
  119. data/app/views/mno_enterprise/jpi/v1/shopping_cart/show.json.jbuilder +59 -0
  120. data/app/views/mno_enterprise/jpi/v1/shopping_cart/show_item.json.jbuilder +34 -0
  121. data/app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder +20 -0
  122. data/app/views/mno_enterprise/jpi/v1/teams/index.json.jbuilder +1 -0
  123. data/app/views/mno_enterprise/jpi/v1/teams/show.json.jbuilder +3 -0
  124. data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
  125. data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
  126. data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
  127. data/app/views/mno_enterprise/pages/loading.html.erb +69 -0
  128. data/app/views/mno_enterprise/provision/_provision_apps.html.haml +42 -0
  129. data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
  130. data/app/views/mno_enterprise/provision/new.html.haml +4 -0
  131. data/app/views/mno_enterprise/webhook/o_auth/authorize.html.haml +26 -0
  132. data/app/views/mno_enterprise/webhook/o_auth/providers/myob.html.haml +29 -0
  133. data/app/views/mno_enterprise/webhook/o_auth/providers/xero.html.haml +34 -0
  134. data/config/initializers/devise.rb +273 -0
  135. data/config/initializers/devise_extension.rb +9 -0
  136. data/config/initializers/devise_log.rb +12 -0
  137. data/config/initializers/health_check.rb +35 -0
  138. data/config/initializers/main_app_version.rb +6 -0
  139. data/config/routes.rb +152 -0
  140. data/lib/mno-enterprise-api.rb +1 -0
  141. data/lib/mno_enterprise/api.rb +14 -0
  142. data/lib/mno_enterprise/api/engine.rb +9 -0
  143. data/lib/mno_enterprise/concerns/controllers/deletion_requests_controller.rb +108 -0
  144. data/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/base_resource_controller.rb +34 -0
  145. data/lib/mno_enterprise/concerns/controllers/jpi/v1/current_users_controller.rb +58 -0
  146. data/lib/mno_enterprise/concerns/controllers/jpi/v1/deletion_requests_controller.rb +69 -0
  147. data/lib/mno_enterprise/concerns/controllers/jpi/v1/impac/dashboards_controller.rb +76 -0
  148. data/lib/mno_enterprise/concerns/controllers/jpi/v1/organizations_controller.rb +180 -0
  149. data/lib/mno_enterprise/concerns/controllers/org_invites_controller.rb +44 -0
  150. data/lib/mno_enterprise/concerns/controllers/pages_controller.rb +78 -0
  151. data/lib/mno_enterprise/concerns/controllers/provision_controller.rb +71 -0
  152. data/lib/mno_enterprise/concerns/controllers/webhook/o_auth_controller.rb +107 -0
  153. data/lib/mno_enterprise/concerns/mailers/system_notification_mailer.rb +158 -0
  154. data/lib/mno_enterprise/event_logger.rb +32 -0
  155. data/spec/controllers/mno_enterprise/auth/confirmation_controller_spec.rb +68 -0
  156. data/spec/controllers/mno_enterprise/deletion_requests_controller_spec.rb +141 -0
  157. data/spec/controllers/mno_enterprise/impersonate_controller_spec.rb +48 -0
  158. data/spec/controllers/mno_enterprise/jpi/v1/admin/audit_events_controller_spec.rb +51 -0
  159. data/spec/controllers/mno_enterprise/jpi/v1/admin/cloud_apps_controller_spec.rb +92 -0
  160. data/spec/controllers/mno_enterprise/jpi/v1/admin/invoices_controller_spec.rb +159 -0
  161. data/spec/controllers/mno_enterprise/jpi/v1/admin/organizations_controller_spec.rb +116 -0
  162. data/spec/controllers/mno_enterprise/jpi/v1/admin/tenant_invoices_controller_spec.rb +92 -0
  163. data/spec/controllers/mno_enterprise/jpi/v1/admin/users_controller_spec.rb +136 -0
  164. data/spec/controllers/mno_enterprise/jpi/v1/app_instances_controller_spec.rb +76 -0
  165. data/spec/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller_spec.rb +94 -0
  166. data/spec/controllers/mno_enterprise/jpi/v1/current_users_controller_spec.rb +128 -0
  167. data/spec/controllers/mno_enterprise/jpi/v1/deletion_requests_controller_spec.rb +72 -0
  168. data/spec/controllers/mno_enterprise/jpi/v1/impac/kpis_controller_spec.rb +80 -0
  169. data/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb +115 -0
  170. data/spec/controllers/mno_enterprise/jpi/v1/organizations_controller_spec.rb +516 -0
  171. data/spec/controllers/mno_enterprise/jpi/v1/team_controller_spec.rb +86 -0
  172. data/spec/controllers/mno_enterprise/org_invites_controller_spec.rb +29 -0
  173. data/spec/controllers/mno_enterprise/pages_controller_spec.rb +49 -0
  174. data/spec/controllers/mno_enterprise/provision_controller_spec.rb +94 -0
  175. data/spec/controllers/mno_enterprise/status_controller_spec.rb +34 -0
  176. data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +104 -0
  177. data/spec/lib/mno_enterprise/event_logger_spec.rb +28 -0
  178. data/spec/mailer/mno_enterprise/system_notification_mailer_spec.rb +132 -0
  179. data/spec/rails_helper.rb +94 -0
  180. data/spec/requests/devise/authentication_spec.rb +43 -0
  181. data/spec/requests/devise/registration_spec.rb +64 -0
  182. data/spec/routing/devise/confirmation_routing_spec.rb +20 -0
  183. data/spec/routing/devise/passwords_routing_spec.rb +24 -0
  184. data/spec/routing/devise/registrations_routing_spec.rb +16 -0
  185. data/spec/routing/devise/sessions_routing_spec.rb +20 -0
  186. data/spec/routing/mno_enterprise/deletion_requests_controller_routing_spec.rb +20 -0
  187. data/spec/routing/mno_enterprise/impersonate_controller_routing.spec.rb +15 -0
  188. data/spec/routing/mno_enterprise/jpi/v1/admin/audit_events_controller_routing_spec.rb +11 -0
  189. data/spec/routing/mno_enterprise/jpi/v1/admin/cloud_apps_controller_routing_spec.rb +24 -0
  190. data/spec/routing/mno_enterprise/jpi/v1/admin/invoices_controller_routing_spec.rb +37 -0
  191. data/spec/routing/mno_enterprise/jpi/v1/admin/organizations_controller_routing_spec.rb +20 -0
  192. data/spec/routing/mno_enterprise/jpi/v1/admin/tenant_invoices_controller_routing_spec.rb +16 -0
  193. data/spec/routing/mno_enterprise/jpi/v1/admin/users_controller_routing_spec.rb +24 -0
  194. data/spec/routing/mno_enterprise/jpi/v1/app_instances_controller_routing_spec.rb +12 -0
  195. data/spec/routing/mno_enterprise/jpi/v1/app_instances_sync_controller_routing_spec.rb +15 -0
  196. data/spec/routing/mno_enterprise/jpi/v1/current_users_controller_routing_spec.rb +28 -0
  197. data/spec/routing/mno_enterprise/jpi/v1/deletion_requests_controller_routing_spec.rb +24 -0
  198. data/spec/routing/mno_enterprise/jpi/v1/impac/kpis_controller_routing_spec.rb +22 -0
  199. data/spec/routing/mno_enterprise/jpi/v1/marketplace_controller_routing_spec.rb +16 -0
  200. data/spec/routing/mno_enterprise/jpi/v1/organizations_controller_routing_spec.rb +44 -0
  201. data/spec/routing/mno_enterprise/jpi/v1/teams_controller_routing_spec.rb +36 -0
  202. data/spec/routing/mno_enterprise/org_invites_controller_routing_spec.rb +12 -0
  203. data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +29 -0
  204. data/spec/routing/mno_enterprise/provision_controller_routing_spec.rb +15 -0
  205. data/spec/routing/mno_enterprise/status_controller_routing_spec.rb +19 -0
  206. data/spec/routing/mno_enterprise/webhook/o_auth_controller_routing_spec.rb +27 -0
  207. data/spec/spec_helper.rb +88 -0
  208. metadata +402 -0
@@ -0,0 +1,34 @@
1
+ json.item @item
2
+
3
+ json.cart do
4
+ json.total do
5
+ json.monthly @cart.total_monthly
6
+ json.monthlyRaw @cart.total_monthly_raw
7
+
8
+ json.hourly @cart.total_hourly
9
+ json.adhoc @cart.total_adhoc
10
+
11
+ json.upfrontWithTax @cart.total_upfront_with_tax
12
+ json.upfrontTax @cart.total_upfront_tax
13
+
14
+ json.upfront @cart.total_upfront
15
+ json.upfrontBeforeCredit @cart.total_upfront_before_credit
16
+ json.upfrontRaw @cart.total_upfront_raw
17
+
18
+ json.upfrontSavings @cart.total_upfront_savings
19
+ json.supportCredit @cart.total_support_credit
20
+ end
21
+
22
+ json.orderList @cart.order_list
23
+
24
+ json.setting do
25
+ json.prepayMonths @cart.prepay_months
26
+ json.reductionPercent @cart.reduction_whole_percent
27
+ json.underFreeTrial @cart.under_free_trial?
28
+ json.freeTrialEligible @cart.free_trial_eligible?
29
+ json.creditCardRequired @cart.credit_card_required?
30
+ json.monthlyCreditAvailable @cart.monthly_credit_available?
31
+ json.ownedSupportPlan @cart.owned_support_plan
32
+ end
33
+ end
34
+
@@ -0,0 +1,20 @@
1
+ json.id team.id
2
+ json.name team.name
3
+
4
+ json.users do
5
+ json.array! team.users do |user|
6
+ json.extract! user, :id, :name, :surname, :email
7
+ json.role user.role(team.organization)
8
+ end
9
+ end
10
+
11
+ json.app_instances do
12
+ json.array! team.app_instances do |app_instance|
13
+ json.id app_instance.id
14
+ json.name app_instance.name
15
+
16
+ if app_instance.app
17
+ json.logo app_instance.app.logo.to_s
18
+ end
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ json.teams @teams, partial: 'team', as: :team
@@ -0,0 +1,3 @@
1
+ json.team do
2
+ json.partial! 'team', team: @team
3
+ end
@@ -0,0 +1,19 @@
1
+ .banners.promo.dark.darkblue
2
+ .container
3
+ .row.text-center
4
+ = image_tag("mno_enterprise/main-logo.png")
5
+ .row
6
+ %h2 App Access Not Granted
7
+ %hr
8
+ .row
9
+ .col-md-6.col-md-offset-3
10
+ .align-center
11
+ %h3
12
+ It looks like the administrator of this application has not granted you access.
13
+ %p You should ask your administrator to share this application with you.
14
+ .spacer4
15
+ .align-center
16
+ %h5
17
+ If you think this is a mistake, please send us an email at
18
+ = mail_to support_email
19
+ .spacer4
@@ -0,0 +1,18 @@
1
+ .banners.promo.dark.darkblue
2
+ .container
3
+ .row.text-center
4
+ = image_tag("mno_enterprise/main-logo.png")
5
+ .row
6
+ %h2 Successful logout
7
+ %hr
8
+ .row
9
+ .col-md-6.col-md-offset-3
10
+ .align-center
11
+ %h3
12
+ You have successfully logged out from your application
13
+ .spacer4
14
+ .align-center
15
+ %h5
16
+ If you think this is a mistake, please send us an email at
17
+ = mail_to support_email
18
+ .spacer4
@@ -0,0 +1,19 @@
1
+ .banners.promo.dark.darkblue
2
+ .container
3
+ .row.text-center
4
+ = image_tag("mno_enterprise/main-logo.png")
5
+ .row
6
+ %h2 Billing Details Required
7
+ %hr
8
+ .row
9
+ .col-md-6.col-md-offset-3
10
+ .align-center
11
+ %h3
12
+ Oops! It looks like the free trial has ended for this application and no billing details have been entered.
13
+ %p Please ask your administrator to enter valid billing details for your company.
14
+ .spacer4
15
+ .align-center
16
+ %h5
17
+ If you think this is a mistake, please send us an email at
18
+ = mail_to support_email
19
+ .spacer4
@@ -0,0 +1,69 @@
1
+
2
+ <div ng-app="loadingPageApp" ng-controller="loadingController">
3
+ <div ng-init="init(<%= @app_instance_hash.to_json %>)">
4
+ <div class="spacer3 hidden-xs hidden-sm"></div>
5
+ <input type="hidden" ng-model="appInstance">
6
+ <div class='align-center'>
7
+ <%= image_tag 'mno_enterprise/main-logo.png' %>
8
+
9
+ <div class="spacer2"></div>
10
+
11
+ <!-- Status Details -->
12
+ <div ng-switch on="currentStatus()">
13
+ <div ng-switch-when='online'>
14
+ <h3 class='mgreen'>Redirecting to {{appInstance.name}}</h3>
15
+ <h4 class='muted'>You will be automatically redirected in {{redirectionCounter}}s (or click the link below)</h4>
16
+ <br>
17
+ <a class='fbtn fbtn-large fbtn-success' ng-href="redirectUrl()"><b>Go to my app now!</b></a>
18
+ </div>
19
+ <div ng-switch-when='updating'>
20
+ <h3 class='mgreen'>{{appInstance.name}} is getting configured</h3>
21
+ <h4 class='muted'>Don't worry, it should be available in a few seconds.</h4>
22
+ <div class="spacer2"></div>
23
+ <hr/>
24
+ <%= image_tag 'mno_enterprise/loader-32x32-bg-inverse.gif' %>
25
+ </div>
26
+ <div ng-switch-when='loading'>
27
+ <h3 class='mgreen'>{{appInstance.name}} is loading</h3>
28
+ <h4 class='muted'>{{appInstance.name}} has been idle for a long time. We are currently loading it. It should be available soon!</h4>
29
+ </div>
30
+ <div ng-switch-when='creating'>
31
+ <h3 class='mgreen'>{{appInstance.name}} is getting setup</h3>
32
+ <h4 class='muted'>{{appInstance.name}} is preparing for the first use. It should be available soon!</h4>
33
+ </div>
34
+ <div ng-switch-when='terminated'>
35
+ <h3 class='mgreen'>{{appInstance.name}} has been deleted</h3>
36
+ <h4 class='muted'>{{appInstance.name}} has been removed by your administrator and is no more accessible.</h4>
37
+ </div>
38
+ <div ng-switch-when='errors'>
39
+ <h3 class='muted'>{{appInstance.name}} is idle</h3>
40
+ <br>
41
+ <div class='alert alert-danger align-left'>
42
+ <p><b>Unfortunately we cannot switch this app ON for you:</b></p>
43
+ <ul>
44
+ <li ng-repeat="error in appInstance.errors">{{error}}</li>
45
+ </ul>
46
+ </div>
47
+ </div>
48
+ <div ng-switch-when='not_found'>
49
+ <h3 class='mgreen'>Application not found</h3>
50
+ <h4 class='muted'>The app you requested does not seem to be managed by us. <br/>Are you sure you typed the right url?</h4>
51
+ </div>
52
+ </div>
53
+
54
+ <hr>
55
+
56
+ <!-- Loading Bar -->
57
+ <div ng-show="isProgressBarShown()">
58
+ <div class="muted progress-indicator" style='margin-left:11px;'>{{progressBarPercent()}}</div>
59
+ <div class="progress progress-mno progress-striped active">
60
+ <div class="progress-bar" ng-style="{width: progressBarPercent()}"></div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
68
+ <%= javascript_include_tag "mno_enterprise/application" %>
69
+
@@ -0,0 +1,42 @@
1
+ .banners
2
+ .spacer5.hidden-xs.hidden-sm
3
+ .container
4
+ .row
5
+ .col-md-6.text-center.col-md-offset-3
6
+ %h3 You order is being prepared
7
+ .spacer1
8
+ = image_tag('mno_enterprise/loader-32x32-bg-inverse.gif')
9
+
10
+ - # Provision applications in the background and remove params
11
+ - # Used to avoid double-provisioning on page reload and keep
12
+ - # actual provisioning (create action) as POST
13
+ - if @organization
14
+ :javascript
15
+ function defer(method) {
16
+ if (window.$)
17
+ method();
18
+ else
19
+ setTimeout(function() { defer(method) }, 50);
20
+ }
21
+
22
+ function provisionApps() {
23
+ $(document).ready( function() {
24
+
25
+ //window.location.href.replace(window.location.search,'');
26
+ window.history.replaceState({}, 'Preparing Order', window.location.pathname + "?status=preparing");
27
+
28
+ $.ajax({
29
+ url: "#{provision_index_path}",
30
+ method: "POST",
31
+ data: {
32
+ organization_id: "#{@organization.id}",
33
+ apps: #{@apps.to_json}
34
+ }
35
+ }).always(function() {
36
+ window.location.href = "#{after_provision_path}?dhbRefId=#{@organization.id}"
37
+ });
38
+
39
+ });
40
+ }
41
+
42
+ defer(provisionApps);
@@ -0,0 +1,17 @@
1
+ .banners.promo.dark.darkblue
2
+ .container
3
+ .row
4
+ %h2 Choose an organization
5
+ .banners.promo
6
+ .container
7
+ .row
8
+ .col-md-6.col-md-offset-3
9
+ .align-center
10
+ %h3 You belong to multiple organizations
11
+ %p Please select the organization you are making this new order for
12
+ = form_tag(new_provision_path, method: :get) do
13
+ - @apps.each do |app|
14
+ = hidden_field_tag 'apps[]', app
15
+ = select_tag :organization_id, options_for_select(@organizations.map { |o| [o.name, o.id]} )
16
+ = submit_tag 'Go', class: 'btn'
17
+ .spacer4
@@ -0,0 +1,4 @@
1
+ - if @organization
2
+ = render 'provision_apps'
3
+ - else
4
+ = render 'select_organization'
@@ -0,0 +1,26 @@
1
+ .banners
2
+ .spacer5.hidden-xs.hidden-sm
3
+ .container
4
+ .row
5
+ .col-md-6.text-center.col-md-offset-3
6
+ %h3 You are about to be connected via our integration partner
7
+ = image_tag('mno_enterprise/maestrano/logo-whitebg.png')
8
+
9
+ .spacer1
10
+
11
+ %hr
12
+ = image_tag('mno_enterprise/loader-32x32-bg-inverse.gif')
13
+ %hr
14
+
15
+
16
+ - # Defer redirection to Maestrano Enterprise for the oauth handshake
17
+ :javascript
18
+ function defer(method) {
19
+ setTimeout(method, 3000);
20
+ }
21
+
22
+ function doRedirect() {
23
+ window.location.href = "#{@redirect_to}";
24
+ }
25
+
26
+ defer(doRedirect);
@@ -0,0 +1,29 @@
1
+ .oauth-config-page
2
+ .banners
3
+ .spacer1
4
+ .container
5
+ .row
6
+ .col-md-6.text-center.col-md-offset-3
7
+ = image_tag 'mno_enterprise/main-logo.png', class: 'top-picture'
8
+ .spacer2
9
+ %h3 Which version of MYOB do you use?
10
+
11
+ .spacer1
12
+
13
+ %hr
14
+
15
+ - # form with options
16
+ .align-center
17
+ = form_tag authorize_webhook_oauth_path, method: :get do
18
+ = hidden_field_tag :perform, true
19
+
20
+ .spacer1
21
+
22
+ .form-group
23
+ %p My version of MYOB is:
24
+ = select_tag :version, options_for_select([["Account Right (Desktop)","account_right"],["Essentials (Cloud)","essentials"]], "essentials")
25
+
26
+ %hr
27
+
28
+ .form-group
29
+ %button{ class: 'btn btn-warning', type: 'submit' } Connect
@@ -0,0 +1,34 @@
1
+ .oauth-config-page{'ng-app' => true}
2
+ .banners
3
+ .spacer1
4
+ .container
5
+ .row
6
+ .col-md-6.text-center.col-md-offset-3
7
+ = image_tag 'mno_enterprise/main-logo.png', class: 'top-picture'
8
+ .spacer2
9
+ %h3 How do you want us to connect your Xero account?
10
+
11
+ .spacer1
12
+
13
+ %hr
14
+
15
+ - # form with options
16
+ .align-center
17
+ = form_tag authorize_webhook_oauth_path, method: :get do
18
+ = hidden_field_tag :perform, true
19
+
20
+ %p Do you want to connect any of the following extra modules?
21
+ .form-inline
22
+ = check_box_tag 'extra_params[]', :payroll, false, {'ng-model' => 'payroll'}
23
+ = label_tag :payroll
24
+
25
+ .spacer1
26
+
27
+ .form-group{'ng-if' => 'payroll', 'ng-cloak' => true}
28
+ %p What is the country associated with your Xero account?
29
+ = select_tag :xero_country, options_for_select([["Australia","AU"],["USA","US"]], "AU")
30
+
31
+ %hr
32
+
33
+ .form-group
34
+ %button{ class: 'btn btn-warning', type: 'submit' } Connect
@@ -0,0 +1,273 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # config.secret_key = '1e867fc01cfcda9e6dabdf99949082f5e4bf7cc90c358637a53505c73ab9b930b498c9573d388eed420afd7b0cfb71a8f09833d52490f2c10ce0385e9794a722'
8
+
9
+ # ==> Mailer Configuration
10
+ # Configure the e-mail address which will be shown in Devise::Mailer,
11
+ # note that it will be overwritten if you use your own mailer class
12
+ # with default "from" parameter.
13
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
+
15
+ # Configure the class responsible to send e-mails.
16
+ config.mailer = 'MnoEnterprise::SystemNotificationMailer'
17
+
18
+ # ==> ORM configuration
19
+ # Load and configure the ORM. Supports :active_record (default) and
20
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
21
+ # available as additional gems.
22
+ require 'devise/orm/active_record'
23
+
24
+ # ==> Configuration for any authentication mechanism
25
+ # Configure which keys are used when authenticating a user. The default is
26
+ # just :email. You can configure it to use [:username, :subdomain], so for
27
+ # authenticating a user, both parameters are required. Remember that those
28
+ # parameters are used only when authenticating and not when retrieving from
29
+ # session. If you need permissions, you should implement that in a before filter.
30
+ # You can also supply a hash where the value is a boolean determining whether
31
+ # or not authentication should be aborted when the value is not present.
32
+ # config.authentication_keys = [ :email ]
33
+
34
+ # Configure parameters from the request object used for authentication. Each entry
35
+ # given should be a request method and it will automatically be passed to the
36
+ # find_for_authentication method and considered in your model lookup. For instance,
37
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
38
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
39
+ # config.request_keys = []
40
+
41
+ # Configure which authentication keys should be case-insensitive.
42
+ # These keys will be downcased upon creating or modifying a user and when used
43
+ # to authenticate or find a user. Default is :email.
44
+ config.case_insensitive_keys = [ :email ]
45
+
46
+ # Configure which authentication keys should have whitespace stripped.
47
+ # These keys will have whitespace before and after removed upon creating or
48
+ # modifying a user and when used to authenticate or find a user. Default is :email.
49
+ config.strip_whitespace_keys = [ :email ]
50
+
51
+ # Tell if authentication through request.params is enabled. True by default.
52
+ # It can be set to an array that will enable params authentication only for the
53
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
54
+ # enable it only for database (email + password) authentication.
55
+ # config.params_authenticatable = true
56
+
57
+ # Tell if authentication through HTTP Auth is enabled. False by default.
58
+ # It can be set to an array that will enable http authentication only for the
59
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
60
+ # enable it only for database authentication. The supported strategies are:
61
+ # :database = Support basic authentication with authentication key + password
62
+ # config.http_authenticatable = false
63
+
64
+ # If 401 status code should be returned for AJAX requests. True by default.
65
+ # config.http_authenticatable_on_xhr = true
66
+
67
+ # The realm used in Http Basic Authentication. 'Application' by default.
68
+ # config.http_authentication_realm = 'Application'
69
+
70
+ # It will change confirmation, password recovery and other workflows
71
+ # to behave the same regardless if the e-mail provided was right or wrong.
72
+ # Does not affect registerable.
73
+ config.paranoid = true
74
+
75
+ # By default Devise will store the user in session. You can skip storage for
76
+ # particular strategies by setting this option.
77
+ # Notice that if you are skipping storage for all authentication paths, you
78
+ # may want to disable generating routes to Devise's sessions controller by
79
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
80
+ config.skip_session_storage = [:http_auth]
81
+
82
+ # By default, Devise cleans up the CSRF token on authentication to
83
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
84
+ # requests for sign in and sign up, you need to get a new CSRF token
85
+ # from the server. You can disable this option at your own risk.
86
+ # config.clean_up_csrf_token_on_authentication = true
87
+
88
+ # ==> Configuration for :database_authenticatable
89
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
90
+ # using other encryptors, it sets how many times you want the password re-encrypted.
91
+ #
92
+ # Limiting the stretches to just one in testing will increase the performance of
93
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
94
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
95
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
96
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
97
+ config.stretches = Rails.env.test? ? 1 : 10
98
+
99
+ # Setup a pepper to generate the encrypted password.
100
+ # config.pepper = '11ab398be280e434b1dc50197d359577c1bc52efd28a07d081e397c7c11dcf8d1ad80f40188d58421830c20351f5af8c1217b39397ca95ee33809c74b028972f'
101
+
102
+ # ==> Configuration for :confirmable
103
+ # A period that the user is allowed to access the website even without
104
+ # confirming their account. For instance, if set to 2.days, the user will be
105
+ # able to access the website for two days without confirming their account,
106
+ # access will be blocked just in the third day. Default is 0.days, meaning
107
+ # the user cannot access the website without confirming their account.
108
+ config.allow_unconfirmed_access_for = 10.days
109
+
110
+ # A period that the user is allowed to confirm their account before their
111
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
112
+ # their account within 3 days after the mail was sent, but on the fourth day
113
+ # their account can't be confirmed with the token any more.
114
+ # Default is nil, meaning there is no restriction on how long a user can take
115
+ # before confirming their account.
116
+ # config.confirm_within = 3.days
117
+
118
+ # If true, requires any email changes to be confirmed (exactly the same way as
119
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
120
+ # db field (see migrations). Until confirmed, new email is stored in
121
+ # unconfirmed_email column, and copied to email column on successful confirmation.
122
+ config.reconfirmable = true
123
+
124
+ # Defines which key will be used when confirming an account
125
+ # config.confirmation_keys = [ :email ]
126
+
127
+ # ==> Configuration for :rememberable
128
+ # The time the user will be remembered without asking for credentials again.
129
+ config.remember_for = 2.weeks
130
+
131
+ # Invalidates all the remember me tokens when the user signs out.
132
+ config.expire_all_remember_me_on_sign_out = true
133
+
134
+ # If true, extends the user's remember period when remembered via cookie.
135
+ # config.extend_remember_period = false
136
+
137
+ # Options to be passed to the created cookie. For instance, you can set
138
+ # secure: true in order to force SSL only cookies.
139
+ # config.rememberable_options = {}
140
+
141
+ # ==> Configuration for :validatable
142
+ # Range for password length.
143
+ config.password_length = 6..128
144
+
145
+ # Email regex used to validate email formats. It simply asserts that
146
+ # one (and only one) @ exists in the given string. This is mainly
147
+ # to give user feedback and not to assert the e-mail validity.
148
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
149
+
150
+ # ==> Configuration for :timeoutable
151
+ # The time you want to timeout the user session without activity. After this
152
+ # time the user will be asked for credentials again. Default is 30 minutes.
153
+ # config.timeout_in = 30.minutes
154
+ config.timeout_in = nil # Disable timeout by default
155
+
156
+ # If true, expires auth token on session timeout.
157
+ # config.expire_auth_token_on_timeout = false
158
+
159
+ # ==> Configuration for :lockable
160
+ # Defines which strategy will be used to lock an account.
161
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
162
+ # :none = No lock strategy. You should handle locking by yourself.
163
+ # config.lock_strategy = :failed_attempts
164
+
165
+ # Defines which key will be used when locking and unlocking an account
166
+ # config.unlock_keys = [ :email ]
167
+
168
+ # Defines which strategy will be used to unlock an account.
169
+ # :email = Sends an unlock link to the user email
170
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
171
+ # :both = Enables both strategies
172
+ # :none = No unlock strategy. You should handle unlocking by yourself.
173
+ # config.unlock_strategy = :both
174
+
175
+ # Number of authentication tries before locking an account if lock_strategy
176
+ # is failed attempts.
177
+ # config.maximum_attempts = 20
178
+
179
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
180
+ # config.unlock_in = 1.hour
181
+
182
+ # Warn on the last attempt before the account is locked.
183
+ # config.last_attempt_warning = true
184
+
185
+ # ==> Configuration for :recoverable
186
+ #
187
+ # Defines which key will be used when recovering the password for an account
188
+ # config.reset_password_keys = [ :email ]
189
+
190
+ # Time interval you can reset your password with a reset password key.
191
+ # Don't put a too small interval or your users won't have the time to
192
+ # change their passwords.
193
+ config.reset_password_within = 6.hours
194
+
195
+ # ==> Configuration for :encryptable
196
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
197
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
198
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
199
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
200
+ # REST_AUTH_SITE_KEY to pepper).
201
+ #
202
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
203
+ # config.encryptor = :sha512
204
+
205
+ # ==> Scopes configuration
206
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
207
+ # "users/sessions/new". It's turned off by default because it's slower if you
208
+ # are using only default views.
209
+ # config.scoped_views = false
210
+
211
+ # Configure the default scope given to Warden. By default it's the first
212
+ # devise role declared in your routes (usually :user).
213
+ # config.default_scope = :user
214
+
215
+ # Set this configuration to false if you want /users/sign_out to sign out
216
+ # only the current scope. By default, Devise signs out all scopes.
217
+ # config.sign_out_all_scopes = true
218
+
219
+ # ==> Navigation configuration
220
+ # Lists the formats that should be treated as navigational. Formats like
221
+ # :html, should redirect to the sign in page when the user does not have
222
+ # access, but formats like :xml or :json, should return 401.
223
+ #
224
+ # If you have any extra navigational formats, like :iphone or :mobile, you
225
+ # should add them to the navigational formats lists.
226
+ #
227
+ # The "*/*" below is required to match Internet Explorer requests.
228
+ # config.navigational_formats = ['*/*', :html]
229
+
230
+ # The default HTTP method used to sign out a resource. Default is :delete.
231
+ config.sign_out_via = :delete
232
+
233
+ # ==> OmniAuth
234
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
235
+ # up on your models and hooks.
236
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
237
+
238
+ # ==> Warden configuration
239
+ # If you want to use other strategies, that are not supported by Devise, or
240
+ # change the failure app, you can configure them inside the config.warden block.
241
+ #
242
+ # config.warden do |manager|
243
+ # manager.intercept_401 = false
244
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
245
+ # end
246
+ config.warden do |manager|
247
+ #manager.strategies.add(:remote_authenticatable, Devise::Strategies::RemoteAuthenticatable)
248
+ manager.default_strategies(scope: :user).unshift :remote_authenticatable
249
+ end
250
+
251
+ # ==> Mountable engine configurations
252
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
253
+ # is mountable, there are some extra configurations to be taken into account.
254
+ # The following options are available, assuming the engine is mounted as:
255
+ #
256
+ # mount MyEngine, at: '/my_engine'
257
+ #
258
+ # The router that invoked `devise_for`, in the example above, would be:
259
+ # config.router_name = :my_engine
260
+ config.router_name = :mno_enterprise
261
+
262
+ #
263
+ # When using omniauth, Devise cannot automatically set Omniauth path,
264
+ # so you need to do it manually. For the users scope, it would be:
265
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
266
+ #
267
+ # When using omniauth, Devise cannot automatically set Omniauth path,
268
+ # so you need to do it manually. For the users scope, it would be:
269
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
270
+ #
271
+ # Inherit from engine ApplicationController
272
+ config.parent_controller = 'MnoEnterprise::ApplicationController'
273
+ end