disco_app 0.8.9 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/disco_app/icons.svg +0 -0
  3. data/app/assets/javascripts/disco_app/components/{filterable_shop_list.js.jsx → custom/filterable_shop_list.js.jsx} +1 -1
  4. data/app/assets/javascripts/disco_app/components/custom/inline-radio-options.es6.jsx +59 -0
  5. data/app/assets/javascripts/disco_app/components/custom/rules-editor.es6.jsx +360 -0
  6. data/app/assets/javascripts/disco_app/components/{shop_list.js.jsx → custom/shop_list.js.jsx} +9 -11
  7. data/app/assets/javascripts/disco_app/components/custom/shop_row.js.jsx +43 -0
  8. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-section.es6.jsx +30 -0
  9. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card.es6.jsx +9 -0
  10. data/app/assets/javascripts/disco_app/components/ui-kit/cards/cart-section-title.es6.jsx +7 -0
  11. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_form.es6.jsx +72 -0
  12. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_input.es6.jsx +20 -0
  13. data/app/assets/javascripts/disco_app/components/ui-kit/forms/button.es6.jsx +13 -0
  14. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-radio.es6.jsx +30 -0
  15. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-select.es6.jsx +39 -0
  16. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-text.es6.jsx +59 -0
  17. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx +48 -0
  18. data/app/assets/javascripts/disco_app/components/ui-kit/icons/icon-chevron.es6.jsx +33 -0
  19. data/app/assets/javascripts/disco_app/components/ui-kit/icons/next-icon.es6.jsx +18 -0
  20. data/app/assets/javascripts/disco_app/components/ui-kit/input_select.es6.jsx +21 -0
  21. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-annotated-section.es6.jsx +29 -0
  22. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-empty-state.es6.jsx +35 -0
  23. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-footer-help.es6.jsx +13 -0
  24. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-page-actions.es6.jsx +39 -0
  25. data/app/assets/javascripts/disco_app/components.js +1 -4
  26. data/app/assets/javascripts/disco_app/disco_app.js +3 -0
  27. data/app/assets/javascripts/disco_app/ui-kit.js +1 -0
  28. data/app/assets/stylesheets/disco_app/admin/_header.scss +66 -0
  29. data/app/assets/stylesheets/disco_app/admin/_layout.scss +40 -0
  30. data/app/assets/stylesheets/disco_app/admin/_nav.scss +172 -0
  31. data/app/assets/stylesheets/disco_app/admin.scss +11 -0
  32. data/app/assets/stylesheets/disco_app/disco_app.scss +12 -12
  33. data/app/assets/stylesheets/disco_app/{disco/mixins → mixins}/_flexbox.scss +6 -0
  34. data/app/assets/stylesheets/disco_app/ui-kit/_ui-empty-state.scss +94 -0
  35. data/app/assets/stylesheets/disco_app/ui-kit/_ui-footer-help.scss +25 -0
  36. data/app/assets/stylesheets/disco_app/ui-kit/_ui-icons.scss +28 -0
  37. data/app/assets/stylesheets/disco_app/ui-kit/_ui-kit.scss +5086 -0
  38. data/app/assets/stylesheets/disco_app/ui-kit/_ui-layout.scss +10 -0
  39. data/app/assets/stylesheets/disco_app/ui-kit/_ui-page-actions.scss +21 -0
  40. data/app/assets/stylesheets/disco_app/{disco/_tabs.scss → ui-kit/_ui-tabs.scss} +3 -1
  41. data/app/assets/stylesheets/disco_app/ui-kit/_ui-type.scss +13 -0
  42. data/app/controllers/disco_app/admin/concerns/plans_controller.rb +8 -5
  43. data/app/controllers/disco_app/admin/concerns/subscriptions_controller.rb +32 -0
  44. data/app/controllers/disco_app/admin/subscriptions_controller.rb +3 -0
  45. data/app/helpers/disco_app/application_helper.rb +22 -0
  46. data/app/models/disco_app/concerns/plan.rb +2 -2
  47. data/app/models/disco_app/concerns/shop.rb +0 -4
  48. data/app/models/disco_app/concerns/subscription.rb +12 -0
  49. data/app/resources/disco_app/admin/resources/concerns/shop_resource.rb +40 -3
  50. data/app/views/disco_app/admin/plans/_form.html.erb +18 -21
  51. data/app/views/disco_app/admin/plans/_plan_code_fields.html.erb +15 -0
  52. data/app/views/disco_app/admin/plans/index.html.erb +2 -0
  53. data/app/views/disco_app/admin/shops/index.html.erb +2 -1
  54. data/app/views/disco_app/admin/subscriptions/edit.html.erb +33 -0
  55. data/app/views/disco_app/shared/_icons.html.erb +3 -0
  56. data/app/views/layouts/admin/_nav_items.erb +20 -0
  57. data/app/views/layouts/admin.html.erb +53 -9
  58. data/app/views/layouts/embedded_app.html.erb +2 -0
  59. data/app/views/layouts/embedded_app_modal.html.erb +11 -0
  60. data/config/routes.rb +4 -2
  61. data/lib/disco_app/engine.rb +2 -1
  62. data/lib/disco_app/version.rb +1 -1
  63. data/lib/generators/disco_app/disco_app_generator.rb +35 -2
  64. data/lib/generators/disco_app/templates/assets/javascripts/components.js +3 -0
  65. data/lib/generators/disco_app/templates/config/database.yml.tt +20 -0
  66. data/lib/tasks/database.rake +8 -0
  67. data/test/controllers/disco_app/charges_controller_test.rb +9 -2
  68. data/test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json +1 -1
  69. data/test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json +1 -1
  70. data/test/fixtures/disco_app/subscriptions.yml +1 -0
  71. data/test/models/disco_app/subscription_test.rb +19 -0
  72. data/test/services/disco_app/charges_service_test.rb +9 -2
  73. data/test/test_helper.rb +3 -0
  74. metadata +80 -21
  75. data/app/assets/javascripts/disco_app/components/shop_row.js.jsx +0 -27
  76. data/app/assets/stylesheets/disco_app/bootstrap/_custom.scss +0 -54
  77. data/app/assets/stylesheets/disco_app/bootstrap/_variables.scss +0 -872
  78. data/app/assets/stylesheets/disco_app/disco/_buttons.scss +0 -31
  79. data/app/assets/stylesheets/disco_app/disco/_cards.scss +0 -52
  80. data/app/assets/stylesheets/disco_app/disco/_forms.scss +0 -23
  81. data/app/assets/stylesheets/disco_app/disco/_grid.scss +0 -58
  82. data/app/assets/stylesheets/disco_app/disco/_sections.scss +0 -61
  83. data/app/assets/stylesheets/disco_app/disco/_tables.scss +0 -57
  84. data/app/assets/stylesheets/disco_app/disco/_type.scss +0 -39
  85. data/app/views/layouts/admin/_navbar.html.erb +0 -25
  86. data/lib/generators/disco_app/adminify/adminify_generator.rb +0 -35
  87. data/lib/generators/disco_app/reactify/reactify_generator.rb +0 -45
  88. /data/app/assets/javascripts/disco_app/components/{shop_filter_tab.js.jsx → custom/shop_filter_tab.js.jsx} +0 -0
  89. /data/app/assets/javascripts/disco_app/components/{shop_filter_tabs.js.jsx → custom/shop_filter_tabs.js.jsx} +0 -0
  90. /data/app/assets/javascripts/disco_app/components/{shopify_admin_link.js.jsx → custom/shopify_admin_link.js.jsx} +0 -0
@@ -0,0 +1,172 @@
1
+ //
2
+ // nav.scss
3
+ // Styles for admin navigation.
4
+ // --------------------------------------------------
5
+
6
+ .next-nav {
7
+ z-index: 221;
8
+ width: 230px;
9
+ position: fixed;
10
+ top: 0;
11
+ left: 0;
12
+ bottom: 0;
13
+ -webkit-transition: -webkit-transform 200ms ease;
14
+ transition: -webkit-transform 200ms ease;
15
+ transition: transform 200ms ease;
16
+ transition: transform 200ms ease, -webkit-transform 200ms ease;
17
+ overflow: hidden;
18
+ }
19
+
20
+ .next-nav__panel {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ bottom: 0;
25
+ overflow-x: hidden;
26
+ overflow-y: auto;
27
+ -webkit-overflow-scrolling: touch;
28
+ }
29
+
30
+ .next-nav__panel--primary {
31
+ z-index: 1;
32
+ width: 230px;
33
+ background-color: #31373d;
34
+ -webkit-transition: background-color 200ms ease;
35
+ transition: background-color 200ms ease;
36
+ }
37
+
38
+ .next-nav--is-expanded .next-nav__panel--primary {
39
+ background-color: #212529;
40
+ }
41
+
42
+ .next-nav__logo {
43
+ height: 56px;
44
+ display: -webkit-box;
45
+ display: -webkit-flex;
46
+ display: -ms-flexbox;
47
+ display: flex;
48
+ -webkit-box-align: center;
49
+ -webkit-align-items: center;
50
+ -ms-flex-align: center;
51
+ align-items: center;
52
+ -webkit-box-pack: justify;
53
+ -webkit-justify-content: space-between;
54
+ -ms-flex-pack: justify;
55
+ justify-content: space-between;
56
+ padding-left: 20px;
57
+ background-color: #272c30;
58
+ -webkit-transition: background-color 200ms ease;
59
+ transition: background-color 200ms ease;
60
+ overflow: hidden;
61
+ }
62
+
63
+ .next-nav--is-expanded .next-nav__logo {
64
+ background-color: #212529;
65
+ }
66
+
67
+ .next-nav__logo--disco .next-nav__svg-logo {
68
+ -webkit-transition: none;
69
+ transition: none;
70
+ -webkit-transform: translate3d(-5px, 0, 0);
71
+ transform: translate3d(-5px, 0, 0);
72
+ }
73
+
74
+ .next-nav__svg-logo {
75
+ width: 102px;
76
+ height: auto;
77
+ -webkit-transition: -webkit-transform 200ms ease;
78
+ transition: -webkit-transform 200ms ease;
79
+ transition: transform 200ms ease;
80
+ transition: transform 200ms ease, -webkit-transform 200ms ease;
81
+ }
82
+
83
+ .next-nav__list {
84
+ margin: 0;
85
+ padding: 0;
86
+ list-style: none;
87
+ }
88
+
89
+ .next-nav__list--primary {
90
+ background-color: #31373d;
91
+ display: -webkit-box;
92
+ display: -webkit-flex;
93
+ display: -ms-flexbox;
94
+ display: flex;
95
+ -webkit-box-orient: vertical;
96
+ -webkit-box-direction: normal;
97
+ -webkit-flex-direction: column;
98
+ -ms-flex-direction: column;
99
+ flex-direction: column;
100
+ position: absolute;
101
+ top: 56px;
102
+ bottom: 0;
103
+ left: 0;
104
+ right: 0;
105
+ }
106
+
107
+ .next-nav__item {
108
+ display: block;
109
+ min-height: 40px;
110
+ }
111
+
112
+ .next-nav__link {
113
+ color: #c3cfd8;
114
+ padding: 0 10px 0 20px;
115
+ height: 40px;
116
+ display: -webkit-box;
117
+ display: -webkit-flex;
118
+ display: -ms-flexbox;
119
+ display: flex;
120
+ -webkit-box-align: center;
121
+ -webkit-align-items: center;
122
+ -ms-flex-align: center;
123
+ align-items: center;
124
+ background-color: transparent;
125
+ border: none;
126
+ font-size: 13px;
127
+ cursor: pointer;
128
+ line-height: normal;
129
+ }
130
+
131
+ .next-nav__link:hover, .next-nav__link:focus, .next-nav__link:active, .next-nav__link.next-nav__link--is-selected {
132
+ text-decoration: none;
133
+ color: #ffffff;
134
+ }
135
+
136
+ .next-nav__link--is-selected {
137
+ background-color: #454e57;
138
+ }
139
+
140
+ .next-nav__text {
141
+ text-overflow: ellipsis;
142
+ white-space: nowrap;
143
+ overflow: hidden;
144
+ display: block;
145
+ color: #c3cfd8;
146
+ -webkit-transition: opacity 200ms ease, -webkit-transform 200ms ease;
147
+ transition: opacity 200ms ease, -webkit-transform 200ms ease;
148
+ transition: transform 200ms ease, opacity 200ms ease;
149
+ transition: transform 200ms ease, opacity 200ms ease, -webkit-transform 200ms ease;
150
+ -webkit-box-flex: 1;
151
+ -webkit-flex-grow: 1;
152
+ -ms-flex-positive: 1;
153
+ flex-grow: 1;
154
+ -webkit-flex-basis: 0%;
155
+ -ms-flex-preferred-size: 0%;
156
+ flex-basis: 0%;
157
+ margin-left: 10px;
158
+ }
159
+
160
+ .next-nav__link:hover .next-nav__text, .next-nav__link:focus .next-nav__text, .next-nav__link:active .next-nav__text, .next-nav__link.next-nav__link--is-selected .next-nav__text {
161
+ color: #ffffff;
162
+ }
163
+
164
+ .next-nav__link .next-icon {
165
+ fill: #798c9c;
166
+ -webkit-transition: opacity 200ms ease;
167
+ transition: opacity 200ms ease;
168
+ }
169
+
170
+ .next-nav__link:hover .next-icon, .next-nav__link:focus .next-icon, .next-nav__link:active .next-icon, .next-nav__link.next-nav__link--is-selected .next-icon {
171
+ fill: #ffffff;
172
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Styles for the Disco application admin.
3
+ // --------------------------------------------------
4
+
5
+ // Import the core.
6
+ @import 'disco_app';
7
+
8
+ // Admin-specific styling.
9
+ @import 'admin/layout';
10
+ @import 'admin/nav';
11
+ @import 'admin/header';
@@ -2,15 +2,15 @@
2
2
  // Styles for Disco applications.
3
3
  // --------------------------------------------------
4
4
 
5
- @import 'bootstrap-sprockets';
6
- @import 'bootstrap/variables';
7
- @import 'bootstrap/custom';
8
- @import 'disco/mixins/flexbox';
9
- @import 'disco/grid';
10
- @import 'disco/type';
11
- @import 'disco/sections';
12
- @import 'disco/cards';
13
- @import 'disco/buttons';
14
- @import 'disco/forms';
15
- @import 'disco/tables';
16
- @import 'disco/tabs';
5
+ // Mixins and utilities.
6
+ @import 'mixins/flexbox';
7
+
8
+ // UI Kit - Core and our addons.
9
+ @import 'ui-kit/ui-kit';
10
+ @import 'ui-kit/ui-type';
11
+ @import 'ui-kit/ui-icons';
12
+ @import 'ui-kit/ui-layout';
13
+ @import 'ui-kit/ui-empty-state';
14
+ @import 'ui-kit/ui-footer-help';
15
+ @import 'ui-kit/ui-page-actions';
16
+ @import 'ui-kit/ui-tabs';
@@ -1,3 +1,9 @@
1
+ @charset "UTF-8";
2
+ //
3
+ // flexbox.scss
4
+ // Flexbox mixins.
5
+ // --------------------------------------------------
6
+
1
7
  // Flexbox Mixins
2
8
  // http://philipwalton.github.io/solved-by-flexbox/
3
9
  // https://github.com/philipwalton/solved-by-flexbox
@@ -0,0 +1,94 @@
1
+ //
2
+ // ui-empty-state.scss
3
+ // Styles for empty states not provided by the
4
+ // Channel SDK UI Kit.
5
+ // --------------------------------------------------
6
+
7
+ .ui-empty-state {
8
+ text-align: center;
9
+
10
+ .next-heading {
11
+ font-weight: 300;
12
+
13
+ &:last-child {
14
+ margin-bottom: 0;
15
+ }
16
+ }
17
+ }
18
+
19
+ .ui-empty-state__section {
20
+ padding: 60px 0;
21
+ }
22
+
23
+ .ui-empty-state__subsection {
24
+ @include flexbox();
25
+ @include flex-direction(column);
26
+ @include align-items(center);
27
+
28
+ max-width: 1000px;
29
+ margin-right: auto;
30
+ margin-left: auto;
31
+ padding: 0 30px;
32
+
33
+ & > *+* {
34
+ margin-bottom: 20px;
35
+ }
36
+ }
37
+
38
+ .ui-empty-state__items {
39
+ @include flexbox();
40
+ @include flex-wrap(wrap);
41
+ @include justify-content(center);
42
+
43
+ margin-top: -30px;
44
+ margin-left: -30px;
45
+ max-width: calc(100% + 30px);
46
+ width: calc(100% + 30px);
47
+ }
48
+
49
+ .ui-empty-state__item {
50
+ @include flex(1 1 263.33333px);
51
+ margin-top: 30px;
52
+ margin-left: 30px;
53
+
54
+ &:only-of-type {
55
+ @include flex(0 1 454px);
56
+ }
57
+ }
58
+
59
+ .ui-empty-state__subitems {
60
+ @include flexbox();
61
+ @include flex-wrap(wrap);
62
+
63
+ margin-top: -20px;
64
+ margin-left: -20px;
65
+ max-width: calc(100% + 20px);
66
+ width: calc(100% + 20px);
67
+ }
68
+
69
+ .ui-empty-state__subitem {
70
+ margin-top: 20px;
71
+ margin-left: 20px;
72
+ position: relative;
73
+
74
+ &:first-child {
75
+ @include flex(1 1 150px);
76
+ height: 90px;
77
+ min-width: 0;
78
+ }
79
+
80
+ &:last-child {
81
+ @include flex(1 1 60%);
82
+ }
83
+
84
+
85
+ img {
86
+ margin: 0 auto;
87
+ max-height: 100%;
88
+ position: absolute;
89
+ bottom: 0;
90
+ -webkit-transform: translateX(-50%);
91
+ transform: translateX(-50%);
92
+ left: 50%;
93
+ }
94
+ }
@@ -0,0 +1,25 @@
1
+ //
2
+ // ui-footer-help.scss
3
+ // Styles for footer help not provided by the Channel
4
+ // SDK UI Kit.
5
+ // --------------------------------------------------
6
+
7
+ .ui-footer-help {
8
+ margin: 40px 0;
9
+ text-align: center;
10
+ width: 100%;
11
+ }
12
+
13
+ .ui-footer-help__content {
14
+ @include inline-flex();
15
+ @include align-items(center);
16
+
17
+ border: 1px solid #d3dbe2;
18
+ border-radius: 3px;
19
+ color: #798c9c;
20
+
21
+ font-size: 13px;
22
+ margin: 0 auto;
23
+ padding: 20px;
24
+ text-align: left;
25
+ }
@@ -0,0 +1,28 @@
1
+ //
2
+ // ui-icons.scss
3
+ // Styles for icons not provided by the Channel SDK
4
+ // UI Kit. Note that these are older icons, and will
5
+ // probably be replaced soon.
6
+ // --------------------------------------------------
7
+
8
+ .ico {
9
+ display: inline-block;
10
+ line-height: 0;
11
+ vertical-align: top;
12
+ text-indent: 999em;
13
+ white-space: nowrap;
14
+ overflow: hidden;
15
+ }
16
+
17
+ .ico-delete {
18
+ background-image: url('data:image/svg+xml;charset=US-ASCII,<svg%20xmlns%3D"http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg"%20xmlns%3Axlink%3D"http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink"%20xmlns%3Asketch%3D"http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns"%20width%3D"12px"%20height%3D"12px"%20viewBox%3D"0%200%2012%2012"%20version%3D"1.1"><style%20type%3D"text%2Fcss">circle%2Cellipse%2Cline%2Cpath%2Cpolygon%2Cpolyline%2Crect%2Ctext%7Bfill%3A%23479ccf%20%21important%3B%20%7D<%2Fstyle><title>trash-can-small<%2Ftitle><desc>Created%20with%20Sketch.<%2Fdesc><defs%2F><g%20id%3D"Page-1"%20stroke%3D"none"%20stroke-width%3D"1"%20fill%3D"none"%20fill-rule%3D"evenodd"%20sketch%3Atype%3D"MSPage"><g%20id%3D"trash-can-small"%20sketch%3Atype%3D"MSLayerGroup"%20fill%3D"%23479CCF"><path%20d%3D"M7.63636364%2C1.09090909%20L7.63636364%2C0.818181818%20C7.63636364%2C0.366545455%207.26981818%2C0%206.81818182%2C0%20L5.18181818%2C0%20C4.73018182%2C0%204.36363636%2C0.366545455%204.36363636%2C0.818181818%20L4.36363636%2C1.09090909%20L0.825818182%2C1.09090909%20C0.369818182%2C1.09090909%200%2C1.45745455%200%2C1.90909091%20C0%2C2.36072727%200.369818182%2C3.02727272%200.825818182%2C3.02727272%20L11.1741818%2C3.02727272%20C11.6301818%2C3.02727272%2012%2C2.36072727%2012%2C1.90909091%20C12%2C1.45745455%2011.6301818%2C1.09090909%2011.1741818%2C1.09090909%20L7.63636364%2C1.09090909%20Z"%20id%3D"Fill-1"%20sketch%3Atype%3D"MSShapeGroup"%2F><path%20d%3D"M1.72272728%2C4.05%20C1.57218183%2C4.05%201.45000001%2C4.17218182%201.45000001%2C4.32272728%20L1.45000001%2C11.1136364%20C1.45000001%2C11.5652727%201.81654546%2C11.9318182%202.26818183%2C11.9318182%20L9.75%2C11.9318182%20C10.2016364%2C11.9318182%2010.5681818%2C11.5652727%2010.5681818%2C11.1136364%20L10.5681818%2C4.32272728%20C10.5681818%2C4.17218182%2010.446%2C4.05%2010.2954545%2C4.05%20L1.72272728%2C4.05%20Z%20M7.84090909%2C9.21%20C7.84090909%2C9.50836364%207.59927273%2C9.75%207.30090909%2C9.75%20L7.29%2C9.75%20C6.99163636%2C9.75%206.75%2C9.50836364%206.75%2C9.21%20L6.75%2C6.47181818%20C6.75%2C6.17345455%206.99163636%2C5.93181818%207.29%2C5.93181818%20L7.30090909%2C5.93181818%20C7.59927273%2C5.93181818%207.84090909%2C6.17345455%207.84090909%2C6.47181818%20L7.84090909%2C9.21%20L7.84090909%2C9.21%20Z%20M4.84090909%2C9.21%20C4.84090909%2C9.50836364%204.59927273%2C9.75%204.30090909%2C9.75%20L4.29%2C9.75%20C3.99163636%2C9.75%203.75%2C9.50836364%203.75%2C9.21%20L3.75%2C6.47181818%20C3.75%2C6.17345455%203.99163636%2C5.93181818%204.29%2C5.93181818%20L4.30090909%2C5.93181818%20C4.59927273%2C5.93181818%204.84090909%2C6.17345455%204.84090909%2C6.47181818%20L4.84090909%2C9.21%20L4.84090909%2C9.21%20Z"%20id%3D"Fill-2"%20sketch%3Atype%3D"MSShapeGroup"%2F><%2Fg><%2Fg><%2Fsvg>');
19
+ background-size: auto;
20
+ }
21
+
22
+ .ico-14-svg {
23
+ width: 14px;
24
+ height: 14px;
25
+ background-size: contain;
26
+ background-position: center;
27
+ background-repeat: no-repeat;
28
+ }