keystone_ui-preferences 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f636363927260121283af376ea874a464189878bc0a338840fe5c3a228b13dd
|
|
4
|
+
data.tar.gz: c6e10c6b5e2b4442e74aa0448f7cbd68c23e292b5c21dfd7455291847c12e8c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1ac4cd559b34527ff83fa954a793b8b9433d2c8caf7a76bfb581b8417ad6f6e9bc1c69c1e91b3aaece6466b5529b8124d6466e050e67022b7aef1ecc97a7ffd
|
|
7
|
+
data.tar.gz: f8d94f6d19ce5788906d4eb8ab48c827bc38f631e5e1f3f2b7325931c2d83671efd6d03e6b610ddcb1dbd641599667a3da11050bc9350f32a4fcaaf70a38654c
|
data/README.md
CHANGED
|
@@ -129,7 +129,9 @@ SettingsHub.section :navigation_order, area: :user, title: "Tab order",
|
|
|
129
129
|
|
|
130
130
|
The section lists the groups declared with keystone_ui's `navigation_group`, each with the tabs the person may see, in the order that applies to them. A group with no tab they may see is left out. Each group and tab has an Up and a Down button, and pressing one saves the order with it moved one place, so the page works in a Hotwire Native web view with no script and nothing to drag. At phone width each row's buttons sit under its name.
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
A tab declared outside any group with keystone_ui's `navigation_tab` is one row in the list of groups, named by its label, with the same Up and Down buttons as a group. It has no tab rows under it, and no button moves it into a group.
|
|
133
|
+
|
|
134
|
+
Saving keeps `"order": [{ "group": "Admin" }, { "group": "Sales", "tabs": ["orders", "quotes"] }, { "group": "Console" }]` for that person under the `navigation` key, naming groups by label and tabs by key, and a tab declared outside any group by its label alone. It leaves their saved placement as it was. keystone_ui draws the navigation in that order on the next page they open, with anything the order does not name after it in its declared order. Reset removes the saved order, so the navigation goes back to the declared order. An order that is not a list of groups is refused with a message, and nothing is saved.
|
|
133
135
|
|
|
134
136
|
## What is stored
|
|
135
137
|
|
|
@@ -16,11 +16,17 @@ module KeystoneUi
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def order
|
|
19
|
-
@arranged.map { |group, tabs|
|
|
19
|
+
@arranged.map { |group, tabs| entry(group, tabs) }
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
|
+
def entry(group, tabs)
|
|
25
|
+
return { "group" => group.label } if group.standalone?
|
|
26
|
+
|
|
27
|
+
{ "group" => group.label, "tabs" => tabs.map { |tab| tab.key.to_s } }
|
|
28
|
+
end
|
|
29
|
+
|
|
24
30
|
def moved(items, index, step)
|
|
25
31
|
items.insert(index + step, items.delete_at(index))
|
|
26
32
|
end
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<% end %>
|
|
27
27
|
<% end %>
|
|
28
28
|
<% tabs.each_with_index do |tab, tab_index| %>
|
|
29
|
+
<% next if group.standalone? %>
|
|
29
30
|
<div data-navigation-tab="<%= tab.key %>">
|
|
30
31
|
<%= ui_grid(cols: { default: 1, sm: 2 }, gap: :sm) do %>
|
|
31
32
|
<span data-tab-label><%= tab.label %></span>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keystone_ui-preferences
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.41.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.41.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: railties
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|