abstractor 1.0.17 → 1.0.18
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 +8 -8
- data/app/assets/javascripts/abstractor/abstractor.js +5 -0
- data/app/assets/stylesheets/abstractor/abstractor_abstractions.css +49 -47
- data/app/views/abstractor/abstractor_abstraction_groups/_form.html.haml +7 -2
- data/config/routes.rb +1 -1
- data/lib/abstractor/enum.rb +7 -0
- data/lib/abstractor/methods/controllers/abstractor_abstraction_groups_controller.rb +16 -2
- data/lib/abstractor/methods/models/abstractor_abstraction_group.rb +39 -2
- data/lib/abstractor/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGJmNTk4ZjQ4MWRkNDkzYTgzMDM3ZjU3NjUzM2FiYTdmNzE1MDUwOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjAzNDgzZGQzZDVjOTg5NmM3NGJlMjEyYjEzNTg1ZmE2ODkyZTQ1ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzhiMDhhOWFiYTkwOTczOGI3ZmVlMzhhYTAwMzNjZTFmNTQwOGQ2YjBkMGJk
|
10
|
+
NjFjNmJhOGE2YTRkOWM2NzMwOWJhMjdkMDVhMDEzYTMyNWJkNGNiOGEwOTRk
|
11
|
+
MDQ3NDk2MDdlNmVkMmJlYjM3ZTVlZDcyODkzMThlNTJhM2ExNTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjQ1ZjNhZGU1YTgyOGYxMTkwNDM0MTdiYmI4YjQ1NWM5NmYxYjc4OThkYWFj
|
14
|
+
NWYzZDdkODE5ZGZkMGY4OTU2NzRiZDkyMGUwZWYwNjhhM2ZiM2RjOWRiMjY3
|
15
|
+
NDQwZTViZTIzNWNkZDI3MzEzYTlhMjI2YzE5NzdiNGQ1NWYyNDQ=
|
@@ -93,4 +93,9 @@ Abstractor.AbstractionGroupUI = function(){
|
|
93
93
|
parent_div = $(this).closest('.abstractor_subject_groups_container');
|
94
94
|
parent_div.find('.abstractor_subject_groups').append(xhr.responseText);
|
95
95
|
});
|
96
|
+
|
97
|
+
$(document).on('ajax:success', '.abstractor_abstraction_group .update_link', function(e, data, status, xhr){
|
98
|
+
parent_div = $(this).closest('.abstractor_abstraction_group');
|
99
|
+
parent_div.html(xhr.responseText);
|
100
|
+
});
|
96
101
|
};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/* line 1, ../../app/assets/stylesheets/partials/_abstractor_abstractions.css.scss */
|
2
1
|
.abstractor_abstractions {
|
3
2
|
display: inline;
|
4
3
|
float: left;
|
@@ -7,236 +6,235 @@
|
|
7
6
|
margin-top: 1.5em;
|
8
7
|
margin-bottom: 1.5em;
|
9
8
|
}
|
10
|
-
|
9
|
+
|
11
10
|
* html .abstractor_abstractions {
|
12
11
|
overflow-x: hidden;
|
13
12
|
}
|
14
|
-
|
13
|
+
|
15
14
|
.abstractor_abstractions label, .abstractor_abstractions input {
|
16
15
|
display: inline-block;
|
17
16
|
margin-bottom: 0.6em;
|
18
17
|
font-weight: normal !important;
|
19
18
|
}
|
20
|
-
|
19
|
+
|
21
20
|
.abstractor_abstractions input[type="submit"] {
|
22
21
|
margin-bottom: 0;
|
23
22
|
}
|
24
|
-
|
23
|
+
|
25
24
|
.abstractor_abstractions .highlighted {
|
26
25
|
background: #e6e6e6;
|
27
26
|
padding: 0.25em;
|
28
27
|
}
|
29
|
-
|
28
|
+
|
30
29
|
.abstractor_abstractions fieldset {
|
31
30
|
border: 1px solid #969696;
|
32
31
|
margin: 0.75em 0;
|
33
32
|
padding: 0.75em 0.5em 0.4em 0.5em;
|
34
33
|
}
|
35
|
-
|
34
|
+
|
36
35
|
.abstractor_abstractions fieldset .delete_link {
|
37
36
|
float: right;
|
38
37
|
}
|
39
|
-
|
38
|
+
|
40
39
|
.abstractor_abstractions fieldset input.combobox {
|
41
40
|
vertical-align: bottom;
|
42
41
|
width: 12em !important;
|
43
42
|
}
|
44
|
-
|
43
|
+
|
45
44
|
.abstractor_abstractions fieldset .ui-button-icon-only {
|
46
45
|
margin-bottom: 0.6em;
|
47
46
|
}
|
48
|
-
|
47
|
+
|
49
48
|
.abstractor_abstractions fieldset .ui-button-icon-only .ui-icon {
|
50
49
|
margin-left: -8px !important;
|
51
50
|
margin-top: -8px !important;
|
52
51
|
}
|
53
|
-
|
52
|
+
|
54
53
|
.abstractor_abstractions fieldset .ui-button-icon-only span.ui-button-text {
|
55
54
|
padding: 0;
|
56
55
|
margin: 0.1em 0 0.25em !important;
|
57
56
|
}
|
58
|
-
|
57
|
+
|
59
58
|
.abstractor_abstractions fieldset .column-1-5 {
|
60
59
|
display: inline;
|
61
60
|
float: left;
|
62
61
|
margin-right: 10px;
|
63
62
|
width: 62.625px;
|
64
63
|
}
|
65
|
-
|
64
|
+
|
66
65
|
* html .abstractor_abstractions fieldset .column-1-5 {
|
67
66
|
overflow-x: hidden;
|
68
67
|
}
|
69
|
-
|
68
|
+
|
70
69
|
.abstractor_abstractions fieldset .column-1 {
|
71
70
|
display: inline;
|
72
71
|
float: left;
|
73
72
|
margin-right: 10px;
|
74
73
|
width: 38.41667px;
|
75
74
|
}
|
76
|
-
|
75
|
+
|
77
76
|
* html .abstractor_abstractions fieldset .column-1 {
|
78
77
|
overflow-x: hidden;
|
79
78
|
}
|
80
|
-
|
79
|
+
|
81
80
|
.abstractor_abstractions fieldset .column-2 {
|
82
81
|
display: inline;
|
83
82
|
float: left;
|
84
83
|
margin-right: 10px;
|
85
84
|
width: 86.83333px;
|
86
85
|
}
|
87
|
-
|
86
|
+
|
88
87
|
* html .abstractor_abstractions fieldset .column-2 {
|
89
88
|
overflow-x: hidden;
|
90
89
|
}
|
91
|
-
|
90
|
+
|
92
91
|
.abstractor_abstractions fieldset .column-3 {
|
93
92
|
display: inline;
|
94
93
|
float: left;
|
95
94
|
margin-right: 10px;
|
96
95
|
width: 135.25px;
|
97
96
|
}
|
98
|
-
|
97
|
+
|
99
98
|
* html .abstractor_abstractions fieldset .column-3 {
|
100
99
|
overflow-x: hidden;
|
101
100
|
}
|
102
|
-
|
101
|
+
|
103
102
|
.abstractor_abstractions fieldset .column-4 {
|
104
103
|
display: inline;
|
105
104
|
float: left;
|
106
105
|
margin-right: 10px;
|
107
106
|
width: 183.66667px;
|
108
107
|
}
|
109
|
-
|
108
|
+
|
110
109
|
* html .abstractor_abstractions fieldset .column-4 {
|
111
110
|
overflow-x: hidden;
|
112
111
|
}
|
113
|
-
|
112
|
+
|
114
113
|
.abstractor_abstractions fieldset .column-5 {
|
115
114
|
display: inline;
|
116
115
|
float: left;
|
117
116
|
margin-right: 10px;
|
118
117
|
width: 232.08333px;
|
119
118
|
}
|
120
|
-
|
119
|
+
|
121
120
|
* html .abstractor_abstractions fieldset .column-5 {
|
122
121
|
overflow-x: hidden;
|
123
122
|
}
|
124
|
-
|
123
|
+
|
125
124
|
.abstractor_abstractions fieldset .column-6 {
|
126
125
|
display: inline;
|
127
126
|
float: left;
|
128
127
|
margin-right: 10px;
|
129
128
|
width: 280.5px;
|
130
129
|
}
|
131
|
-
|
130
|
+
|
132
131
|
* html .abstractor_abstractions fieldset .column-6 {
|
133
132
|
overflow-x: hidden;
|
134
133
|
}
|
135
|
-
|
134
|
+
|
136
135
|
.abstractor_abstractions fieldset .column-7 {
|
137
136
|
display: inline;
|
138
137
|
float: left;
|
139
138
|
margin-right: 10px;
|
140
139
|
width: 328.91667px;
|
141
140
|
}
|
142
|
-
|
141
|
+
|
143
142
|
* html .abstractor_abstractions fieldset .column-7 {
|
144
143
|
overflow-x: hidden;
|
145
144
|
}
|
146
|
-
|
145
|
+
|
147
146
|
.abstractor_abstractions fieldset .column-8 {
|
148
147
|
display: inline;
|
149
148
|
float: left;
|
150
149
|
margin-right: 10px;
|
151
150
|
width: 377.33333px;
|
152
151
|
}
|
153
|
-
|
152
|
+
|
154
153
|
* html .abstractor_abstractions fieldset .column-8 {
|
155
154
|
overflow-x: hidden;
|
156
155
|
}
|
157
|
-
|
156
|
+
|
158
157
|
.abstractor_abstractions fieldset .column-9 {
|
159
158
|
display: inline;
|
160
159
|
float: left;
|
161
160
|
margin-right: 10px;
|
162
161
|
width: 425.75px;
|
163
162
|
}
|
164
|
-
|
163
|
+
|
165
164
|
* html .abstractor_abstractions fieldset .column-9 {
|
166
165
|
overflow-x: hidden;
|
167
166
|
}
|
168
|
-
|
167
|
+
|
169
168
|
.abstractor_abstractions fieldset .column-10 {
|
170
169
|
display: inline;
|
171
170
|
float: left;
|
172
171
|
margin-right: 10px;
|
173
172
|
width: 474.16667px;
|
174
173
|
}
|
175
|
-
|
174
|
+
|
176
175
|
* html .abstractor_abstractions fieldset .column-10 {
|
177
176
|
overflow-x: hidden;
|
178
177
|
}
|
179
|
-
|
178
|
+
|
180
179
|
.abstractor_abstractions fieldset .column-11 {
|
181
180
|
display: inline;
|
182
181
|
float: left;
|
183
182
|
margin-right: 10px;
|
184
183
|
width: 522.58333px;
|
185
184
|
}
|
186
|
-
|
185
|
+
|
187
186
|
* html .abstractor_abstractions fieldset .column-11 {
|
188
187
|
overflow-x: hidden;
|
189
188
|
}
|
190
|
-
|
189
|
+
|
191
190
|
.abstractor_abstractions fieldset .column-12 {
|
192
191
|
display: inline;
|
193
192
|
float: left;
|
194
193
|
margin-right: 10px;
|
195
194
|
width: 571px;
|
196
195
|
}
|
197
|
-
|
196
|
+
|
198
197
|
* html .abstractor_abstractions fieldset .column-12 {
|
199
198
|
overflow-x: hidden;
|
200
199
|
}
|
201
|
-
|
200
|
+
|
202
201
|
.abstractor_abstractions fieldset .clear {
|
203
202
|
clear: both;
|
204
203
|
}
|
205
|
-
|
204
|
+
|
206
205
|
.abstractor_abstractions fieldset .abstraction_schema_name {
|
207
206
|
font-weight: bold;
|
208
207
|
margin-bottom: 0.3em;
|
209
208
|
}
|
210
|
-
|
209
|
+
|
211
210
|
.abstractor_abstractions fieldset .abstractor_abstraction_value {
|
212
211
|
margin-bottom: 0.5em;
|
213
212
|
}
|
214
|
-
|
213
|
+
|
215
214
|
.abstractor_abstractions fieldset .editable_abstraction {
|
216
215
|
border-bottom: 1px #969696 dashed;
|
217
216
|
}
|
218
|
-
|
217
|
+
|
219
218
|
.abstractor_abstractions fieldset .abstractor_abstraction_source_tooltip_img img {
|
220
219
|
vertical-align: text-bottom;
|
221
220
|
}
|
222
|
-
|
221
|
+
|
223
222
|
.abstractor_abstractions fieldset .hidden {
|
224
223
|
display: none;
|
225
224
|
}
|
226
|
-
|
225
|
+
|
227
226
|
.abstractor_abstractions fieldset .abstractor_abstraction_edit div {
|
228
227
|
padding: 2px 0;
|
229
228
|
}
|
230
|
-
|
229
|
+
|
231
230
|
.abstractor_abstractions fieldset a.button {
|
232
231
|
vertical-align: bottom;
|
233
232
|
}
|
234
|
-
|
233
|
+
|
235
234
|
.abstractor_abstractions .abstractor_abstraction_source_tooltip {
|
236
235
|
display: none;
|
237
236
|
}
|
238
237
|
|
239
|
-
/* line 110, ../../app/assets/stylesheets/partials/_abstractor_abstractions.css.scss */
|
240
238
|
ul.ui-autocomplete, .ui-dialog {
|
241
239
|
z-index: 1000 !important;
|
242
240
|
}
|
@@ -310,3 +308,7 @@ span.tooltip_img {
|
|
310
308
|
.watermark {
|
311
309
|
font-style:italic
|
312
310
|
}
|
311
|
+
|
312
|
+
.abstractor_abstraction_actions {
|
313
|
+
float: right;
|
314
|
+
}
|
@@ -4,7 +4,12 @@
|
|
4
4
|
- abstractor_abstraction_group.abstractor_abstractions.not_deleted.joins(:abstractor_subject => :abstractor_subject_group_member).order('abstractor_subject_group_members.display_order').each do |abstractor_abstraction|
|
5
5
|
%div{ class: "abstractor_abstraction #{Abstractor::Utility.dehumanize(abstractor_abstraction.abstractor_subject.abstractor_abstraction_schema.predicate)}" }
|
6
6
|
= render :partial => 'abstractor/abstractor_abstractions/fields', :locals => {:abstractor_abstraction => abstractor_abstraction}
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
.abstractor_abstraction_actions
|
9
|
+
= link_to 'Not applicable group ', Abstractor::UserInterface.abstractor_relative_path(abstractor.abstractor_abstraction_group_path(abstractor_abstraction_group, abstractor_abstraction_value: 'not applicable')), :confirm => 'Are you sure?', :method => :put, :class => "icon_link update_link", :remote => true
|
10
|
+
%br
|
11
|
+
= link_to 'Unknown group ', Abstractor::UserInterface.abstractor_relative_path(abstractor.abstractor_abstraction_group_path(abstractor_abstraction_group, abstractor_abstraction_value: 'unknown')), :confirm => 'Are you sure?', :method => :put, :class => "icon_link update_link", :remote => true
|
12
|
+
- if abstractor_abstraction_group.removable?
|
13
|
+
%br
|
9
14
|
= link_to 'Delete group', Abstractor::UserInterface.abstractor_relative_path(abstractor.abstractor_abstraction_group_path(abstractor_abstraction_group)), :confirm => 'Are you sure?', :method => :delete, :class => "icon_link delete_link", :remote => true
|
10
15
|
%hr
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,7 @@
|
|
1
|
+
module Abstractor
|
2
|
+
module Enum
|
3
|
+
ABSTRACTION_OTHER_VALUE_TYPE_UNKNOWN = 'unknown'
|
4
|
+
ABSTRACTION_OTHER_VALUE_TYPE_NOT_APPLICABLE = 'not applicable'
|
5
|
+
ABSTRACTION_OTHER_VALUE_TYPES = [ABSTRACTION_OTHER_VALUE_TYPE_UNKNOWN, ABSTRACTION_OTHER_VALUE_TYPE_NOT_APPLICABLE]
|
6
|
+
end
|
7
|
+
end
|
@@ -4,6 +4,7 @@ module Abstractor
|
|
4
4
|
module AbstractorAbstractionGroupsController
|
5
5
|
def self.included(base)
|
6
6
|
base.send :helper, :all
|
7
|
+
base.send :before_filter, :set_abstractor_abstraction_group, only: [:destroy, :update]
|
7
8
|
end
|
8
9
|
|
9
10
|
def create
|
@@ -20,8 +21,7 @@ module Abstractor
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def destroy
|
23
|
-
abstractor_abstraction_group
|
24
|
-
if abstractor_abstraction_group.soft_delete!
|
24
|
+
if @abstractor_abstraction_group.soft_delete!
|
25
25
|
flash[:notice] = "Group was successfully deleted."
|
26
26
|
else
|
27
27
|
flash[:error] = "Group could not be deactivated: #{abstractor_abstraction_group.errors.full_messages.join(',')}"
|
@@ -31,6 +31,20 @@ module Abstractor
|
|
31
31
|
format.json { head :no_content }
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
def update
|
36
|
+
abstractor_abstraction_value = params[:abstractor_abstraction_value]
|
37
|
+
@abstractor_abstraction_group.update_abstractor_abstraction_other_value(abstractor_abstraction_value)
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
format.html { render action: "edit", layout: false }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def set_abstractor_abstraction_group
|
46
|
+
@abstractor_abstraction_group = Abstractor::AbstractorAbstractionGroup.find(params[:id])
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
36
50
|
end
|
@@ -18,11 +18,48 @@ module Abstractor
|
|
18
18
|
base.send :after_commit, :update_abstractor_abstraction_group_members, :on => :update, :if => Proc.new { |record| record.previous_changes.include?('deleted_at') }
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
##
|
22
|
+
# Determines if the group can be removed.
|
23
|
+
#
|
24
|
+
# @return [Boolean]
|
22
25
|
def removable?
|
23
26
|
abstractor_abstractions.map(&:abstractor_suggestions).flatten.empty?
|
24
27
|
end
|
25
28
|
|
29
|
+
##
|
30
|
+
# Updates all abstractor abstractions in a group to 'not applicable' or 'unknown'.
|
31
|
+
#
|
32
|
+
# @param [Abstractor::Enum::ABSTRACTION_OTHER_VALUE_TYPE_UNKNOWN, Abstractor::Enum::ABSTRACTION_OTHER_VALUE_TYPE_NOT_APPLICABLE] abstraction_other_value_type contorls whether to update all abstractor abstractions in the group to 'unknown' or 'not applicable'
|
33
|
+
# @return [void]
|
34
|
+
def update_abstractor_abstraction_other_value(abstraction_other_value_type)
|
35
|
+
raise(ArgumentError, "abstraction_value_type argument invalid") unless Abstractor::Enum::ABSTRACTION_OTHER_VALUE_TYPES.include?(abstraction_other_value_type)
|
36
|
+
|
37
|
+
rejected_status = Abstractor::AbstractorSuggestionStatus.where(:name => 'Rejected').first
|
38
|
+
case abstraction_other_value_type
|
39
|
+
when Abstractor::Enum::ABSTRACTION_OTHER_VALUE_TYPE_UNKNOWN
|
40
|
+
unknown = true
|
41
|
+
not_applicable = false
|
42
|
+
when Abstractor::Enum::ABSTRACTION_OTHER_VALUE_TYPE_NOT_APPLICABLE
|
43
|
+
unknown = false
|
44
|
+
not_applicable = true
|
45
|
+
end
|
46
|
+
|
47
|
+
Abstractor::AbstractorAbstraction.transaction do
|
48
|
+
if abstraction_other_value_type
|
49
|
+
abstractor_abstractions.each do |abstractor_abstraction|
|
50
|
+
abstractor_abstraction.abstractor_suggestions.each do |abstractor_suggestion|
|
51
|
+
abstractor_suggestion.abstractor_suggestion_status = rejected_status
|
52
|
+
abstractor_suggestion.save!
|
53
|
+
end
|
54
|
+
abstractor_abstraction.value = nil
|
55
|
+
abstractor_abstraction.unknown = unknown
|
56
|
+
abstractor_abstraction.not_applicable = not_applicable
|
57
|
+
abstractor_abstraction.save!
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
26
63
|
private
|
27
64
|
def update_abstractor_abstraction_group_members
|
28
65
|
return unless deleted?
|
@@ -34,4 +71,4 @@ module Abstractor
|
|
34
71
|
end
|
35
72
|
end
|
36
73
|
end
|
37
|
-
end
|
74
|
+
end
|
data/lib/abstractor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abstractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Gurley, Yulia Bushmanova
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -506,6 +506,7 @@ files:
|
|
506
506
|
- lib/abstractor/abstractable.rb
|
507
507
|
- lib/abstractor/core_ext/string.rb
|
508
508
|
- lib/abstractor/engine.rb
|
509
|
+
- lib/abstractor/enum.rb
|
509
510
|
- lib/abstractor/methods/controllers/abstractor_abstraction_groups_controller.rb
|
510
511
|
- lib/abstractor/methods/controllers/abstractor_abstractions_controller.rb
|
511
512
|
- lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
|