card-mod-history 0.11.4 → 0.11.5
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 +4 -4
- data/lib/card/act/act_renderer.rb +1 -1
- data/lib/card/act/act_renderer/relative_act_renderer.rb +1 -2
- data/lib/card/action.rb +1 -3
- data/lib/card/action/action_renderer.rb +2 -1
- data/lib/card/change.rb +2 -1
- data/set/all/history.rb +2 -1
- data/set/all/history/act_listing.rb +1 -0
- data/set/all/history/actions.rb +1 -0
- data/set/all/history/events.rb +2 -2
- data/set/all/history/selected.rb +1 -1
- data/set/all/history_bridge.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f47cae6066494760ecaf1b743c450f83cdb64bb78b805d9a89ecdb4ce4b49c
|
4
|
+
data.tar.gz: 1960fde3b8ecbb5c81be55c3d58396c8102b9d5f08445aa67f76a9450638ed02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1665db38b17b2161b58469430edb76ca1740040fd720d90d1fb0e795520c280df8d468cb9e1febe032c94c780dd88532d28aad030afc8dc759f4e92e644b0b08
|
7
|
+
data.tar.gz: cef187430a6a80a502f6b21d3592c6d0afb90739734808d19ba8a5d68ad9fe68133c58485eb1c70f00dd4e6ccb76ac98903314792b4b7ecebc4e8c8109c42546
|
@@ -173,7 +173,7 @@ class Card
|
|
173
173
|
# save as current:
|
174
174
|
# not current, not deletion
|
175
175
|
def rollback_link
|
176
|
-
return unless card.ok? :update
|
176
|
+
return unless @card.ok? :update
|
177
177
|
|
178
178
|
wrap_with :div, class: "act-link collapse #{collapse_id} float-right" do
|
179
179
|
content_tag(:small, revert_link)
|
@@ -6,9 +6,8 @@ class Card
|
|
6
6
|
# for the card of the format that renders the act.
|
7
7
|
class RelativeActRenderer < ActRenderer
|
8
8
|
def title
|
9
|
-
|
9
|
+
%(<span class="nr">##{@args[:act_seq]}</span>) +
|
10
10
|
accordion_expand_link(@act.actor.name) +
|
11
|
-
" " +
|
12
11
|
wrap_with(:small, edited_ago)
|
13
12
|
end
|
14
13
|
|
data/lib/card/action.rb
CHANGED
@@ -177,9 +177,7 @@ class Card
|
|
177
177
|
|
178
178
|
# all changed values in hash form. { field1: new_value }
|
179
179
|
def changed_values
|
180
|
-
@changed_values ||= changes.
|
181
|
-
h[key] = change.value
|
182
|
-
end
|
180
|
+
@changed_values ||= changes.transform_values(&:value)
|
183
181
|
end
|
184
182
|
|
185
183
|
# @return [Hash]
|
@@ -2,6 +2,7 @@ class Card
|
|
2
2
|
class Action
|
3
3
|
class ActionRenderer
|
4
4
|
attr_reader :action, :header
|
5
|
+
|
5
6
|
def initialize format, action, header=true, action_view=:summary, hide_diff=false
|
6
7
|
@format = format
|
7
8
|
@action = action
|
@@ -58,7 +59,7 @@ class Card
|
|
58
59
|
else
|
59
60
|
link_to_view(
|
60
61
|
:related, name_changes,
|
61
|
-
path: { slot: { items: { view: "history", nest_name: @action.card.name } } }
|
62
|
+
path: { slot: { items: { view: "history", nest_name: @action.card.name } } }
|
62
63
|
# "data-slot-selector" => ".card-slot.history-view"
|
63
64
|
)
|
64
65
|
end
|
data/lib/card/change.rb
CHANGED
data/set/all/history.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
event :update_ancestor_timestamps, :integrate do
|
2
2
|
ids = history_ancestor_ids
|
3
3
|
return unless ids.present?
|
4
|
+
|
4
5
|
Card.where(id: ids).update_all(updater_id: Auth.current_id, updated_at: Time.now)
|
5
6
|
ids.map { |anc_id| Card.expire anc_id.cardname }
|
6
7
|
end
|
@@ -24,7 +25,7 @@ def history_ancestor_ids recursion_level=0
|
|
24
25
|
return [] if recursion_level > 5
|
25
26
|
|
26
27
|
ids = history_parent_ids +
|
27
|
-
|
28
|
+
history_parent_ids.map { |id| Card[id].history_ancestor_ids(recursion_level + 1) }
|
28
29
|
ids.flatten
|
29
30
|
end
|
30
31
|
|
data/set/all/history/actions.rb
CHANGED
data/set/all/history/events.rb
CHANGED
@@ -34,7 +34,7 @@ event :finalize_action, :finalize, when: :finalize_action? do
|
|
34
34
|
if changed_fields.present?
|
35
35
|
@current_action.update! card_id: id
|
36
36
|
|
37
|
-
#
|
37
|
+
# NOTE: #last_change_on uses the id to sort by date
|
38
38
|
# so the changes for the create changes have to be created before the first change
|
39
39
|
store_card_changes_for_create_action if first_change?
|
40
40
|
store_card_changes unless first_create?
|
@@ -64,7 +64,7 @@ def store_each_history_field action_id, fields=nil
|
|
64
64
|
if false # Card::Change.supports_import?
|
65
65
|
# attach.feature fails with this
|
66
66
|
values = fields.map.with_index { |field, index| [index, yield(field), action_id] }
|
67
|
-
Card::Change.import [
|
67
|
+
Card::Change.import %i[field value card_action_id], values # , validate: false
|
68
68
|
else
|
69
69
|
fields.each do |field|
|
70
70
|
Card::Change.create field: field,
|
data/set/all/history/selected.rb
CHANGED
data/set/all/history_bridge.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-05-
|
13
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.101.
|
21
|
+
version: 1.101.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.101.
|
28
|
+
version: 1.101.5
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|