disco_app 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/disco_app/components/custom/filterable_shop_list.js.jsx +1 -0
- data/app/assets/javascripts/disco_app/components/custom/shop_filter_query.js.jsx +13 -0
- data/app/controllers/disco_app/admin/concerns/subscriptions_controller.rb +1 -1
- data/app/resources/disco_app/admin/resources/concerns/shop_resource.rb +3 -1
- data/db/migrate/20160513140727_add_name_to_disco_app_shops.rb +5 -0
- data/lib/disco_app/version.rb +1 -1
- data/test/dummy/db/schema.rb +2 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c93d48179fec89b4944ae9428138e3c12827ba628c525af2742afa9532af6abe
|
4
|
+
data.tar.gz: 944da37163b8fbfaa4db0cd5626e76a5a5ff1680284fff69cebd0dddd105d754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23e9f5235c6867c3c77557ed229ddd3de0a3b9d3660ff80a3f06c971ce10d8ab867d30fec229c836542e8865ddb24647282a0cb29049d526e52bc8fd9c641f79
|
7
|
+
data.tar.gz: b3bce74312f85aff46bca48ed90d53b1344e6e82461321bc962e790c5cd9bbd9f21edb53f4e4359e1a3e7db980d0d4899142307534d190a432e4d26273c825c5
|
@@ -52,6 +52,7 @@ var FilterableShopList = React.createClass({
|
|
52
52
|
return (
|
53
53
|
<div className="next-card">
|
54
54
|
<ShopFilterTabs filterTabs={this.props.filterTabs} filter={this.state.filter} onFilterReplace={this.onFilterReplace} />
|
55
|
+
<ShopFilterQuery filter={this.state.filter} onFilterSet={this.onFilterSet} />
|
55
56
|
<ShopList shopsUrl={this.props.shopsUrl} editShopUrl={this.props.editShopUrl} editSubscriptionUrl={this.props.editSubscriptionUrl} filter={this.state.filter} />
|
56
57
|
</div>
|
57
58
|
);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
const ShopFilterQuery = ({ filter, onFilterSet }) => {
|
2
|
+
|
3
|
+
const onChange = (value) => {
|
4
|
+
onFilterSet('filter[query]', value);
|
5
|
+
};
|
6
|
+
|
7
|
+
return (
|
8
|
+
<CardSection>
|
9
|
+
<InputText label="Search" placeholder="Start typing to search for stores..." labelHidden={true} value={filter.query} onChange={onChange} />
|
10
|
+
</CardSection>
|
11
|
+
);
|
12
|
+
|
13
|
+
};
|
@@ -10,7 +10,7 @@ module DiscoApp::Admin::Concerns::SubscriptionsController
|
|
10
10
|
|
11
11
|
def update
|
12
12
|
if @subscription.update_attributes(subscription_params)
|
13
|
-
redirect_to
|
13
|
+
redirect_to edit_admin_shop_subscription_path(@subscription.shop, @subscription)
|
14
14
|
else
|
15
15
|
render 'edit'
|
16
16
|
end
|
@@ -12,7 +12,7 @@ module DiscoApp::Admin::Resources::Concerns::ShopResource
|
|
12
12
|
|
13
13
|
model_name 'DiscoApp::Shop'
|
14
14
|
|
15
|
-
filters :status
|
15
|
+
filters :query, :status
|
16
16
|
|
17
17
|
# Adjust the base records method to ensure only models for the authenticated domain are retrieved.
|
18
18
|
def self.records(options = {})
|
@@ -26,6 +26,8 @@ module DiscoApp::Admin::Resources::Concerns::ShopResource
|
|
26
26
|
|
27
27
|
# Perform appropriate filtering.
|
28
28
|
case filter
|
29
|
+
when :query
|
30
|
+
return records.where('name LIKE ? OR shopify_domain LIKE ? OR domain LIKE ?', "%#{value.first}%", "%#{value.first}%", "%#{value.first}%")
|
29
31
|
when :status
|
30
32
|
return records.where(status: value.map { |v| DiscoApp::Shop.statuses[v.to_sym] } )
|
31
33
|
else
|
data/lib/disco_app/version.rb
CHANGED
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160513140727) do
|
15
15
|
|
16
16
|
# These are extensions that must be enabled in order to support this database
|
17
17
|
enable_extension "plpgsql"
|
@@ -99,6 +99,7 @@ ActiveRecord::Schema.define(version: 20160426033520) do
|
|
99
99
|
t.string "timezone"
|
100
100
|
t.string "iana_timezone"
|
101
101
|
t.boolean "has_storefront"
|
102
|
+
t.string "name"
|
102
103
|
end
|
103
104
|
|
104
105
|
add_index "disco_app_shops", ["shopify_domain"], name: "index_disco_app_shops_on_shopify_domain", unique: true, using: :btree
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disco_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Ballard
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- app/assets/javascripts/disco_app/components/custom/filterable_shop_list.js.jsx
|
319
319
|
- app/assets/javascripts/disco_app/components/custom/inline-radio-options.es6.jsx
|
320
320
|
- app/assets/javascripts/disco_app/components/custom/rules-editor.es6.jsx
|
321
|
+
- app/assets/javascripts/disco_app/components/custom/shop_filter_query.js.jsx
|
321
322
|
- app/assets/javascripts/disco_app/components/custom/shop_filter_tab.js.jsx
|
322
323
|
- app/assets/javascripts/disco_app/components/custom/shop_filter_tabs.js.jsx
|
323
324
|
- app/assets/javascripts/disco_app/components/custom/shop_list.js.jsx
|
@@ -466,6 +467,7 @@ files:
|
|
466
467
|
- db/migrate/20160401045551_add_amount_and_plan_code_to_disco_app_subscriptions.rb
|
467
468
|
- db/migrate/20160425205211_add_source_to_disco_app_subscriptions.rb
|
468
469
|
- db/migrate/20160426033520_add_trial_period_days_to_disco_app_subscriptions.rb
|
470
|
+
- db/migrate/20160513140727_add_name_to_disco_app_shops.rb
|
469
471
|
- lib/disco_app.rb
|
470
472
|
- lib/disco_app/configuration.rb
|
471
473
|
- lib/disco_app/constants.rb
|