disco_app 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +37 -0
  3. data/app/assets/images/disco_app/icon.svg +1 -0
  4. data/app/assets/images/disco_app/icons.svg +0 -0
  5. data/app/assets/javascripts/disco_app/components/custom/filterable_shop_list.js.jsx +61 -0
  6. data/app/assets/javascripts/disco_app/components/custom/inline-radio-options.es6.jsx +59 -0
  7. data/app/assets/javascripts/disco_app/components/custom/rules-editor.es6.jsx +417 -0
  8. data/app/assets/javascripts/disco_app/components/custom/shop_filter_query.js.jsx +13 -0
  9. data/app/assets/javascripts/disco_app/components/custom/shop_filter_tab.js.jsx +34 -0
  10. data/app/assets/javascripts/disco_app/components/custom/shop_filter_tabs.js.jsx +21 -0
  11. data/app/assets/javascripts/disco_app/components/custom/shop_list.js.jsx +142 -0
  12. data/app/assets/javascripts/disco_app/components/custom/shop_row.js.jsx +43 -0
  13. data/app/assets/javascripts/disco_app/components/custom/shopify_admin_link.js.jsx +29 -0
  14. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-footer.es6.jsx +11 -0
  15. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-header.es6.jsx +11 -0
  16. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-section.es6.jsx +30 -0
  17. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card.es6.jsx +16 -0
  18. data/app/assets/javascripts/disco_app/components/ui-kit/cards/cart-section-title.es6.jsx +9 -0
  19. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_form.es6.jsx +72 -0
  20. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_input.es6.jsx +20 -0
  21. data/app/assets/javascripts/disco_app/components/ui-kit/forms/button.es6.jsx +13 -0
  22. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-radio.es6.jsx +30 -0
  23. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-select.es6.jsx +39 -0
  24. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-text.es6.jsx +59 -0
  25. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx +48 -0
  26. data/app/assets/javascripts/disco_app/components/ui-kit/icons/icon-chevron.es6.jsx +33 -0
  27. data/app/assets/javascripts/disco_app/components/ui-kit/icons/next-icon.es6.jsx +18 -0
  28. data/app/assets/javascripts/disco_app/components/ui-kit/input_select.es6.jsx +21 -0
  29. data/app/assets/javascripts/disco_app/components/ui-kit/tables/table.es6.jsx +22 -0
  30. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-annotated-section.es6.jsx +29 -0
  31. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-empty-state.es6.jsx +35 -0
  32. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-footer-help.es6.jsx +13 -0
  33. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-layout-item.es6.jsx +11 -0
  34. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-layout-section.es6.jsx +19 -0
  35. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-layout-sections.es6.jsx +11 -0
  36. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-layout.es6.jsx +11 -0
  37. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-page-actions.es6.jsx +48 -0
  38. data/app/assets/javascripts/disco_app/components.js +2 -0
  39. data/app/assets/javascripts/disco_app/disco_app.js +9 -0
  40. data/app/assets/javascripts/disco_app/frame.js +152 -0
  41. data/app/assets/javascripts/disco_app/shopify-turbolinks.js +7 -0
  42. data/app/assets/javascripts/disco_app/ui-kit.js +1 -0
  43. data/app/assets/stylesheets/disco_app/admin/_header.scss +75 -0
  44. data/app/assets/stylesheets/disco_app/admin/_layout.scss +32 -0
  45. data/app/assets/stylesheets/disco_app/admin/_nav.scss +184 -0
  46. data/app/assets/stylesheets/disco_app/admin.scss +11 -0
  47. data/app/assets/stylesheets/disco_app/disco_app.scss +19 -0
  48. data/app/assets/stylesheets/disco_app/frame/_buttons.scss +54 -0
  49. data/app/assets/stylesheets/disco_app/frame/_forms.scss +26 -0
  50. data/app/assets/stylesheets/disco_app/frame/_layout.scss +77 -0
  51. data/app/assets/stylesheets/disco_app/frame/_type.scss +25 -0
  52. data/app/assets/stylesheets/disco_app/frame.scss +10 -0
  53. data/app/assets/stylesheets/disco_app/mixins/_flexbox.scss +400 -0
  54. data/app/assets/stylesheets/disco_app/ui-kit/_ui-empty-state.scss +121 -0
  55. data/app/assets/stylesheets/disco_app/ui-kit/_ui-footer-help.scss +28 -0
  56. data/app/assets/stylesheets/disco_app/ui-kit/_ui-icons.scss +28 -0
  57. data/app/assets/stylesheets/disco_app/ui-kit/_ui-kit.scss +5113 -0
  58. data/app/assets/stylesheets/disco_app/ui-kit/_ui-layout.scss +15 -0
  59. data/app/assets/stylesheets/disco_app/ui-kit/_ui-page-actions.scss +21 -0
  60. data/app/assets/stylesheets/disco_app/ui-kit/_ui-tabs.scss +75 -0
  61. data/app/assets/stylesheets/disco_app/ui-kit/_ui-type.scss +13 -0
  62. data/app/controllers/disco_app/admin/app_settings_controller.rb +3 -0
  63. data/app/controllers/disco_app/admin/application_controller.rb +3 -0
  64. data/app/controllers/disco_app/admin/concerns/app_settings_controller.rb +24 -0
  65. data/app/controllers/disco_app/admin/concerns/authenticated_controller.rb +20 -0
  66. data/app/controllers/disco_app/admin/concerns/plans_controller.rb +54 -0
  67. data/app/controllers/disco_app/admin/concerns/shops_controller.rb +7 -0
  68. data/app/controllers/disco_app/admin/concerns/subscriptions_controller.rb +29 -0
  69. data/app/controllers/disco_app/admin/plans_controller.rb +3 -0
  70. data/app/controllers/disco_app/admin/resources/shops_controller.rb +3 -0
  71. data/app/controllers/disco_app/admin/shops_controller.rb +3 -0
  72. data/app/controllers/disco_app/admin/subscriptions_controller.rb +3 -0
  73. data/app/controllers/disco_app/charges_controller.rb +47 -0
  74. data/app/controllers/disco_app/concerns/app_proxy_controller.rb +40 -0
  75. data/app/controllers/disco_app/concerns/authenticated_controller.rb +56 -0
  76. data/app/controllers/disco_app/concerns/carrier_request_controller.rb +21 -0
  77. data/app/controllers/disco_app/frame_controller.rb +9 -0
  78. data/app/controllers/disco_app/install_controller.rb +27 -0
  79. data/app/controllers/disco_app/subscriptions_controller.rb +32 -0
  80. data/app/controllers/disco_app/webhooks_controller.rb +46 -0
  81. data/app/controllers/sessions_controller.rb +28 -0
  82. data/app/helpers/disco_app/application_helper.rb +50 -0
  83. data/app/jobs/disco_app/app_installed_job.rb +3 -0
  84. data/app/jobs/disco_app/app_uninstalled_job.rb +3 -0
  85. data/app/jobs/disco_app/concerns/app_installed_job.rb +39 -0
  86. data/app/jobs/disco_app/concerns/app_uninstalled_job.rb +20 -0
  87. data/app/jobs/disco_app/concerns/render_asset_group_job.rb +8 -0
  88. data/app/jobs/disco_app/concerns/shop_update_job.rb +13 -0
  89. data/app/jobs/disco_app/concerns/subscription_changed_job.rb +7 -0
  90. data/app/jobs/disco_app/concerns/synchronise_carrier_service_job.rb +52 -0
  91. data/app/jobs/disco_app/concerns/synchronise_webhooks_job.rb +61 -0
  92. data/app/jobs/disco_app/render_asset_group_job.rb +3 -0
  93. data/app/jobs/disco_app/shop_job.rb +27 -0
  94. data/app/jobs/disco_app/shop_update_job.rb +3 -0
  95. data/app/jobs/disco_app/subscription_changed_job.rb +3 -0
  96. data/app/jobs/disco_app/synchronise_carrier_service_job.rb +3 -0
  97. data/app/jobs/disco_app/synchronise_webhooks_job.rb +3 -0
  98. data/app/models/disco_app/app_settings.rb +3 -0
  99. data/app/models/disco_app/application_charge.rb +18 -0
  100. data/app/models/disco_app/concerns/app_settings.rb +7 -0
  101. data/app/models/disco_app/concerns/plan.rb +26 -0
  102. data/app/models/disco_app/concerns/plan_code.rb +15 -0
  103. data/app/models/disco_app/concerns/renders_assets.rb +166 -0
  104. data/app/models/disco_app/concerns/shop.rb +63 -0
  105. data/app/models/disco_app/concerns/subscription.rb +60 -0
  106. data/app/models/disco_app/concerns/synchronises.rb +39 -0
  107. data/app/models/disco_app/plan.rb +3 -0
  108. data/app/models/disco_app/plan_code.rb +3 -0
  109. data/app/models/disco_app/recurring_application_charge.rb +18 -0
  110. data/app/models/disco_app/session_storage.rb +18 -0
  111. data/app/models/disco_app/shop.rb +3 -0
  112. data/app/models/disco_app/subscription.rb +3 -0
  113. data/app/resources/disco_app/admin/resources/concerns/shop_resource.rb +100 -0
  114. data/app/resources/disco_app/admin/resources/shop_resource.rb +4 -0
  115. data/app/services/disco_app/carrier_request_service.rb +15 -0
  116. data/app/services/disco_app/charges_service.rb +81 -0
  117. data/app/services/disco_app/proxy_service.rb +17 -0
  118. data/app/services/disco_app/subscription_service.rb +46 -0
  119. data/app/services/disco_app/webhook_service.rb +30 -0
  120. data/app/views/disco_app/admin/app_settings/edit.html.erb +5 -0
  121. data/app/views/disco_app/admin/plans/_form.html.erb +72 -0
  122. data/app/views/disco_app/admin/plans/_plan_code_fields.html.erb +15 -0
  123. data/app/views/disco_app/admin/plans/edit.html.erb +7 -0
  124. data/app/views/disco_app/admin/plans/index.html.erb +43 -0
  125. data/app/views/disco_app/admin/plans/new.html.erb +7 -0
  126. data/app/views/disco_app/admin/shops/index.html.erb +13 -0
  127. data/app/views/disco_app/admin/subscriptions/edit.html.erb +33 -0
  128. data/app/views/disco_app/charges/activate.html.erb +1 -0
  129. data/app/views/disco_app/charges/create.html.erb +1 -0
  130. data/app/views/disco_app/charges/new.html.erb +12 -0
  131. data/app/views/disco_app/frame/frame.html.erb +36 -0
  132. data/app/views/disco_app/install/installing.html.erb +7 -0
  133. data/app/views/disco_app/install/uninstalling.html.erb +1 -0
  134. data/app/views/disco_app/proxy_errors/404.html.erb +1 -0
  135. data/app/views/disco_app/shared/_card.html.erb +14 -0
  136. data/app/views/disco_app/shared/_icons.html.erb +3 -0
  137. data/app/views/disco_app/shared/_section.html.erb +17 -0
  138. data/app/views/disco_app/subscriptions/new.html.erb +25 -0
  139. data/app/views/layouts/admin/_nav_items.erb +20 -0
  140. data/app/views/layouts/admin.html.erb +67 -0
  141. data/app/views/layouts/application.html.erb +18 -0
  142. data/app/views/layouts/embedded_app.html.erb +44 -0
  143. data/app/views/layouts/embedded_app_modal.html.erb +28 -0
  144. data/app/views/sessions/new.html.erb +26 -0
  145. data/config/routes.rb +48 -0
  146. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +15 -0
  147. data/db/migrate/20150525162112_add_status_to_shops.rb +5 -0
  148. data/db/migrate/20150525171422_add_meta_to_shops.rb +11 -0
  149. data/db/migrate/20150629210346_add_charge_status_to_shop.rb +5 -0
  150. data/db/migrate/20150814214025_add_more_meta_to_shops.rb +15 -0
  151. data/db/migrate/20151017231302_create_disco_app_plans.rb +13 -0
  152. data/db/migrate/20151017232027_create_disco_app_subscriptions.rb +15 -0
  153. data/db/migrate/20151017234409_move_shop_to_disco_app_engine.rb +5 -0
  154. data/db/migrate/20160112233706_create_disco_app_sessions.rb +12 -0
  155. data/db/migrate/20160113194418_add_shop_id_to_disco_app_sessions.rb +6 -0
  156. data/db/migrate/20160223111044_create_disco_app_settings.rb +8 -0
  157. data/db/migrate/20160301223215_update_plans.rb +22 -0
  158. data/db/migrate/20160301224558_update_subscriptions.rb +13 -0
  159. data/db/migrate/20160302104816_create_disco_app_recurring_application_charges.rb +14 -0
  160. data/db/migrate/20160302105259_create_disco_app_application_charges.rb +14 -0
  161. data/db/migrate/20160302134728_drop_charge_status_from_shops.rb +5 -0
  162. data/db/migrate/20160302142941_add_shopify_attributes_to_charges.rb +8 -0
  163. data/db/migrate/20160331093148_create_disco_app_plan_codes.rb +14 -0
  164. data/db/migrate/20160401044420_add_status_to_plan_codes.rb +5 -0
  165. data/db/migrate/20160401045551_add_amount_and_plan_code_to_disco_app_subscriptions.rb +7 -0
  166. data/db/migrate/20160425205211_add_source_to_disco_app_subscriptions.rb +5 -0
  167. data/db/migrate/20160426033520_add_trial_period_days_to_disco_app_subscriptions.rb +5 -0
  168. data/db/migrate/20160513140727_add_name_to_disco_app_shops.rb +5 -0
  169. data/db/migrate/20160521135510_move_shop_to_synchronises.rb +61 -0
  170. data/lib/disco_app/configuration.rb +39 -0
  171. data/lib/disco_app/constants.rb +4 -0
  172. data/lib/disco_app/engine.rb +26 -0
  173. data/lib/disco_app/session.rb +14 -0
  174. data/lib/disco_app/support/file_fixtures.rb +23 -0
  175. data/lib/disco_app/test_help.rb +11 -0
  176. data/lib/disco_app/version.rb +3 -0
  177. data/lib/disco_app.rb +7 -0
  178. data/lib/generators/disco_app/USAGE +5 -0
  179. data/lib/generators/disco_app/disco_app_generator.rb +235 -0
  180. data/lib/generators/disco_app/templates/assets/javascripts/application.js +17 -0
  181. data/lib/generators/disco_app/templates/assets/javascripts/components.js +3 -0
  182. data/lib/generators/disco_app/templates/assets/stylesheets/application.scss +5 -0
  183. data/lib/generators/disco_app/templates/config/database.yml.tt +20 -0
  184. data/lib/generators/disco_app/templates/config/newrelic.yml +26 -0
  185. data/lib/generators/disco_app/templates/config/puma.rb +15 -0
  186. data/lib/generators/disco_app/templates/controllers/home_controller.rb +7 -0
  187. data/lib/generators/disco_app/templates/initializers/disco_app.rb +19 -0
  188. data/lib/generators/disco_app/templates/initializers/rollbar.rb +12 -0
  189. data/lib/generators/disco_app/templates/initializers/session_store.rb +2 -0
  190. data/lib/generators/disco_app/templates/initializers/shopify_app.rb +7 -0
  191. data/lib/generators/disco_app/templates/initializers/shopify_session_repository.rb +7 -0
  192. data/lib/generators/disco_app/templates/root/CHECKS +4 -0
  193. data/lib/generators/disco_app/templates/root/Procfile +2 -0
  194. data/lib/generators/disco_app/templates/views/home/index.html.erb +2 -0
  195. data/lib/tasks/carrier_service.rake +10 -0
  196. data/lib/tasks/database.rake +8 -0
  197. data/lib/tasks/sessions.rake +9 -0
  198. data/lib/tasks/shops.rake +10 -0
  199. data/lib/tasks/start.rake +3 -0
  200. data/lib/tasks/webhooks.rake +10 -0
  201. data/test/controllers/disco_app/admin/shops_controller_test.rb +54 -0
  202. data/test/controllers/disco_app/charges_controller_test.rb +99 -0
  203. data/test/controllers/disco_app/install_controller_test.rb +50 -0
  204. data/test/controllers/disco_app/subscriptions_controller_test.rb +68 -0
  205. data/test/controllers/disco_app/webhooks_controller_test.rb +58 -0
  206. data/test/controllers/home_controller_test.rb +92 -0
  207. data/test/controllers/proxy_controller_test.rb +42 -0
  208. data/test/disco_app_test.rb +7 -0
  209. data/test/dummy/Rakefile +6 -0
  210. data/test/dummy/app/assets/javascripts/application.js +17 -0
  211. data/test/dummy/app/assets/stylesheets/application.scss +5 -0
  212. data/test/dummy/app/controllers/application_controller.rb +6 -0
  213. data/test/dummy/app/controllers/disco_app/admin/shops_controller.rb +8 -0
  214. data/test/dummy/app/controllers/home_controller.rb +7 -0
  215. data/test/dummy/app/controllers/proxy_controller.rb +8 -0
  216. data/test/dummy/app/helpers/application_helper.rb +2 -0
  217. data/test/dummy/app/jobs/disco_app/app_installed_job.rb +16 -0
  218. data/test/dummy/app/jobs/disco_app/app_uninstalled_job.rb +11 -0
  219. data/test/dummy/app/jobs/products_create_job.rb +7 -0
  220. data/test/dummy/app/jobs/products_delete_job.rb +7 -0
  221. data/test/dummy/app/jobs/products_update_job.rb +7 -0
  222. data/test/dummy/app/models/disco_app/shop.rb +15 -0
  223. data/test/dummy/app/models/js_configuration.rb +8 -0
  224. data/test/dummy/app/models/product.rb +6 -0
  225. data/test/dummy/app/models/widget_configuration.rb +10 -0
  226. data/test/dummy/app/views/assets/script_tag.js.erb +1 -0
  227. data/test/dummy/app/views/assets/test.js.erb +1 -0
  228. data/test/dummy/app/views/assets/widget.js.erb +2 -0
  229. data/test/dummy/app/views/assets/widget.scss.erb +3 -0
  230. data/test/dummy/app/views/home/index.html.erb +2 -0
  231. data/test/dummy/app/views/snippets/widget.liquid.erb +1 -0
  232. data/test/dummy/bin/bundle +3 -0
  233. data/test/dummy/bin/rails +4 -0
  234. data/test/dummy/bin/rake +4 -0
  235. data/test/dummy/bin/setup +29 -0
  236. data/test/dummy/config/application.rb +38 -0
  237. data/test/dummy/config/boot.rb +5 -0
  238. data/test/dummy/config/database.codeship.yml +23 -0
  239. data/test/dummy/config/database.gitlab-ci.yml +24 -0
  240. data/test/dummy/config/database.yml +20 -0
  241. data/test/dummy/config/environment.rb +5 -0
  242. data/test/dummy/config/environments/development.rb +41 -0
  243. data/test/dummy/config/environments/production.rb +85 -0
  244. data/test/dummy/config/environments/test.rb +42 -0
  245. data/test/dummy/config/initializers/assets.rb +11 -0
  246. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  247. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  248. data/test/dummy/config/initializers/disco_app.rb +19 -0
  249. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  250. data/test/dummy/config/initializers/inflections.rb +16 -0
  251. data/test/dummy/config/initializers/mime_types.rb +4 -0
  252. data/test/dummy/config/initializers/omniauth.rb +9 -0
  253. data/test/dummy/config/initializers/session_store.rb +2 -0
  254. data/test/dummy/config/initializers/shopify_app.rb +7 -0
  255. data/test/dummy/config/initializers/shopify_session_repository.rb +7 -0
  256. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  257. data/test/dummy/config/locales/en.yml +23 -0
  258. data/test/dummy/config/routes.rb +10 -0
  259. data/test/dummy/config/secrets.yml +22 -0
  260. data/test/dummy/config.ru +4 -0
  261. data/test/dummy/db/migrate/20160307182229_create_products.rb +11 -0
  262. data/test/dummy/db/migrate/20160530160739_create_asset_models.rb +19 -0
  263. data/test/dummy/db/schema.rb +141 -0
  264. data/test/dummy/public/404.html +67 -0
  265. data/test/dummy/public/422.html +67 -0
  266. data/test/dummy/public/500.html +66 -0
  267. data/test/dummy/public/favicon.ico +0 -0
  268. data/test/fixtures/api/widget_store/assets/create_script_tag_js_request.json +6 -0
  269. data/test/fixtures/api/widget_store/assets/create_script_tag_js_response.json +12 -0
  270. data/test/fixtures/api/widget_store/assets/create_script_tag_request.json +6 -0
  271. data/test/fixtures/api/widget_store/assets/create_script_tag_response.json +10 -0
  272. data/test/fixtures/api/widget_store/assets/create_test_js_request.json +6 -0
  273. data/test/fixtures/api/widget_store/assets/create_test_js_response.json +12 -0
  274. data/test/fixtures/api/widget_store/assets/create_widget_js_request.json +6 -0
  275. data/test/fixtures/api/widget_store/assets/create_widget_js_response.json +12 -0
  276. data/test/fixtures/api/widget_store/assets/create_widget_liquid_request.json +6 -0
  277. data/test/fixtures/api/widget_store/assets/create_widget_liquid_response.json +12 -0
  278. data/test/fixtures/api/widget_store/assets/create_widget_scss_request.json +6 -0
  279. data/test/fixtures/api/widget_store/assets/create_widget_scss_response.json +12 -0
  280. data/test/fixtures/api/widget_store/assets/get_script_tags_empty_request.json +1 -0
  281. data/test/fixtures/api/widget_store/assets/get_script_tags_empty_response.json +1 -0
  282. data/test/fixtures/api/widget_store/assets/get_script_tags_preexisting_request.json +1 -0
  283. data/test/fixtures/api/widget_store/assets/get_script_tags_preexisting_response.json +12 -0
  284. data/test/fixtures/api/widget_store/assets/update_script_tag_request.json +10 -0
  285. data/test/fixtures/api/widget_store/assets/update_script_tag_response.json +10 -0
  286. data/test/fixtures/api/widget_store/charges/activate_application_charge_request.json +16 -0
  287. data/test/fixtures/api/widget_store/charges/activate_application_charge_response.json +1 -0
  288. data/test/fixtures/api/widget_store/charges/activate_recurring_application_charge_request.json +20 -0
  289. data/test/fixtures/api/widget_store/charges/activate_recurring_application_charge_response.json +1 -0
  290. data/test/fixtures/api/widget_store/charges/create_application_charge_request.json +9 -0
  291. data/test/fixtures/api/widget_store/charges/create_application_charge_response.json +16 -0
  292. data/test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json +9 -0
  293. data/test/fixtures/api/widget_store/charges/create_recurring_application_charge_response.json +20 -0
  294. data/test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json +9 -0
  295. data/test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_response.json +20 -0
  296. data/test/fixtures/api/widget_store/charges/get_accepted_application_charge_response.json +16 -0
  297. data/test/fixtures/api/widget_store/charges/get_accepted_recurring_application_charge_response.json +20 -0
  298. data/test/fixtures/api/widget_store/charges/get_declined_application_charge_response.json +16 -0
  299. data/test/fixtures/api/widget_store/charges/get_declined_recurring_application_charge_response.json +20 -0
  300. data/test/fixtures/api/widget_store/charges/get_pending_application_charge_response.json +16 -0
  301. data/test/fixtures/api/widget_store/charges/get_pending_recurring_application_charge_response.json +20 -0
  302. data/test/fixtures/api/widget_store/shop.json +46 -0
  303. data/test/fixtures/api/widget_store/webhooks.json +1 -0
  304. data/test/fixtures/assets/test.js +1 -0
  305. data/test/fixtures/assets/test.min.js +1 -0
  306. data/test/fixtures/disco_app/application_charges.yml +11 -0
  307. data/test/fixtures/disco_app/plan_codes.yml +13 -0
  308. data/test/fixtures/disco_app/plans.yml +37 -0
  309. data/test/fixtures/disco_app/recurring_application_charges.yml +11 -0
  310. data/test/fixtures/disco_app/shops.yml +10 -0
  311. data/test/fixtures/disco_app/subscriptions.yml +22 -0
  312. data/test/fixtures/js_configurations.yml +3 -0
  313. data/test/fixtures/products.yml +4 -0
  314. data/test/fixtures/webhooks/app_uninstalled.json +46 -0
  315. data/test/fixtures/webhooks/product_created.json +167 -0
  316. data/test/fixtures/webhooks/product_deleted.json +3 -0
  317. data/test/fixtures/webhooks/product_updated.json +167 -0
  318. data/test/fixtures/widget_configurations.yml +4 -0
  319. data/test/integration/synchronises_test.rb +55 -0
  320. data/test/jobs/disco_app/app_installed_job_test.rb +55 -0
  321. data/test/jobs/disco_app/app_uninstalled_job_test.rb +30 -0
  322. data/test/models/disco_app/plan_test.rb +5 -0
  323. data/test/models/disco_app/renders_assets_test.rb +109 -0
  324. data/test/models/disco_app/session_test.rb +31 -0
  325. data/test/models/disco_app/shop_test.rb +27 -0
  326. data/test/models/disco_app/subscription_test.rb +19 -0
  327. data/test/services/disco_app/charges_service_test.rb +112 -0
  328. data/test/services/disco_app/subscription_service_test.rb +60 -0
  329. data/test/support/test_file_fixtures.rb +29 -0
  330. data/test/support/test_shopify_api.rb +16 -0
  331. data/test/test_helper.rb +55 -0
  332. metadata +827 -0
@@ -0,0 +1,3 @@
1
+ <div style="display: none;">
2
+ <svg xmlns="http://www.w3.org/2000/svg"><symbol id="next-products"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M21.8 1h-7c-.8 0-1.5.3-2 .8L1.4 13.2c-.5.5-.5 1.3 0 1.8L9 22.7c.5.5 1.3.5 1.8 0l11.3-11.4c.5-.5.8-1.3.8-2v-7c.1-.7-.4-1.3-1.1-1.3zm-4 7.6c-1.3 0-2.3-1.1-2.3-2.3C15.5 5 16.6 4 17.8 4c1.3 0 2.3 1.1 2.3 2.3 0 1.3-1 2.3-2.3 2.3z"/></svg></symbol><symbol id="rte-html"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-html</title><desc>Created with Sketch.</desc><path d="M5 4.406l-3.761 1.603 3.761 1.591v1.4l-5-2.334v-1.327l5-2.339v1.406zm2 0v-1.406l5 2.339v1.327l-5 2.334v-1.4l3.761-1.591-3.761-1.603z" sketch:type="MSShapeGroup" fill="#000"/></svg></symbol><symbol id="rte-formatting"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 3 12 12" enable-background="new -1 3 12 12"><title>rte-formatting</title><desc>Created with Sketch.</desc><path d="M10.9 13.2c-.1 0-.3 0-.5-.1-.2 0-.3-.1-.4-.2-.2-.1-.3-.2-.4-.3-.1-.1-.2-.3-.2-.4l-3.9-9.1v-.1h-.8v.1c-.6 1.3-1.2 2.8-1.9 4.4-.7 1.7-1.4 3.2-1.9 4.5l-.3.6c-.1.1-.3.3-.5.4-.1 0-.3.1-.5.1s-.4.1-.5.1h-.1v.8h4.6v-.8h-.1c-.4 0-.8-.1-1.1-.2-.3-.1-.4-.2-.4-.3v-.3c0-.1.1-.3.1-.5l.3-.7c.1-.2.3-.8.5-1.2h3.5l1 2.6v.2s0 .1-.3.1c-.3.1-.6.1-1 .1h-.1v1h5v-.8h-.1zm-5-4.2h-2.7l1.3-3.2 1.4 3.2z"/></svg></symbol><symbol id="next-disclosure"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M4.8 8h14.4c.6 0 .9.7.6 1.2l-7.2 8.9c-.3.4-.8.4-1.1 0L4.2 9.2c-.4-.5 0-1.2.6-1.2z"/></svg></symbol><symbol id="rte-bold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 3 12 12" enable-background="new -1 3 12 12"><title>rte-bold</title><desc>Created with Sketch.</desc><path d="M9.7 9.8c-.3-.5-.4-.6-.7-.8-.3-.3-.7-.4-1.1-.6-.4-.1-.8-.2-1.1-.2v-.2l1-.3c.3-.2.6-.3.8-.5.3-.2.5-.5.6-.8.2-.3.2-.6.2-1 0-.8-.3-1.4-.9-1.8-.6-.4-1.6-.6-3-.6h-5.5v.7c.2.1.4.1.5.2.2.1.4.2.4.3.1.1.1.3.1.5v7.7c0 .2 0 .4-.1.5-.1.1-.2.2-.4.3-.1.1-.2.1-.4.1h-.1v.7h5.3c.7 0 1.4 0 2-.1.5-.1 1-.3 1.4-.6.4-.2.8-.5 1-.9.2-.3.3-.8.3-1.4 0-.4 0-.7-.3-1.2zm-6.2-6.1h1.3c.6 0 1.1.2 1.4.5.3.4.5.8.5 1.4 0 .7-.2 1.2-.6 1.6-.4.4-.9.6-1.7.6h-.9v-4.1zm3.1 9c-.3.4-.8.6-1.4.6-.3 0-1-.1-1.3-.2-.2-.1-.3-.3-.4-.5v-4h.7c.8 0 1.9.2 2.3.6.5.4.7 1 .7 1.7 0 .8-.2 1.4-.6 1.8z"/></svg></symbol><symbol id="rte-italic"><svg xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns="http://www.w3.org/2000/svg" viewBox="-1 3 12 12" enable-background="new -1 3 12 12"><title>rte-italic</title><desc>Created with Sketch.</desc><path sketch:type="MSShapeGroup" d="M9 3l-.3 1c-.1 0-.4 0-.6.1-.3 0-.5.1-.6.1-.3.1-.5.2-.6.3l-.2.5-1.7 7v.2c0 .1 0 .2.1.3.1.1.2.2.3.2.1 0 .3.1.5.1.3.2.5.2.6.2l-.2 1h-5.3l.2-1h.7s.5-.1.6-.1c.2-.1.4-.2.5-.3.1-.1.2-.3.2-.5l1.8-7v-.30000000000000004c0-.1 0-.2-.1-.3 0-.1-.1-.1-.3-.2-.1-.1-.3-.1-.6-.2-.2 0-.4-.1-.5-.1l.2-1h5.3z"/></svg></symbol><symbol id="rte-list"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-list</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><rect sketch:type="MSShapeGroup" width="9" height="2" rx="1" transform="translate(3 5)"/><rect sketch:type="MSShapeGroup" x="3" y="1" width="9" height="2" rx="1"/><rect sketch:type="MSShapeGroup" x="3" y="9" width="9" height="2" rx="1"/><circle sketch:type="MSShapeGroup" cx="1" cy="2" r="1"/><circle sketch:type="MSShapeGroup" cx="1" cy="6" r="1"/><circle sketch:type="MSShapeGroup" cx="1" cy="10" r="1"/></g></svg></symbol><symbol id="rte-list-ordered"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-list-ordered</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><rect sketch:type="MSShapeGroup" width="9" height="2" rx="1" transform="translate(3 5)"/><path d="M0 2.479h.697v-1.943l-.648.152v-.533l.653-.148h.602v2.472h.697v.521h-2v-.521z" sketch:type="MSShapeGroup"/><rect sketch:type="MSShapeGroup" x="3" y="1" width="9" height="2" rx="1"/><path d="M.685 6.481h1.35v.512h-2.035v-.496l.343-.335.743-.734c.107-.113.185-.213.232-.3.047-.087.071-.174.071-.259 0-.131-.043-.233-.13-.304-.087-.072-.209-.107-.368-.107-.113 0-.24.021-.381.062-.141.041-.288.101-.441.18v-.541c.153-.051.303-.09.45-.117.147-.027.287-.04.422-.04.339 0 .606.073.8.218.194.145.291.343.291.594 0 .116-.021.224-.063.325-.042.101-.115.213-.218.337-.076.089-.284.29-.625.603l-.44.406z" sketch:type="MSShapeGroup"/><rect sketch:type="MSShapeGroup" x="3" y="9" width="9" height="2" rx="1"/><path d="M.88 9.646h-.328v-.502h.328c.152 0 .27-.028.354-.084.084-.056.126-.135.126-.237 0-.107-.042-.19-.126-.25-.084-.06-.202-.09-.354-.09-.116 0-.241.014-.374.041-.133.027-.271.066-.413.118v-.518c.143-.04.283-.071.421-.092.138-.021.271-.032.399-.032.327 0 .581.066.764.199.183.133.274.316.274.549 0 .171-.053.311-.158.42-.105.109-.255.18-.45.214.221.036.39.118.506.246.116.128.174.297.174.505 0 .28-.096.493-.289.64-.192.147-.472.22-.839.22-.156 0-.31-.012-.462-.037-.152-.024-.296-.06-.435-.106v-.529c.13.061.271.107.421.138.151.032.309.047.475.047.166 0 .298-.036.394-.107.097-.071.145-.168.145-.289 0-.148-.048-.262-.145-.343-.097-.081-.234-.121-.411-.121z" sketch:type="MSShapeGroup"/></g></svg></symbol><symbol id="rte-outdent"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-outdent</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><g sketch:type="MSLayerGroup"><rect sketch:type="MSShapeGroup" width="12" height="2" rx="1"/><path d="M6 4c0-.552.439-1 .996-1h4.538-.542c.557 0 1.008.444 1.008 1 0 .552-.451 1-.991 1h-4.018c-.547 0-.991-.444-.991-1z" sketch:type="MSShapeGroup"/><rect sketch:type="MSShapeGroup" x="6" y="6" width="6" height="2" rx="1"/><rect sketch:type="MSShapeGroup" y="9" width="12" height="2" rx="1"/></g><path sketch:type="MSShapeGroup" d="M0 5.48l4-2.48v5z"/></g></svg></symbol><symbol id="rte-indent"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-indent</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><g sketch:type="MSLayerGroup"><rect sketch:type="MSShapeGroup" width="12" height="2" rx="1"/><path d="M6 4c0-.552.439-1 .996-1h4.538-.542c.557 0 1.008.444 1.008 1 0 .552-.451 1-.991 1h-4.018c-.547 0-.991-.444-.991-1z" sketch:type="MSShapeGroup"/><rect sketch:type="MSShapeGroup" x="6" y="6" width="6" height="2" rx="1"/><rect sketch:type="MSShapeGroup" y="9" width="12" height="2" rx="1"/></g><path sketch:type="MSShapeGroup" d="M4 5.48l-4-2.48v5z"/></g></svg></symbol><symbol id="rte-justify"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-justify</title><desc>Created with Sketch.</desc><g sketch:type="MSLayerGroup" transform="translate(-1)" fill="#000"><rect sketch:type="MSShapeGroup" x=".994" width="6.003" height="2" rx="1"/><path d="M.994 4c0-.552.454-1 1.009-1h7.992c.554 0 1.004.444 1.004 1 0 .552-.456 1-.996 1h-8.013c-.55 0-.996-.444-.996-1z" sketch:type="MSShapeGroup"/><rect sketch:type="MSShapeGroup" x=".994" y="6" width="8.006" height="2" rx="1"/><rect sketch:type="MSShapeGroup" x=".994" y="9" width="12.006" height="2" rx="1"/></g></svg></symbol><symbol id="rte-color"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 3 12 12" enable-background="new -1 3 12 12"><title>rte-color</title><desc>Created with Sketch.</desc><path d="M8.9 10.3c-.1 0-.2 0-.3-.1l-.3-.1-.3-.1-.1-.3-2.5-6.7h-.7v.2c-.4.9-.8 1.9-1.2 3.1-.5 1.2-.9 2.2-1.3 3.2 0 .2-.1.3-.2.4 0 .1-.1.2-.3.3l-.3.1-.3.1h-.1v.6h3.1v-.7h-.1c-.3 0-.5-.1-.7-.1-.2-.1-.3-.1-.3-.2v-.2c0-.1 0-.2.1-.4 0-.2.1-.3.2-.5.1-.1.3-.7.3-.9h2.2l.7 2v.2s-.1 0-.2.1c-.2 0-.4.1-.7.1h-.1v.6h3.5v-.7h-.1zm-3.4-3h-1.6l.8-2.1.8 2.1zM8 12h-6c-.6 0-1 .4-1 1 0 .5.4 1 1 1h6c.6 0 1-.4 1-1 0-.5-.4-1-1-1z"/></svg></symbol><symbol id="rte-link"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-link</title><desc>Created with Sketch.</desc><path d="M7.606 4.394c1.044 1.066 1.057 2.798 0 3.855l-.643.643-.643.643-.643.643c-1.062 1.062-2.791 1.064-3.855 0-1.068-1.068-1.066-2.789 0-3.855l.871-.871c-.045.714.121 1.439.496 2.075l-.081.081c-.357.357-.358.927 0 1.285.354.354.932.353 1.285 0l.643-.643.643-.643.643-.643c.354-.354.354-.931 0-1.285l.643-.643.643-.643zm-3.213 3.213c-1.044-1.066-1.057-2.798 0-3.855l.643-.643.643-.643.643-.643c1.062-1.062 2.791-1.064 3.855 0 1.068 1.068 1.066 2.789 0 3.855l-.871.871c.045-.714-.121-1.439-.496-2.075l.081-.081c.357-.357.358-.927 0-1.285-.354-.354-.932-.353-1.285 0l-.643.643-.643.643-.643.643c-.354.354-.354.931 0 1.285l-.643.643-.643.643z" sketch:type="MSShapeGroup" fill="#000"/></svg></symbol><symbol id="rte-table"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-table</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><rect sketch:type="MSShapeGroup" width="12" height="2" rx="1"/><path d="M12 10c0 .552-.456 1-1.002 1h-9.995c-.554 0-1.002-.444-1.002-1h12z" sketch:type="MSShapeGroup"/><path d="M12 1.002v8.995c0 .554-.444 1.002-1 1.002v-11c.552 0 1 .456 1 1.002z" sketch:type="MSShapeGroup"/><path d="M0 1.002v8.995c0 .554.444 1.002 1 1.002v-11c-.552 0-1 .456-1 1.002z" sketch:type="MSShapeGroup"/><path d="M10.5 5h.5v-1h-10v1h9.5z" id="Line" sketch:type="MSShapeGroup"/><path d="M10.5 8h.5v-1h-10v1h9.5z" sketch:type="MSShapeGroup"/><path d="M4 9.5v.5h1v-8h-1v7.5zM7 9.5v.5h1v-8h-1v7.5z" sketch:type="MSShapeGroup"/></g></svg></symbol><symbol id="rte-image"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-image</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><path d="M12 10c0 .552-.456 1-1.002 1h-9.995c-.554 0-1.002-.444-1.002-1h12z" sketch:type="MSShapeGroup"/><path d="M12 1c0-.552-.456-1-1.002-1h-9.995c-.554 0-1.002.444-1.002 1h12z" sketch:type="MSShapeGroup"/><path d="M12 1.002v8.995c0 .554-.444 1.002-1 1.002v-11c.552 0 1 .456 1 1.002z" sketch:type="MSShapeGroup"/><path d="M0 1.002v8.995c0 .554.444 1.002 1 1.002v-11c-.552 0-1 .456-1 1.002z" sketch:type="MSShapeGroup"/><circle sketch:type="MSShapeGroup" cx="3.5" cy="3.5" r="1.5"/><path d="M5.463 7.951l-1.463-1.951-3 4h10v-4.2l-2-2.8-3.537 4.951z" sketch:type="MSShapeGroup"/></g></svg></symbol><symbol id="rte-camera"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-camera</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><rect sketch:type="MSShapeGroup" y="2" width="9" height="8" rx="1"/><path d="M12 3v6l-5-3 5-3z" sketch:type="MSShapeGroup"/></g></svg></symbol><symbol id="rte-clear"><svg xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="12" height="12" viewBox="0 0 12 12"><title>rte-clear</title><desc>Created with Sketch.</desc><g sketch:type="MSArtboardGroup" fill="#000"><path d="M8.293 9.707l.707.707 1.414-1.414-.707-.707-6-6-.707-.707-1.414 1.414.707.707 6 6z" sketch:type="MSShapeGroup"/><path d="M12 6c0-3.314-2.686-6-6-6s-6 2.686-6 6 2.686 6 6 6 6-2.686 6-6zm-10 0c0-2.209 1.791-4 4-4s4 1.791 4 4-1.791 4-4 4-4-1.791-4-4z" sketch:type="MSShapeGroup"/></g></svg></symbol><symbol id="next-remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M19.5 22c-.2 0-.5-.1-.7-.3L12 14.9l-6.8 6.8c-.2.2-.4.3-.7.3-.2 0-.5-.1-.7-.3l-1.6-1.6c-.1-.2-.2-.4-.2-.6 0-.2.1-.5.3-.7L9.1 12 2.3 5.2C2.1 5 2 4.8 2 4.5c0-.2.1-.5.3-.7l1.6-1.6c.2-.1.4-.2.6-.2.3 0 .5.1.7.3L12 9.1l6.8-6.8c.2-.2.4-.3.7-.3.2 0 .5.1.7.3l1.6 1.6c.1.2.2.4.2.6 0 .2-.1.5-.3.7L14.9 12l6.8 6.8c.2.2.3.4.3.7 0 .2-.1.5-.3.7l-1.6 1.6c-.2.1-.4.2-.6.2z"/></svg></symbol><symbol id="next-photos-80"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path d="M80 57.6l-4-18.7v-23.9c0-1.1-.9-2-2-2h-3.5l-1.1-5.4c-.3-1.1-1.4-1.8-2.4-1.6l-32.6 7h-27.4c-1.1 0-2 .9-2 2v4.3l-3.4.7c-1.1.2-1.8 1.3-1.5 2.4l5 23.4v20.2c0 1.1.9 2 2 2h2.7l.9 4.4c.2.9 1 1.6 2 1.6h.4l27.9-6h33c1.1 0 2-.9 2-2v-5.5l2.4-.5c1.1-.2 1.8-1.3 1.6-2.4zm-75-21.5l-3-14.1 3-.6v14.7zm62.4-28.1l1.1 5h-24.5l23.4-5zm-54.8 64l-.8-4h19.6l-18.8 4zm37.7-6h-43.3v-51h67v51h-23.7zm25.7-7.5v-9.9l2 9.4-2 .5zm-52-21.5c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm0-8c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3zm-13-10v43h59v-43h-59zm57 2v24.1l-12.8-12.8c-3-3-7.9-3-11 0l-13.3 13.2-.1-.1c-1.1-1.1-2.5-1.7-4.1-1.7-1.5 0-3 .6-4.1 1.7l-9.6 9.8v-34.2h55zm-55 39v-2l11.1-11.2c1.4-1.4 3.9-1.4 5.3 0l9.7 9.7c-5.2 1.3-9 2.4-9.4 2.5l-3.7 1h-13zm55 0h-34.2c7.1-2 23.2-5.9 33-5.9l1.2-.1v6zm-1.3-7.9c-7.2 0-17.4 2-25.3 3.9l-9.1-9.1 13.3-13.3c2.2-2.2 5.9-2.2 8.1 0l14.3 14.3v4.1l-1.3.1z"/></svg></symbol><symbol id="next-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M23.6 5L22 3.4c-.5-.4-1.2-.4-1.7 0L8.5 15l-4.8-4.7c-.5-.4-1.2-.4-1.7 0L.3 11.9c-.5.4-.5 1.2 0 1.6l7.3 7.1c.5.4 1.2.4 1.7 0l14.3-14c.5-.4.5-1.1 0-1.6z"/></svg></symbol><symbol id="next-chevron-down"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M21 5.176l-9.086 9.353-8.914-9.353-2.314 2.471 11.314 11.735 11.314-11.735-2.314-2.471z"/></svg></symbol><symbol id="next-calendar"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><path d="M21 3h-1V2c0-1.1-.9-2-2-2s-2 .9-2 2v1H8V2c0-1.1-.9-2-2-2S4 .9 4 2v1H3C1.3 3 0 4.3 0 6v15c0 1.7 1.3 3 3 3h18c1.7 0 3-1.3 3-3V6c0-1.7-1.3-3-3-3zM3 21V10h18v11H3z"/></svg></symbol><symbol id="next-arrow-double-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M11.5 6.5l-3.5-3.4-3.5 3.4-1-1 4.5-4.6 4.5 4.5-1 1.1zm1 4l-1.1-1.1-3.4 3.5-3.5-3.4-1.1 1.1 4.6 4.5 4.5-4.6z"/></svg></symbol><symbol id="next-add-circle"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M6 0c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm3 7h-2v2c0 .5-.5 1-1 1s-1-.5-1-1v-2h-2c-.5 0-1-.5-1-1s.5-1 1-1h2v-2c0-.5.5-1 1-1s1 .5 1 1v2h2c.5 0 1 .5 1 1s-.5 1-1 1z"/></svg></symbol><symbol id="next-website"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M9.4 2c-.2 0-.3.3-.2.4l1.4 1.4-3.8 3.9c-.2.2-.2.6 0 .8l.8.8c.2.2.6.2.8 0l3.8-3.8 1.4 1.4c.2.2.4 0 .4-.2v-4.2c0-.3-.2-.5-.5-.5h-4.1zm.6 0h-6c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2v-6 2h-2v3c0 .6-.5 1-1 1h-6c-.6 0-1-.5-1-1v-6c0-.6.5-1 1-1h3v-2h2z"/></svg></symbol><symbol id="next-search-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M0 5.667c0 3.125 2.542 5.667 5.667 5.667 1.202 0 2.315-.38 3.233-1.02l.455.456c-.07.5.082 1.025.466 1.41l3.334 3.332c.326.325.753.488 1.18.488.425 0 .852-.163 1.177-.488.652-.65.652-1.706 0-2.357L12.18 9.822c-.384-.384-.91-.536-1.41-.466l-.454-.456c.64-.918 1.02-2.03 1.02-3.233C11.333 2.542 8.79 0 5.666 0S0 2.542 0 5.667zm2 0C2 3.645 3.645 2 5.667 2s3.667 1.645 3.667 3.667-1.646 3.666-3.667 3.666S2 7.688 2 5.667z"/></svg></symbol><symbol id="next-info"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24"><g><path d="M13.5 7h-2c-.8 0-1.5.7-1.5 1.5v14c0 .8.7 1.5 1.5 1.5h2c.8 0 1.5-.7 1.5-1.5v-14c0-.8-.7-1.5-1.5-1.5z"/><circle cx="12.5" cy="2.5" r="2.5"/></g></svg></symbol><symbol id="next-dashboard-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g><path d="M8.43 3.445c-.248-.21-.612-.21-.86 0L2.353 7.86C2.13 8.05 2 8.33 2 8.624v6.71c0 .366.3.666.667.666h2.667C5.7 16 6 15.7 6 15.333v-3c0-.183.15-.333.333-.333h3.333c.184 0 .334.15.334.333v3c0 .367.3.667.667.667h2.667c.366 0 .666-.3.666-.667v-6.71c0-.294-.13-.573-.354-.763L8.43 3.445zM15.764 6.158L8.944.39C8.692.14 8.357 0 8 0c-.357 0-.692.14-.902.354L.236 6.158c-.28.238-.316.66-.078.94.132.156.32.236.51.236.15 0 .304-.052.43-.158L7.6 1.638c.238-.178.56-.18.797-.003 1.468 1.1 6.505 5.54 6.505 5.54.28.237.702.203.94-.078.238-.28.203-.7-.078-.94z"/></g></svg></symbol><symbol id="next-orders-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g><path d="M13.992 0H2.1C.94 0 0 .94 0 2.1v12.244C0 15.305.785 16 1.75 16H14.34c.964 0 1.658-.694 1.658-1.658V2.1C16 .94 15.15 0 13.992 0zM14 2v8h-1.757C11.28 10 10 11.28 10 12.243v.7c0 .193.337.057.144.057H5.247c-.193 0-.247.136-.247-.057v-.7C5 11.28 4.113 10 3.148 10H2V2h12zM7.117 9.963c.167.16.437.16.603.002l5.17-5.042c.165-.16.165-.422 0-.583l-.604-.583c-.166-.16-.437-.16-.603 0L7.42 7.924 5.694 6.24c-.166-.16-.437-.16-.603 0l-.604.582c-.166.162-.166.423 0 .584l2.63 2.557z"/></g></svg></symbol><symbol id="next-chevron"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.6,6 L8.2,8 L12,12 L8.2,16 L10.6,18 L15.3,13 C15.8,12.4 15.8,11.6 15.3,11 L10.6,6 L10.6,6 Z"/></svg></symbol><symbol id="next-products-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M15.087 0H10.01c-.554 0-1.085.235-1.476.627L.3 8.87c-.37.368-.37.965 0 1.327l5.553 5.556c.362.368.955.37 1.323 0L15.4 7.52c.39-.392.6-.922.6-1.476V.967C16 .45 15.604 0 15.087 0zm-2.89 5.56c-.94 0-1.702-.764-1.702-1.703 0-.94.763-1.702 1.702-1.702.94 0 1.702.763 1.702 1.702 0 .94-.764 1.702-1.703 1.702z"/></svg></symbol><symbol id="next-customers-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g><path d="M13.08 8.26c-.68-.275-.674-.732-.674-1.007 0-.274.29-.657.566-.903.48-.423.777-1.04.777-1.737 0-1.206-1.018-2.21-2.224-2.257-.896-.03-1.658.41-2.062 1.1-.088.15-.03.337.127.415 1.12.555 1.873 1.69 1.873 3.03 0 .87-.32 1.698-.894 2.332-.128.14-.077.362.094.442.663.31 2.044.745 2.598 1.462.055.07.134-.136.224-.136h1.657c.473 0 .857.116.857-.358v-.12c0-1.308-1.93-1.85-2.92-2.263zM5.398 9.232c-.542-.603-.827-1.39-.827-2.304 0-1.348.74-2.53 1.863-3.08.16-.077.22-.267.128-.418-.5-.816-1.523-1.265-2.634-.993-1.006.24-1.64 1.17-1.64 2.21 0 .698.223 1.28.71 1.704.273.247.6.63.6.904s-.035.73-.715 1.006C1.89 8.67 0 9.214 0 10.522v.12c0 .474.384.358.857.358h1.656c.09 0 .17.206.226.133.544-.716 1.905-1.277 2.56-1.59.167-.078.222-.173.098-.31zM9.867 10.546c-.68-.278-.78-.735-.78-1.006 0-.274.234-.656.508-.9.483-.426.754-1.046.754-1.74 0-1.492-1.39-2.55-2.957-2.184-1.018.237-1.672 1.168-1.672 2.212 0 .695.223 1.286.706 1.71.274.246.596.628.596.902 0 .27-.248.728-.927 1.006C5.11 10.954 3 11.5 3 12.806v.122C3 13.4 3.812 14 4.286 14h7.43c.472 0 1.284-.6 1.284-1.072v-.122c0-1.307-2.147-1.852-3.133-2.26z"/></g></svg></symbol><symbol id="next-reports-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g><path d="M4 9.667C4 9.297 3.702 9 3.333 9H1.667C1.297 9 1 9.298 1 9.667v5.667c0 .368.298.666.667.666h1.667c.368 0 .666-.298.666-.667V9.667zM8 3.667C8 3.297 7.702 3 7.333 3H5.667C5.297 3 5 3.298 5 3.667v11.667c0 .368.298.666.667.666h1.667c.368 0 .666-.298.666-.667V3.667zM12 .667c0-.37-.298-.667-.667-.667H9.667C9.297 0 9 .298 9 .667v14.667c0 .368.298.666.667.666h1.667c.368 0 .666-.298.666-.667V.667zM16 6.667c0-.37-.298-.667-.667-.667h-1.667c-.368 0-.666.298-.666.667v8.667c0 .368.298.666.667.666h1.667c.368 0 .666-.298.666-.667V6.667z"/></g></svg></symbol><symbol id="next-discounts-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g><path d="M9 13.333C9 13.15 8.85 13 8.667 13H6.333c-.184 0-.333.15-.333.333v.333c0 .185.15.334.333.334h2.333c.185 0 .334-.15.334-.333v-.334zM13 13.333c0-.184-.15-.333-.333-.333h-2.333c-.185 0-.334.15-.334.333v.333c0 .185.15.334.333.334h2.333c.185 0 .334-.15.334-.333v-.334zM16 8.333C16 8.15 15.85 8 15.667 8h-.333c-.185 0-.334.15-.334.333v2.333c0 .185.15.334.333.334h.333c.185 0 .334-.15.334-.333V8.333zM11.3 9.2L7.272 5.902 11.3 2.607l-.013-.016c-.692-.845-1.94-.97-2.786-.278l-2.808 2.3-1.18-.966c.096-.254.155-.526.155-.813C4.667 1.547 3.62.5 2.333.5S0 1.547 0 2.833s1.047 2.333 2.333 2.333c.255 0 .495-.05.725-.127l1.055.862-.93.763c-.265-.103-.55-.165-.85-.165C1.047 6.5 0 7.547 0 8.833s1.047 2.333 2.333 2.333 2.333-1.047 2.333-2.333c0-.246-.05-.478-.12-.7l1.145-.938L8.5 9.493c.846.692 2.094.568 2.786-.28L11.3 9.2zM1.333 2.832c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.448-1-1zm1 7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1c0 .552-.448 1-1 1zM13 5.333C13 5.15 12.85 5 12.667 5h-2.333c-.185 0-.334.15-.334.333v.333c0 .185.15.334.333.334h2.333c.185 0 .334-.15.334-.333v-.334zM15.5 5h-1c-.276 0-.5 0-.5.5s.224.5.5.5h.5v.48c0 .275 0 .5.5.5s.5-.225.5-.5V5.5c0-.276-.063-.5-.5-.5zM3.5 14h1c.276 0 .5 0 .5-.5s-.224-.5-.5-.5H4v-.5c0-.276 0-.5-.5-.5s-.5.224-.5.5v.98c0 .275.062.52.5.52zM16 13.49v-1c0-.276 0-.5-.5-.5s-.5.224-.5.5V13h-.49c-.276 0-.5 0-.5.5s.224.5.5.5h.98c.276 0 .51-.073.51-.51z"/></g></svg></symbol><symbol id="next-online-store-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.1c-3.4 0-6.1-2.7-6.1-6.1 0-.9.2-1.8.6-2.6v.3c0 .2.3.5.3.7 0 .3.2.5.4.7.3.1.6.2.8.4.2.2.4.3.7.2.2.2.1.4 0 .6-.2.2-.3.4-.3.5-.1.3-.1.6.2.8.2.1.3.3.3.5s.2.4.3.5c.4.2.4.6.5 1 .1.8.7 2 .9 1.6.2-.3.6-.9.8-1.1.1-.1.2-.2.2-.3.1-.2.2-.4.4-.5.1-.1.2-.2.2-.3 0-.4.2-.8.4-1.1.4-.5.2-.8-.4-1-.3-.1-.7-.3-1.1-.1v-.2c.1-.5 0-.6-.5-.8-.2-.2-.4-.3-.6-.4-.2-.1-.5 0-.8-.1-.3.1-.2-.4-.5-.5-.6-.6.3-.8.7-.6.1.1.5-.5 1.3-1 .2 0 .1-1 .3-1-1.7-1-2-1.4-2-1.4h-.2c.9-.6 2-.9 3.2-.9h.6l-.1.1s-.5.3.1 1c.2.2.7.8.6.9 0 .2 1.4-.1 1.6-.1.4 0 .3.6 0 .7 0 .1-1.8.3-1.9.3-.3.4-.3.3-.2.7 0 .2-.1.3-.1.6.2.2.4.5.6.8.3.3.5.8.8.7.1 0 .2-.1.4-.2.1.1.3.4.5.5-.1.3 0 .5.2.8.1.1 0 .8-.1.9-.1.2 0 .6.2 1s.7.4.9 0l.7-1.9c.2-.4.5-.7.9-.9l.3-.1V8c.1 3.4-2.6 6.1-6 6.1z"/></svg></symbol><symbol id="next-apps-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M12.383 9.734c.59.41.882 1.044.87 1.675-.004.29.357.43.563.226l1.894-1.894c.387-.387.387-1.015 0-1.402l-2.498-2.498c-.167-.167-.115-.463.11-.54.397-.133.76-.396 1.02-.798.432-.662.416-1.56-.04-2.204-.734-1.033-2.175-1.123-3.03-.268-.216.216-.37.47-.463.74-.08.23-.387.28-.56.108L7.767.397C7.38.01 6.75.01 6.364.397L4.472 2.29c-.215.214-.05.565.257.565.504 0 1.013.192 1.4.58.87.87.765 2.34-.316 3.06-.663.443-1.568.435-2.216-.028-.576-.412-.86-1.04-.855-1.664.01-.29-.355-.43-.56-.224L.29 6.47c-.387.388-.387 1.016 0 1.403l2.498 2.498c.167.168.115.464-.11.54-.397.134-.76.397-1.02.8-.432.66-.416 1.56.04 2.203.734 1.033 2.175 1.123 3.03.268.216-.215.37-.47.463-.74.08-.23.387-.28.56-.107l2.483 2.484c.387.387 1.015.387 1.402 0l1.892-1.892c.215-.215.05-.564-.254-.563-.508 0-1.016-.193-1.404-.582-.86-.86-.768-2.304.278-3.037.658-.462 1.574-.466 2.235-.01z"/></svg></symbol><symbol id="next-settings-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M15.733 6.767l-1.77-.36c-.117-.025-.21-.112-.245-.227-.102-.323-.232-.636-.39-.935-.056-.107-.053-.234.013-.335l1-1.51c.086-.13.07-.304-.042-.415L13.02 1.707c-.114-.114-.292-.132-.426-.043l-1.504.995c-.1.066-.228.07-.335.013-.3-.158-.61-.288-.935-.39-.114-.037-.202-.13-.226-.247l-.36-1.77C9.2.113 9.063 0 8.906 0H7.093c-.158 0-.295.11-.326.267l-.36 1.77c-.025.117-.113.21-.227.245-.323.102-.636.232-.935.39-.107.056-.234.053-.335-.013l-1.504-.996c-.134-.09-.312-.07-.426.043L1.702 2.985c-.11.11-.128.284-.042.415l1 1.51c.066.1.07.228.012.335-.158.3-.288.612-.39.935-.036.114-.128.202-.246.226l-1.77.36C.113 6.8 0 6.937 0 7.094v1.813c0 .158.11.295.267.327l1.77.36c.117.025.21.112.245.227.102.323.232.636.39.935.056.107.053.234-.013.335l-.996 1.504c-.09.134-.07.312.043.426l1.273 1.273c.114.114.292.132.426.043l1.504-.995c.1-.066.228-.07.335-.012.3.158.61.288.935.39.115.036.202.128.226.246l.36 1.77c.032.155.17.266.327.266h1.813c.158 0 .295-.11.327-.267l.36-1.77c.025-.117.112-.21.227-.245.323-.102.636-.232.935-.39.107-.056.234-.053.335.013l1.504.996c.134.09.312.07.426-.043l1.273-1.273c.114-.114.132-.292.043-.426l-.995-1.504c-.066-.1-.07-.228-.012-.335.158-.3.288-.61.39-.935.036-.115.128-.202.246-.226l1.77-.36c.155-.032.266-.17.266-.327V7.093c0-.158-.112-.295-.267-.326zM10.667 8c0 1.473-1.193 2.667-2.667 2.667S5.333 9.473 5.333 8c0-1.473 1.193-2.667 2.667-2.667S10.667 6.527 10.667 8z"/></svg></symbol><symbol id="next-menu-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><path d="M7 9H1c-.552 0-1-.114-1-.667v-.666C0 7.114.448 7 1 7h14c.552 0 1 .114 1 .667v.667c0 .552-.448.666-1 .666H7zM7 4H1c-.552 0-1-.114-1-.667v-.666C0 2.114.448 2 1 2h14c.552 0 1 .114 1 .667v.667c0 .552-.448.666-1 .666H7zM7 14H1c-.552 0-1-.114-1-.667v-.667C0 12.114.448 12 1 12h14c.552 0 1 .114 1 .667v.667c0 .552-.448.666-1 .666H7z"/></svg></symbol></svg>
3
+ </div>
@@ -0,0 +1,17 @@
1
+ <section class="section">
2
+ <div class="layout-content">
3
+
4
+ <aside class="layout-content__sidebar layout-content__first">
5
+ <% if content_for?(:section_summary) %>
6
+ <div class="section-summary">
7
+ <%= content_for :section_summary %>
8
+ </div>
9
+ <% end %>
10
+ </aside>
11
+
12
+ <section class="layout-content__main">
13
+ <%= content_for :section_content %>
14
+ </section>
15
+
16
+ </div>
17
+ </section>
@@ -0,0 +1,25 @@
1
+ <% if @shop.current_subscription? %>
2
+ <p>
3
+ You are currently on the <%= @shop.current_subscription.plan.name %> plan.
4
+ </p>
5
+ <p>
6
+ Choose a new plan:
7
+ </p>
8
+ <% else %>
9
+ <p>
10
+ Welcome!
11
+ </p>
12
+ <p>
13
+ Choose a plan below to get started:
14
+ </p>
15
+ <% end %>
16
+
17
+ <% for plan in DiscoApp::Plan.available %>
18
+
19
+ <h2><%= plan.name %></h2>
20
+ <%= form_for(@subscription) do |f| %>
21
+ <%= f.hidden_field :plan, value: plan.id %>
22
+ <%= f.submit %>
23
+ <% end %>
24
+
25
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <li class="next-nav__item">
2
+ <a href="<%= admin_shops_path %>" class="next-nav__link <%= active_link_to_class(admin_shops_path, class_active: 'next-nav__link--is-selected', active: :inclusive) %>">
3
+ <svg class="next-icon next-icon--size-16 next-icon--no-nudge" role="img" aria-labelledby="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title"><title id="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title">Home</title><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#next-dashboard-16"></use></svg>
4
+ <span class="next-nav__text">Shops</span>
5
+ </a>
6
+ </li>
7
+
8
+ <li class="next-nav__item">
9
+ <a href="<%= admin_plans_path %>" class="next-nav__link <%= active_link_to_class(admin_plans_path, class_active: 'next-nav__link--is-selected', active: :inclusive) %>">
10
+ <svg class="next-icon next-icon--size-16 next-icon--no-nudge" role="img" aria-labelledby="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title"><title id="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title">Home</title><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#next-dashboard-16"></use></svg>
11
+ <span class="next-nav__text">Plans</span>
12
+ </a>
13
+ </li>
14
+
15
+ <li class="next-nav__item">
16
+ <a href="<%= edit_admin_app_settings_path %>" class="next-nav__link <%= active_link_to_class(edit_admin_app_settings_path, class_active: 'next-nav__link--is-selected', active: :inclusive) %>">
17
+ <svg class="next-icon next-icon--size-16 next-icon--no-nudge" role="img" aria-labelledby="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title"><title id="next-dashboard-16-17dbedf316126bf9bd81f6c6b7626199-title">Home</title><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#next-dashboard-16"></use></svg>
18
+ <span class="next-nav__text">Settings</span>
19
+ </a>
20
+ </li>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= yield(:title) %></title>
5
+ <%= stylesheet_link_tag 'disco_app/admin', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body class="next-ui">
11
+
12
+ <div class="nav-drawer">
13
+ <div class="next-nav next-nav--is-expanded">
14
+ <div class="next-nav__panel next-nav__panel--primary">
15
+ <header role="banner" class="next-nav__logo next-nav__logo--shopify">
16
+ <h1>
17
+ <a href="/admin">
18
+ <span role="img" class="ui-inline-svg">
19
+ <svg class="next-nav__svg-logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0" y="0" viewBox="0 0 609 177" xml:space="preserve" enable-background="new 0 0 609 177"><style type="text/css">
20
+ .st0{fill:#231F20;}
21
+ .st1{fill:#FBAF41;}
22
+ .st2{fill:#8676D5;}
23
+ .st3{fill:#9CCC6B;}
24
+ .st4{fill:#FBCC6B;}
25
+ .st5{fill:#9CCCD5;}
26
+ .st6{fill:#FFFFFF;}
27
+ </style><path id="XMLID_36_" class="st0" d="M80.9 176l-37.2-21.5L6.4 133V90 47l37.2-21.5L80.9 4l37.2 21.5L155.4 47v43 43l-37.2 21.5L80.9 176z"/><polygon id="XMLID_13_" class="st1" points="16 52.5 16 127.5 145.9 127.5 "/><polygon id="XMLID_12_" class="st2" points="16 127.5 145.9 127.5 145.9 52.5 "/><polygon id="XMLID_11_" class="st3" points="145.9 127.5 80.9 15.1 16 127.5 "/><polygon id="XMLID_10_" class="st4" points="48.5 71.3 16 127.5 145.9 127.5 "/><polygon id="XMLID_9_" class="st5" points="16 127.5 145.9 127.5 113.4 71.3 "/><polygon id="XMLID_8_" class="st6" points="80.9 90 16 127.5 80.9 165 145.9 127.5 "/><g id="XMLID_17_"><path id="XMLID_27_" class="st6" d="M205.4 125.4V55h27.7c22 0 37.3 14 37.3 35.1 0 21.3-15.3 35.2-37.2 35.2H205.4zM255.2 90.2c0-12.3-7.6-21.9-21.9-21.9h-12.9v44h12.8C247.1 112.2 255.2 102.2 255.2 90.2z"/><path id="XMLID_25_" class="st6" d="M286.4 125.4V55h15v70.3H286.4z"/><path id="XMLID_23_" class="st6" d="M315.7 115.5l8.2-11.7c5 5.2 12.7 9.6 22.4 9.6 8.3 0 12.2-3.7 12.2-7.8 0-12.2-40.5-3.7-40.5-30.2 0-11.7 10.1-21.4 26.7-21.4 11.2 0 20.5 3.4 27.4 9.8L363.8 75c-5.7-5.3-13.3-7.7-20.5-7.7 -6.3 0-9.9 2.7-9.9 7 0 11.1 40.4 3.6 40.4 29.8 0 12.9-9.3 22.6-28.2 22.6C332.1 126.7 322.4 122.1 315.7 115.5z"/><path id="XMLID_21_" class="st6" d="M385.8 90.3c0-21.7 16.3-36.4 37.5-36.4 15.4 0 24.4 8.3 29.3 17.2l-12.9 6.3c-3-5.7-9.3-10.2-16.5-10.2 -12.9 0-22.1 9.8-22.1 23.1 0 13.3 9.3 23.1 22.1 23.1 7.2 0 13.5-4.5 16.5-10.2l12.9 6.2c-5 8.8-13.9 17.3-29.3 17.3C402.1 126.7 385.8 111.9 385.8 90.3z"/><path id="XMLID_18_" class="st6" d="M463.5 90.3c0-21.2 15.5-36.4 36.8-36.4 21.2 0 36.7 15.2 36.7 36.4 0 21.2-15.5 36.4-36.7 36.4C479 126.7 463.5 111.5 463.5 90.3zM521.6 90.3c0-13.2-8.3-23.1-21.3-23.1 -13.1 0-21.4 9.9-21.4 23.1 0 13.1 8.3 23.1 21.4 23.1C513.2 113.4 521.6 103.3 521.6 90.3z"/></g></svg>
28
+ </span>
29
+ </a>
30
+ </h1>
31
+ </header>
32
+ <nav role="navigation">
33
+ <ol class="next-nav__list next-nav__list--primary">
34
+ <%= render 'layouts/admin/nav_items' %>
35
+ </ol>
36
+ </nav>
37
+ </div>
38
+ </div>
39
+ </div>
40
+
41
+ <main id="content" role="main">
42
+ <div class="header-row">
43
+ <header class="header">
44
+ <h1 class="header__main">
45
+ <svg class="next-icon next-icon--size-20 next-icon--header">
46
+ <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#next-collections"></use>
47
+ </svg>
48
+ <% if content_for?(:breadcrumb) %>
49
+ <span class="breadcrumb">
50
+ <a href="<%= yield(:breadcrumb_url) %>"><%= yield(:breadcrumb) %></a>
51
+ /
52
+ </span>
53
+ <% end %>
54
+ <span>
55
+ <%= yield(:title) %>
56
+ </span>
57
+ </h1>
58
+ </header>
59
+ </div>
60
+
61
+ <div class="page">
62
+ <%= yield %>
63
+ </div>
64
+ </main>
65
+
66
+ </body>
67
+ </html>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= yield(:title) %></title>
5
+
6
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
7
+
8
+ <%= csrf_meta_tags %>
9
+
10
+ <%= yield :extra_head %>
11
+ </head>
12
+ <body>
13
+
14
+ <%= yield %>
15
+
16
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
17
+ </body>
18
+ </html>
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= yield(:title) %></title>
5
+
6
+ <script src="//cdn.shopify.com/s/assets/external/app.js?<%= Time.now.strftime('%Y%m%d%H') %>"></script>
7
+ <script type="text/javascript">
8
+ // Initialise the Shopify App.
9
+ ShopifyApp.init({
10
+ "apiKey": "<%= ShopifyApp.configuration.api_key %>",
11
+ "shopOrigin": "<%= "https://#{ @shop_session.url }" if @shop_session %>",
12
+ "debug": <%= Rails.env.development? ? 'true' : 'false' %>
13
+ });
14
+ </script>
15
+
16
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
17
+
18
+ <%= csrf_meta_tags %>
19
+
20
+ <%= yield :extra_head %>
21
+ </head>
22
+ <body>
23
+ <script type="text/javascript">
24
+ ShopifyApp.Bar.initialize({
25
+ title: "<%= yield(:title) %>",
26
+ icon: "<%= image_url("disco_app/icon.svg") %>",
27
+ buttons: <%= content_for?(:buttons) ? content_for(:buttons) : '{}' %>,
28
+ breadcrumb: <%= content_for?(:breadcrumb) ? content_for(:breadcrumb) : 'undefined' %>
29
+ });
30
+ </script>
31
+
32
+ <%= yield %>
33
+
34
+ <% flash.each do |key, message| %>
35
+ <script type="text/javascript">
36
+ ShopifyApp.flash<%= (key == 'error') ? 'Error' : 'Notice' %>('<%= message %>');
37
+ </script>
38
+ <% end %>
39
+
40
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true, 'data-turbolinks-eval' => false %>
41
+
42
+ <%= render 'disco_app/shared/icons' %>
43
+ </body>
44
+ </html>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= yield(:title) %></title>
5
+ <script src="//cdn.shopify.com/s/assets/external/app.js?<%= Time.now.strftime('%Y%m%d%H') %>"></script>
6
+ <script type="text/javascript">
7
+ // Initialise the Shopify App.
8
+ ShopifyApp.init({
9
+ "apiKey": "<%= ShopifyApp.configuration.api_key %>",
10
+ "shopOrigin": "<%= "https://#{ @shop_session.url }" if @shop_session %>",
11
+ "debug": <%= Rails.env.development? ? 'true' : 'false' %>,
12
+ "forceRedirect": false
13
+ });
14
+ </script>
15
+
16
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
17
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
18
+
19
+ <%= csrf_meta_tags %>
20
+
21
+ <%= yield :extra_head %>
22
+ </head>
23
+ <body>
24
+
25
+ <%= yield %>
26
+
27
+ </body>
28
+ </html>
@@ -0,0 +1,26 @@
1
+ <% provide(:title, 'Install') %>
2
+
3
+ <%= form_tag shopify_app.login_path do %>
4
+ <div class="modal-dialog">
5
+ <div class="modal-content">
6
+ <div class="modal-body">
7
+
8
+ <% flash.each do |message_type, message| %>
9
+ <div class="alert alert-<%= message_type %>"><%= message %></div>
10
+ <% end %>
11
+
12
+ <div class="form-group">
13
+ <div class="input-group">
14
+ <div class="input-group-addon">http://</div>
15
+ <input type="text" class="form-control" id="shop" name="shop" placeholder="your-store" autocomplete="off" autofocus="on" />
16
+ <div class="input-group-addon">.myshopify.com</div>
17
+ </div>
18
+ </div>
19
+
20
+ </div>
21
+ <div class="modal-footer">
22
+ <button type="submit" class="btn btn-primary">Install</button>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <% end %>
data/config/routes.rb ADDED
@@ -0,0 +1,48 @@
1
+ DiscoApp::Engine.routes.draw do
2
+
3
+ get 'ref', to: '/sessions#referral'
4
+
5
+ controller :webhooks do
6
+ post 'webhooks' => :process_webhook, as: :webhooks
7
+ end
8
+
9
+ resources :subscriptions, only: [:new, :create] do
10
+ resources :charges, only: [:new, :create] do
11
+ member do
12
+ get 'activate'
13
+ end
14
+ end
15
+ end
16
+
17
+ controller :install do
18
+ get 'install' => :install, as: :install
19
+ get 'installing' => :installing, as: :installing
20
+ get 'uninstalling' => :uninstalling, as: :uninstalling
21
+ end
22
+
23
+ controller 'admin' do
24
+ get 'admin', to: redirect('/admin/shops')
25
+ get 'admin/shops' => 'admin/shops#index'
26
+ end
27
+
28
+ namespace :admin do
29
+ resources :shops, only: [:index, :edit, :update] do
30
+ resources :subscriptions, only: [:edit, :update]
31
+ end
32
+ resources :plans
33
+ resource :app_settings, only: [:edit, :update]
34
+
35
+ # JSON-API resources for admins.
36
+ namespace :resources do
37
+ jsonapi_resources :shops
38
+ end
39
+ end
40
+
41
+ # Make the embedded app frame emulator available in development.
42
+ if Rails.env.development?
43
+ controller :frame do
44
+ get 'frame' => :frame, as: :frame
45
+ end
46
+ end
47
+
48
+ end
@@ -0,0 +1,15 @@
1
+ class CreateShopsIfNotExistent < ActiveRecord::Migration
2
+
3
+ def change
4
+ unless table_exists? :shops or table_exists? :disco_app_shops
5
+ create_table :shops do |t|
6
+ t.string :shopify_domain, null: false
7
+ t.string :shopify_token, null: false
8
+ t.timestamps null: false
9
+ end
10
+
11
+ add_index :shops, :shopify_domain, unique: true
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,5 @@
1
+ class AddStatusToShops < ActiveRecord::Migration
2
+ def change
3
+ add_column :shops, :status, :integer, default: 0
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class AddMetaToShops < ActiveRecord::Migration
2
+ def change
3
+ add_column :shops, :email, :string
4
+ add_column :shops, :country_name, :string
5
+ add_column :shops, :currency, :string
6
+ add_column :shops, :money_format, :string
7
+ add_column :shops, :money_with_currency_format, :string
8
+ add_column :shops, :domain, :string
9
+ add_column :shops, :plan_name, :string
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddChargeStatusToShop < ActiveRecord::Migration
2
+ def change
3
+ add_column :shops, :charge_status, :integer, default: 6
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ class AddMoreMetaToShops < ActiveRecord::Migration
2
+ def change
3
+ add_column :shops, :plan_display_name, :string
4
+ add_column :shops, :latitude, :decimal
5
+ add_column :shops, :longitude, :decimal
6
+ add_column :shops, :customer_email, :string
7
+ add_column :shops, :password_enabled, :boolean
8
+ add_column :shops, :phone, :string
9
+ add_column :shops, :primary_locale, :string
10
+ add_column :shops, :ships_to_countries, :string
11
+ add_column :shops, :timezone, :string
12
+ add_column :shops, :iana_timezone, :string
13
+ add_column :shops, :has_storefront, :boolean
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ class CreateDiscoAppPlans < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_plans do |t|
4
+ t.integer :status
5
+ t.string :name
6
+ t.integer :charge_type
7
+ t.decimal :default_price
8
+ t.integer :default_trial_days
9
+
10
+ t.timestamps null: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ class CreateDiscoAppSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_subscriptions do |t|
4
+ t.belongs_to :shop, index: true
5
+ t.belongs_to :plan, index: true
6
+ t.integer :status
7
+ t.string :name
8
+ t.integer :charge_type
9
+ t.decimal :price
10
+ t.integer :trial_days
11
+
12
+ t.timestamps null: false
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ class MoveShopToDiscoAppEngine < ActiveRecord::Migration
2
+ def change
3
+ rename_table :shops, :disco_app_shops
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateDiscoAppSessions < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_sessions do |t|
4
+ t.string :session_id, null: false
5
+ t.text :data
6
+ t.timestamps null: false
7
+ end
8
+
9
+ add_index :disco_app_sessions, :session_id, :unique => true
10
+ add_index :disco_app_sessions, :updated_at
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ class AddShopIdToDiscoAppSessions < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_sessions, :shop_id, :integer, null: true
4
+ add_foreign_key :disco_app_sessions, :disco_app_shops, column: :shop_id, on_delete: :cascade
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ class CreateDiscoAppSettings < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_app_settings do |t|
4
+
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,22 @@
1
+ class UpdatePlans < ActiveRecord::Migration
2
+ def change
3
+ remove_column :disco_app_plans, :default_price, :decimal
4
+ rename_column :disco_app_plans, :default_trial_days, :trial_period_days
5
+ rename_column :disco_app_plans, :charge_type, :plan_type
6
+ add_column :disco_app_plans, :amount, :integer, default: 0
7
+ add_column :disco_app_plans, :currency, :string, default: 'USD'
8
+ add_column :disco_app_plans, :interval, :integer, default: 0
9
+ add_column :disco_app_plans, :interval_count, :integer, default: 1
10
+
11
+ reversible do |direction|
12
+ direction.up do
13
+ change_column :disco_app_plans, :plan_type, :integer, default: 0
14
+ change_column :disco_app_plans, :status, :integer, default: 0
15
+ end
16
+ direction.down do
17
+ change_column :disco_app_plans, :plan_type, :integer
18
+ change_column :disco_app_plans, :status, :integer
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ class UpdateSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ remove_column :disco_app_subscriptions, :name, :string
4
+ remove_column :disco_app_subscriptions, :price, :decimal
5
+ remove_column :disco_app_subscriptions, :trial_days, :integer
6
+
7
+ rename_column :disco_app_subscriptions, :charge_type, :subscription_type
8
+
9
+ add_column :disco_app_subscriptions, :trial_start_at, :datetime, null: true
10
+ add_column :disco_app_subscriptions, :trial_end_at, :datetime, null: true
11
+ add_column :disco_app_subscriptions, :cancelled_at, :datetime, null: true
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ class CreateDiscoAppRecurringApplicationCharges < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_recurring_application_charges do |t|
4
+ t.integer :shop_id, limit: 8
5
+ t.integer :subscription_id, limit: 8
6
+ t.integer :status, default: 0
7
+
8
+ t.timestamps null: false
9
+ end
10
+
11
+ add_foreign_key :disco_app_recurring_application_charges, :disco_app_shops, column: :shop_id
12
+ add_foreign_key :disco_app_recurring_application_charges, :disco_app_subscriptions, column: :subscription_id
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateDiscoAppApplicationCharges < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_application_charges do |t|
4
+ t.integer :shop_id, limit: 8
5
+ t.integer :subscription_id, limit: 8
6
+ t.integer :status, default: 0
7
+
8
+ t.timestamps null: false
9
+ end
10
+
11
+ add_foreign_key :disco_app_application_charges, :disco_app_shops, column: :shop_id
12
+ add_foreign_key :disco_app_application_charges, :disco_app_subscriptions, column: :subscription_id
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ class DropChargeStatusFromShops < ActiveRecord::Migration
2
+ def change
3
+ remove_column :disco_app_shops, :charge_status, :integer, default: 0
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class AddShopifyAttributesToCharges < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_application_charges, :shopify_id, :integer, limit: 8, null: true
4
+ add_column :disco_app_recurring_application_charges, :shopify_id, :integer, limit: 8, null: true
5
+ add_column :disco_app_application_charges, :confirmation_url, :string, null: true
6
+ add_column :disco_app_recurring_application_charges, :confirmation_url, :string, null: true
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ class CreateDiscoAppPlanCodes < ActiveRecord::Migration
2
+ def change
3
+ create_table :disco_app_plan_codes do |t|
4
+ t.integer :plan_id, limit: 8
5
+ t.string :code
6
+ t.integer :trial_period_days
7
+ t.integer :amount
8
+
9
+ t.timestamps null: false
10
+ end
11
+
12
+ add_foreign_key :disco_app_plan_codes, :disco_app_plans, column: :plan_id
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ class AddStatusToPlanCodes < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_plan_codes, :status, :integer, default: 0
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class AddAmountAndPlanCodeToDiscoAppSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_subscriptions, :amount, :integer, default: 0
4
+ add_column :disco_app_subscriptions, :plan_code_id, :integer, limit: 8
5
+ add_foreign_key :disco_app_subscriptions, :disco_app_plan_codes, column: :plan_code_id
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddSourceToDiscoAppSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_subscriptions, :source, :string
4
+ end
5
+ end