activeadmin_dynamic_fields 0.1.5 → 0.2.8

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
- SHA1:
3
- metadata.gz: 42ac2b763d8f98e2e55cf81e3ec76aecf16cec7e
4
- data.tar.gz: 9a7c58695fbb59281f948ce192bfeb0aefe79e2e
2
+ SHA256:
3
+ metadata.gz: 3b1a35cc8fb49264ee130c088dd680bde833cecdcb1fd5f2544b7111369c4f74
4
+ data.tar.gz: 5d72305f05e98728adcb05d03e2d3ffea6fc3c5707544de12c3a045691d45467
5
5
  SHA512:
6
- metadata.gz: 613eeec1ba5f472a7309a0b1463bd06ced96044def8845005f6fc3fad7c44cc40efbbece500af140251ab03ad6001b21f1d40b3205b4bb70167ca819156dfbc0
7
- data.tar.gz: f60670bc64107e1c7d57f19f9792c5dd2485d5d910f22ec970c5f572d7d2703e18c626457bbefc1ab03ff530d1c4549d42e3d2230ee89df92ef520a09c106671
6
+ metadata.gz: a334732f34e9636c60dd6ba376fe0331fc7dbfddb50e5e7c78b7b294758381dacd85ca51a6a61b85b936a937e4d140a467b2f6fd6baf4952599878cbc7ffbfac
7
+ data.tar.gz: c9dd461761fff9e2194368ff22404fca87c688399798ea67ab17bdd292c5dcd2aff7eedd7f16fe44b30a17bc3eb4d76d43ada098ba4b25f57557844d9807a6e6
data/README.md CHANGED
@@ -6,9 +6,10 @@ Features:
6
6
 
7
7
  - set conditional checks on fields
8
8
  - trigger some actions on other fields
9
+ - inline field editing
9
10
  - create links to load some content in a dialog
10
11
 
11
- The easiest way to show how this plugin works is looking the examples [below](#examples-of-dynamic-fields).
12
+ The easiest way to show how this plugin works is looking the examples [below](#examples).
12
13
 
13
14
  ## Install
14
15
 
@@ -26,9 +27,11 @@ Options are passed to fields using *input_html* parameter as *data* attributes:
26
27
  + **not_checked**: check if a checkbox is not checked
27
28
  + **blank**: check if a field is blank
28
29
  + **not_blank**: check if a field is not blank
30
+ + **changed**: check if the value of an input is changed (dirty)
29
31
  - **data-eq**: check if a field has a specific value
30
32
  - **data-not**: check if a field hasn't a specific value
31
- - **data-target**: target css selector
33
+ - **data-target**: target css selector (from parent fieldset, look for the closest match)
34
+ - **data-gtarget**: target css selector globally
32
35
  - **data-action**: the action to trigger, values:
33
36
  + **hide**: hides elements
34
37
  + **slide**: hides elements (using sliding)
@@ -39,24 +42,26 @@ Options are passed to fields using *input_html* parameter as *data* attributes:
39
42
  - **data-function**: check the return value of a custom function
40
43
  - **data-arg**: argument passed to the custom set function (as array of strings)
41
44
 
42
- ## Examples of dynamic fields
45
+ ## Examples
43
46
 
44
- - A checkbox that hides other fields if false (ex. model *Article*):
47
+ ### Dynamic fields examples
48
+
49
+ - A checkbox that hides other fields if is checked (ex. model *Article*):
45
50
 
46
51
  ```rb
47
52
  form do |f|
48
53
  f.inputs 'Article' do
49
- f.input :published, input_html: { data: { if: 'not_checked', action: 'hide', target: '.grp1' } }
54
+ f.input :published, input_html: { data: { if: 'checked', action: 'hide', target: '.grp1' } }
50
55
  f.input :online_date, wrapper_html: { class: 'grp1' }
51
- f.input :position, wrapper_html: { class: 'grp1' }
56
+ f.input :draft_notes, wrapper_html: { class: 'grp1' }
52
57
  end
53
58
  f.actions
54
59
  end
55
60
  ```
56
61
 
57
- - Add 3 classes (*first*, *second*, *third*) if a checkbox is true:
62
+ - Add 3 classes (*first*, *second*, *third*) if a checkbox is not checked:
58
63
 
59
- `f.input :published, input_html: { data: { if: 'checked', action: 'addClass first second third', target: '.grp1' } }`
64
+ `f.input :published, input_html: { data: { if: 'not_checked', action: 'addClass first second third', target: '.grp1' } }`
60
65
 
61
66
  - Set another field value if a string field is blank:
62
67
 
@@ -97,7 +102,45 @@ function on_change_category( el ) {
97
102
  }
98
103
  ```
99
104
 
100
- ## Example to open a dialog
105
+ ### Inline editing examples
106
+
107
+ - Prepare a custom member action to save data, an *update* helper function is available (third parameter is optional, allow to filter using strong parameters):
108
+
109
+ ```rb
110
+ member_action :save, method: [:post] do
111
+ render ActiveAdmin::DynamicFields.update(resource, params)
112
+ # render ActiveAdmin::DynamicFields.update(resource, params, [:published])
113
+ # render ActiveAdmin::DynamicFields.update(resource, params, Article::permit_params)
114
+ end
115
+ ```
116
+
117
+ - In *index* config:
118
+
119
+ ```rb
120
+ # Edit a string:
121
+ column :title do |row|
122
+ div row.title, ActiveAdmin::DynamicFields.edit_string(:title, save_admin_article_path(row.id))
123
+ end
124
+ # Edit a boolean:
125
+ column :published do |row|
126
+ status_tag row.published, ActiveAdmin::DynamicFields.edit_boolean(:published, save_admin_article_path(row.id), row.published)
127
+ end
128
+ # Edit a select ([''] allow to have a blank value):
129
+ column :author do |row|
130
+ select ActiveAdmin::DynamicFields.edit_select(:author_id, save_admin_article_path(row.id)) do
131
+ options_for_select([''] + Author.pluck(:name, :id), row.author_id)
132
+ end
133
+ end
134
+ ```
135
+
136
+ - In *show* config (inside `attributes_table` block):
137
+ ```rb
138
+ row :title do |row|
139
+ div row.title, ActiveAdmin::DynamicFields.edit_string(:title, save_admin_article_path(row.id))
140
+ end
141
+ ```
142
+
143
+ ### Dialog example
101
144
 
102
145
  Example with 2 models: *Author* and *Article*
103
146
 
@@ -107,12 +150,16 @@ Prepare the content dialog - in Active Admin Author config:
107
150
  ActiveAdmin.register Author do
108
151
  # ...
109
152
  member_action :dialog do
110
- content = '<dl style="margin: 12px">'
111
- [:name, :age, :created_at].each do |field|
112
- content += "<dt>#{Author.human_attribute_name(field)}:</dt><dd>#{resource[field]}</dd>"
153
+ record = resource
154
+ context = Arbre::Context.new do
155
+ dl do
156
+ %i[name age created_at].each do |field|
157
+ dt "#{Author.human_attribute_name(field)}:"
158
+ dd record[field]
159
+ end
160
+ end
113
161
  end
114
- content += '</dl>'
115
- render plain: content
162
+ render plain: context
116
163
  end
117
164
  # ...
118
165
  end
@@ -127,7 +174,7 @@ ActiveAdmin.register Article do
127
174
  attributes_table do
128
175
  # ...
129
176
  row :author do
130
- link_to object.author.name, dialog_admin_author_path( object.author ), title: object.author.name, 'data-df-dialog': true, 'data-df-icon': true
177
+ link_to object.author.name, dialog_admin_author_path(object.author), title: object.author.name, 'data-df-dialog': true, 'data-df-icon': true
131
178
  end
132
179
  end
133
180
  end
@@ -141,9 +188,11 @@ The link url is loaded via AJAX before opening the dialog.
141
188
 
142
189
  If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
143
190
 
191
+ Take a look at [other ActiveAdmin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) that I made if you are curious.
192
+
144
193
  ## Contributors
145
194
 
146
- - [Mattia Roccoberton](http://blocknot.es) - creator, maintainer
195
+ - [Mattia Roccoberton](http://blocknot.es): author
147
196
 
148
197
  ## License
149
198
 
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
3
+ require 'bundler/gem_tasks'
@@ -1,130 +1,209 @@
1
1
  // Evaluate a condition
2
- function dfEvalCondition( el, args ) {
3
- if( args.fn ) {
4
- if( args.fn && window[args.fn] ) return !window[args.fn]( el );
5
- else console.log( 'Warning - activeadmin_dynamic_fields: ' + args.fn + '() not available [1]' );
2
+ function dfEvalCondition(el, args, on_change) {
3
+ if(args.fn) {
4
+ if(args.fn && window[args.fn]) return !window[args.fn](el);
5
+ else console.log('Warning - activeadmin_dynamic_fields: ' + args.fn + '() not available [1]');
6
6
  }
7
- else if( args.if == 'checked' ) {
8
- return !el.is(':checked');
9
- }
10
- else if( args.if == 'not_checked' ) {
7
+ else if(args.if == 'checked') {
11
8
  return el.is(':checked');
12
9
  }
13
- else if( args.if == 'blank' ) {
10
+ else if(args.if == 'not_checked') {
11
+ return !el.is(':checked');
12
+ }
13
+ else if(args.if == 'blank') {
14
14
  return el.val().length === 0 || !el.val().trim();
15
15
  }
16
- else if( args.if == 'not_blank' ) {
16
+ else if(args.if == 'not_blank') {
17
17
  return el.val().length !== 0 && el.val().trim();
18
18
  }
19
- else if( args.eq ) {
19
+ else if(args.if == 'changed') {
20
+ return on_change;
21
+ }
22
+ else if(args.eq) {
20
23
  return el.val() == args.eq;
21
24
  }
22
- else if( args.not ) {
25
+ else if(args.not) {
23
26
  return el.val() != args.not;
24
27
  }
25
28
  return undefined;
26
29
  }
27
30
 
28
31
  // Prepare a field
29
- function dfSetupField( el ) {
30
- var action = el.data( 'action' );
32
+ function dfSetupField(el) {
33
+ var action = el.data('action');
31
34
  var target, args = {};
32
- args.if = el.data( 'if' );
33
- args.eq = el.data( 'eq' );
34
- args.not = el.data( 'not' );
35
- args.fn = el.data( 'function' );
36
- if( el.data( 'target' ) ) target = el.closest( 'fieldset' ).find( el.data( 'target' ) )
37
- if( action == 'hide' ) {
38
- if( dfEvalCondition( el, args ) ) target.show();
39
- else target.hide();
40
- el.on( 'change', function( event ) {
41
- if( dfEvalCondition( $(this), args ) ) target.show();
42
- else target.hide();
35
+ args.if = el.data('if');
36
+ args.eq = el.data('eq');
37
+ args.not = el.data('not');
38
+ args.fn = el.data('function');
39
+ if(el.data('target')) target = el.closest('fieldset').find(el.data('target')); // closest find for has many associations
40
+ else if(el.data('gtarget')) target = $(el.data('gtarget'));
41
+ if(action == 'hide') {
42
+ if(dfEvalCondition(el, args, false)) target.hide();
43
+ else target.show();
44
+ el.on('change', function(event) {
45
+ if(dfEvalCondition($(this), args, true)) target.hide();
46
+ else target.show();
43
47
  });
44
48
  }
45
- else if( action == 'slide' ) {
46
- if( dfEvalCondition( el, args ) ) target.slideDown();
49
+ else if(action == 'slide') {
50
+ if(dfEvalCondition(el, args, false)) target.slideDown();
47
51
  else target.slideUp();
48
- el.on( 'change', function( event ) {
49
- if( dfEvalCondition( $(this), args ) ) target.slideDown();
52
+ el.on('change', function(event) {
53
+ if(dfEvalCondition($(this), args, true)) target.slideDown();
50
54
  else target.slideUp();
51
55
  });
52
56
  }
53
- else if( action == 'fade' ) {
54
- if( dfEvalCondition( el, args ) ) target.fadeIn();
57
+ else if(action == 'fade') {
58
+ if(dfEvalCondition(el, args, false)) target.fadeIn();
55
59
  else target.fadeOut();
56
- el.on( 'change', function( event ) {
57
- if( dfEvalCondition( $(this), args ) ) target.fadeIn();
60
+ el.on('change', function(event) {
61
+ if(dfEvalCondition($(this), args, true)) target.fadeIn();
58
62
  else target.fadeOut();
59
63
  });
60
64
  }
61
- else if( action.substr( 0, 8 ) == 'setValue' ) {
62
- var val = action.substr( 8 ).trim();
63
- if( dfEvalCondition( el, args ) ) dfSetValue( target, val );
64
- el.on( 'change', function( event ) {
65
- if( dfEvalCondition( $(this), args ) ) dfSetValue( target, val );
65
+ else if(action.substr(0, 8) == 'setValue') {
66
+ var val = action.substr(8).trim();
67
+ if(dfEvalCondition(el, args, false)) dfSetValue(target, val);
68
+ el.on('change', function(event) {
69
+ if(dfEvalCondition($(this), args, true)) dfSetValue(target, val);
66
70
  });
67
71
  }
68
- else if( action.substr( 0, 8 ) == 'callback' ) {
69
- var cb = action.substr( 8 ).trim();
70
- if( cb && window[cb] ) {
71
- if( dfEvalCondition( el, args ) ) window[cb]( el.data( 'args' ) );
72
- el.on( 'change', function( event ) {
73
- if( dfEvalCondition( $(this), args ) ) window[cb]( el.data( 'args' ) );
72
+ else if(action.substr(0, 8) == 'callback') {
73
+ var cb = action.substr(8).trim();
74
+ if(cb && window[cb]) {
75
+ if(dfEvalCondition(el, args, false)) window[cb](el.data('args'));
76
+ el.on('change', function(event) {
77
+ if(dfEvalCondition($(this), args, true)) window[cb](el.data('args'));
74
78
  });
75
79
  }
76
- else console.log( 'Warning - activeadmin_dynamic_fields: ' + cb + '() not available [2]' );
77
- }
78
- else if( action.substr( 0, 8 ) == 'addClass' ) {
79
- var classes = action.substr( 8 ).trim();
80
- if( dfEvalCondition( el, args ) ) target.removeClass( classes );
81
- else target.addClass( classes );
82
- el.on( 'change', function( event ) {
83
- if( dfEvalCondition( $(this), args ) ) target.removeClass( classes );
84
- else target.addClass( classes );
80
+ else console.log('Warning - activeadmin_dynamic_fields: ' + cb + '() not available [2]');
81
+ }
82
+ else if(action.substr(0, 8) == 'addClass') {
83
+ var classes = action.substr(8).trim();
84
+ if(dfEvalCondition(el, args, false)) target.removeClass(classes);
85
+ else target.addClass(classes);
86
+ el.on('change', function(event) {
87
+ if(dfEvalCondition($(this), args, true)) target.removeClass(classes);
88
+ else target.addClass(classes);
85
89
  });
86
90
  }
87
- else if( args.fn ) { // function without action
88
- dfEvalCondition( el, args );
89
- el.on( 'change', function( event ) {
90
- dfEvalCondition( el, args );
91
+ else if(args.fn) { // function without action
92
+ dfEvalCondition(el, args, false);
93
+ el.on('change', function(event) {
94
+ dfEvalCondition(el, args, true);
91
95
  });
92
96
  }
93
97
  }
94
98
 
95
99
  // Set the value of an element
96
- function dfSetValue( el, val ) {
97
- if( el.attr('type') != 'checkbox' ) el.val( val );
100
+ function dfSetValue(el, val) {
101
+ if(el.attr('type') != 'checkbox') el.val(val);
98
102
  else el.prop('checked', val == '1');
99
- el.trigger( 'change' );
103
+ el.trigger('change');
104
+ }
105
+
106
+ // Inline update - must be called binded on the editing element
107
+ function dfUpdateField() {
108
+ if($(this).data('loading') != '1') {
109
+ $(this).data('loading', '1');
110
+ var _this = $(this);
111
+ var type = $(this).data('field-type');
112
+ var new_value;
113
+ if(type == 'boolean') new_value = !$(this).data('field-value');
114
+ else if(type == 'select') new_value = $(this).val();
115
+ else new_value = $(this).text();
116
+ var data = {};
117
+ data[$(this).data('field')] = new_value;
118
+ $.ajax({
119
+ context: _this,
120
+ data: { data: data },
121
+ method: 'POST',
122
+ url: $(this).data('save-url'),
123
+ complete: function(req, status) {
124
+ $(this).data('loading', '0');
125
+ },
126
+ success: function(data, status, req) {
127
+ if(data.status == 'error') {
128
+ if($(this).data('show-errors')) {
129
+ var result = '';
130
+ var message = data.message;
131
+ for(var key in message) {
132
+ if(typeof(message[key]) === 'object') {
133
+ if(result) result += ' - ';
134
+ result += key + ': ' + message[key].join('; ');
135
+ }
136
+ }
137
+ if(result) alert(result);
138
+ }
139
+ }
140
+ else {
141
+ $(this).data('field-value', new_value);
142
+ if($(this).data('content')) {
143
+ var old_text = $(this).text();
144
+ var old_class = $(this).attr('class');
145
+ var content = $($(this).data('content'));
146
+ $(this).text(content.text());
147
+ $(this).attr('class', content.attr('class'));
148
+ content.text(old_text);
149
+ content.attr('class', old_class);
150
+ $(this).data('content', content);
151
+ }
152
+ }
153
+ }
154
+ });
155
+ }
100
156
  }
101
157
 
102
158
  // Init
103
- $(document).ready( function() {
159
+ $(document).ready(function() {
104
160
  // Setup dynamic fields
105
- $('.active_admin .input [data-if], .active_admin .input [data-function], .active_admin .input [data-eq], .active_admin .input [data-not]').each( function() {
106
- dfSetupField( $(this) );
161
+ $('.active_admin .input [data-if], .active_admin .input [data-function], .active_admin .input [data-eq], .active_admin .input [data-not]').each(function() {
162
+ dfSetupField($(this));
107
163
  });
108
164
  // Setup dynamic fields for has many associations
109
- $('.active_admin .has_many_container').on( 'has_many_add:after', function( e, fieldset, container ) {
110
- $('.active_admin .input [data-if], .active_admin .input [data-function], .active_admin .input [data-eq], .active_admin .input [data-not]').each( function() {
111
- dfSetupField( $(this) );
165
+ $('.active_admin .has_many_container').on('has_many_add:after', function(e, fieldset, container) {
166
+ $('.active_admin .input [data-if], .active_admin .input [data-function], .active_admin .input [data-eq], .active_admin .input [data-not]').each(function() {
167
+ dfSetupField($(this));
112
168
  });
113
169
  });
170
+ // Set dialog icon link
171
+ $('.active_admin [data-df-icon]').each(function() {
172
+ $(this).append(' &raquo;'); // ' &bullet;'
173
+ });
114
174
  // Open content in dialog
115
- $('.active_admin [data-df-dialog]').on( 'click', function( event ) {
175
+ $('.active_admin [data-df-dialog]').on('click', function(event) {
116
176
  event.preventDefault();
117
- if( $('#df-dialog').length == 0 ) $('body').append( '<div id="df-dialog"></div>' );
118
- var title = $(this).attr( 'title' );
119
- $.ajax({
120
- url: $(this).attr( 'href' )
121
- }).done( function( result ) {
122
- if( title ) $('#df-dialog').attr( 'title', title );
123
- $('#df-dialog').html( result );
124
- $('#df-dialog').dialog({ modal: true });
177
+ $(this).blur();
178
+ if($('#df-dialog').data('loading') != '1') {
179
+ $('#df-dialog').data('loading', '1');
180
+ if($('#df-dialog').length == 0) $('body').append('<div id="df-dialog"></div>');
181
+ var title = $(this).attr('title');
182
+ $.ajax({
183
+ url: $(this).attr('href'),
184
+ complete: function(req, status) {
185
+ $('#df-dialog').data('loading', '0');
186
+ },
187
+ success: function(data, status, req) {
188
+ if(title) $('#df-dialog').attr('title', title);
189
+ $('#df-dialog').html(data);
190
+ $('#df-dialog').dialog({ modal: true });
191
+ },
192
+ });
193
+ }
194
+ });
195
+ // Inline editing
196
+ $('[data-field][data-field-type="boolean"][data-save-url]').each(function() {
197
+ $(this).on('click', $.proxy(dfUpdateField, $(this)));
198
+ });
199
+ $('[data-field][data-field-type="string"][data-save-url]').each(function() {
200
+ $(this).data('field-value', $(this).text());
201
+ var fnUpdate = $.proxy(dfUpdateField, $(this));
202
+ $(this).on('blur', function() {
203
+ if($(this).data('field-value') != $(this).text()) fnUpdate();
125
204
  });
126
205
  });
127
- $('.active_admin [data-df-icon]').each( function() {
128
- $(this).append( ' &raquo;' ); // ' &bullet;'
206
+ $('[data-field][data-field-type="select"][data-save-url]').each(function() {
207
+ $(this).on('change', $.proxy(dfUpdateField, $(this)));
129
208
  });
130
209
  });
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'activeadmin/dynamic_fields/engine'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_admin'
2
4
 
3
5
  module ActiveAdmin
@@ -5,5 +7,47 @@ module ActiveAdmin
5
7
  class Engine < ::Rails::Engine
6
8
  engine_name 'activeadmin_dynamic_fields'
7
9
  end
10
+
11
+ def self.edit_boolean(field, url, value)
12
+ {
13
+ 'data-field': field,
14
+ 'data-field-type': 'boolean',
15
+ 'data-field-value': value,
16
+ 'data-content': "<span class=\"status_tag changed\">#{value ? 'no' : 'yes'}</span>",
17
+ 'data-save-url': url,
18
+ 'data-show-errors': '1'
19
+ }
20
+ end
21
+
22
+ def self.edit_select(field, url)
23
+ {
24
+ 'data-field': field,
25
+ 'data-field-type': 'select',
26
+ 'data-save-url': url,
27
+ 'data-show-errors': '1'
28
+ }
29
+ end
30
+
31
+ def self.edit_string(field, url)
32
+ {
33
+ contenteditable: true,
34
+ 'data-field': field,
35
+ 'data-field-type': 'string',
36
+ 'data-save-url': url,
37
+ 'data-show-errors': '1'
38
+ }
39
+ end
40
+
41
+ def self.update(resource, params, permit_params = nil)
42
+ if params[:data]
43
+ if resource.update(permit_params ? params[:data].permit(permit_params) : params[:data].permit!)
44
+ { json: { status: 'ok' } }
45
+ else
46
+ { json: { status: 'error', message: resource.errors } }
47
+ end
48
+ else
49
+ { json: { status: 'error', message: 'No data' }, status: 400 }
50
+ end
51
+ end
8
52
  end
9
53
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveAdmin
2
4
  module DynamicFields
3
- VERSION = '0.1.5'
5
+ VERSION = '0.2.8'
4
6
  end
5
7
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'activeadmin/dynamic_fields'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_dynamic_fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-23 00:00:00.000000000 Z
11
+ date: 2020-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -16,26 +16,149 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activestorage
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 6.0.3.2
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 6.0.3.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: capybara
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.33.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.33.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.13.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.13.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: puma
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.3.5
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.3.5
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec_junit_formatter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.4.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 4.0.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 4.0.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: selenium-webdriver
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.142.7
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.142.7
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.19.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.19.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: sqlite3
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.4.2
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.4.2
27
153
  description: An Active Admin plugin to add dynamic behaviors to fields
28
154
  email: mat@blocknot.es
29
155
  executables: []
30
156
  extensions: []
31
157
  extra_rdoc_files: []
32
158
  files:
33
- - ".gitignore"
34
- - Gemfile
35
159
  - LICENSE.txt
36
160
  - README.md
37
161
  - Rakefile
38
- - activeadmin_dynamic_fields.gemspec
39
162
  - app/assets/javascripts/activeadmin/dynamic_fields.js
40
163
  - lib/activeadmin/dynamic_fields.rb
41
164
  - lib/activeadmin/dynamic_fields/engine.rb
@@ -45,7 +168,7 @@ homepage: https://github.com/blocknotes/activeadmin_dynamic_fields
45
168
  licenses:
46
169
  - MIT
47
170
  metadata: {}
48
- post_install_message:
171
+ post_install_message:
49
172
  rdoc_options: []
50
173
  require_paths:
51
174
  - lib
@@ -60,9 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
183
  - !ruby/object:Gem::Version
61
184
  version: '0'
62
185
  requirements: []
63
- rubyforge_project:
64
- rubygems_version: 2.6.13
65
- signing_key:
186
+ rubygems_version: 3.0.3
187
+ signing_key:
66
188
  specification_version: 4
67
189
  summary: Dynamic fields for ActiveAdmin
68
190
  test_files: []
data/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- _misc/
2
-
3
- *.orig
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
@@ -1,19 +0,0 @@
1
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'activeadmin/dynamic_fields/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'activeadmin_dynamic_fields'
7
- spec.version = ActiveAdmin::DynamicFields::VERSION
8
- spec.summary = 'Dynamic fields for ActiveAdmin'
9
- spec.description = 'An Active Admin plugin to add dynamic behaviors to fields'
10
- spec.license = 'MIT'
11
- spec.authors = ['Mattia Roccoberton']
12
- spec.email = 'mat@blocknot.es'
13
- spec.homepage = 'https://github.com/blocknotes/activeadmin_dynamic_fields'
14
-
15
- spec.files = `git ls-files -z`.split("\x0")
16
- spec.require_paths = ['lib']
17
-
18
- spec.add_runtime_dependency 'activeadmin', '~> 1.0'
19
- end