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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6522ecc2e564a8205469ef204144629cf288a990892987fc55c6bbb99d47f4d
4
- data.tar.gz: 89e1e030f3a3b1e984bf99044418fdf21322eb69e0a1781a174e41e7b2fb0d1d
3
+ metadata.gz: c93d48179fec89b4944ae9428138e3c12827ba628c525af2742afa9532af6abe
4
+ data.tar.gz: 944da37163b8fbfaa4db0cd5626e76a5a5ff1680284fff69cebd0dddd105d754
5
5
  SHA512:
6
- metadata.gz: 22d9ab526b4c13feb425d3089d3ad51797361293cd1fe3d41dd3d7b6ef8949d7cf2b8f19025d3fb5d2dfc132893ba021b4c8c79497cbd40fdf71dda7efc9a98f
7
- data.tar.gz: b00bca43bfdf3baf2358c9c9275730db0f1df34a295b056e229a4cb7c96e98c893a04af5b977e2290a0641830bdbe0659a042f6fa39c691f756a9631437858a3
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 edit_admin_shop_subscription(@subscription.shop, @subscription)
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
@@ -0,0 +1,5 @@
1
+ class AddNameToDiscoAppShops < ActiveRecord::Migration
2
+ def change
3
+ add_column :disco_app_shops, :name, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module DiscoApp
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
@@ -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: 20160426033520) do
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.1
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