Skip to content

Commit 22c7703

Browse files
committed
refactored collection components and added default collection ordering like seen on PR of @pascalwengerter
1 parent e077433 commit 22c7703

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

app/concepts/matestack/ui/core/collection/filter/filter.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ def setup
77
end
88

99
def response
10-
components {
11-
div @tag_attributes do
12-
yield_components
13-
end
14-
}
10+
div @tag_attributes do
11+
yield_components
12+
end
1513
end
1614

1715
end

app/concepts/matestack/ui/core/collection/order/order.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const componentDef = {
1616
this.ordering[key] = "asc"
1717
} else if (this.ordering[key] == "asc") {
1818
this.ordering[key] = "desc"
19-
} else if (this.ordering[key] = "desc") {
19+
} else if (this.ordering[key] == "desc") {
2020
this.ordering[key] = undefined
2121
}
2222
var url;

app/concepts/matestack/ui/core/collection/order/order.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ def setup
77
end
88

99
def response
10-
components {
11-
div @tag_attributes do
12-
yield_components
13-
end
14-
}
10+
div @tag_attributes do
11+
yield_components
12+
end
1513
end
1614

1715
end

app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ module Matestack::Ui::Core::Collection::Order::Toggle::Indicator
22
class Indicator < Matestack::Ui::Core::Component::Static
33

44
def response
5-
components {
6-
span @tag_attributes do
7-
plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
8-
end
9-
}
5+
span @tag_attributes do
6+
span attributes: {"v-if": "ordering['#{@component_config[:key]}'] === undefined"}, text: @component_config[:default]
7+
plain "{{
8+
orderIndicator('#{@component_config[:key]}', { asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'})
9+
}}"
10+
end
1011
end
1112

1213
end

vendor/assets/javascripts/dist/matestack-ui-core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/assets/javascripts/dist/matestack-ui-core.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)