netzke-basepack 1.0.1.0 → 6.5.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -5
- data/javascripts/bugfixes.js +22 -0
- data/lib/netzke/basepack.rb +1 -1
- data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +5 -3
- data/lib/netzke/basepack/dynamic_tab_panel/client/dynamic_tab_panel.js +8 -0
- data/lib/netzke/basepack/query_builder/client/query_builder.js +1 -1
- data/lib/netzke/basepack/search_panel/client/search_panel.js +2 -2
- data/lib/netzke/basepack/version.rb +1 -1
- data/lib/netzke/form/base/client/base.js +2 -2
- data/lib/netzke/grid/base/client/base.js +88 -2
- data/lib/netzke/tree/base/client/base.js +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abface49496fbac7db4c6a3ccbe7feba74ff737c
|
4
|
+
data.tar.gz: 3f2d99ca02b0310ae057b6edfc720b4a2e813716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec16ea92de9fe52f5dcd15ccd8a10cedeb95624fd0e3b5f699f71710053569a45f35fd5dcd4c33bb53c89931896de9fd2a5729e946c2c69d3002b74ef1ab8ef
|
7
|
+
data.tar.gz: 0f18fb84455621cd1b9d721e36d8c89960f82d3d3cbf5b18368b2e66274ff66674eef7aaff4eca49815f8ae5c4b195b0aeb6346f69af9234e109440f4263ede0
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'rails', '~>
|
5
|
+
gem 'rails', '~>5.1.0'
|
6
6
|
gem 'sqlite3'
|
7
7
|
gem 'yard'
|
8
8
|
gem 'rake'
|
@@ -15,7 +15,9 @@ group :test do
|
|
15
15
|
gem 'rspec-rails'
|
16
16
|
gem 'factory_girl'
|
17
17
|
gem 'capybara'
|
18
|
-
gem 'selenium
|
18
|
+
gem 'capybara-selenium'
|
19
|
+
gem 'selenium-webdriver', '~> 3.4.4'
|
20
|
+
gem 'chromedriver-helper'
|
19
21
|
gem 'database_cleaner'
|
20
22
|
end
|
21
23
|
|
@@ -24,9 +26,8 @@ group :development do
|
|
24
26
|
end
|
25
27
|
|
26
28
|
group :development, :test do
|
27
|
-
# gem 'spring' # troubles...
|
28
29
|
gem 'pry-rails'
|
29
|
-
gem 'netzke-core',
|
30
|
-
gem 'netzke-testing',
|
30
|
+
gem 'netzke-core', git: 'https://github.com/netzke/netzke-core', branch: '6-5-0'
|
31
|
+
gem 'netzke-testing', git: 'https://github.com/netzke/netzke-testing', branch: '6-5-0'
|
31
32
|
gem 'faker'
|
32
33
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Ext.define('Ext.data.operation.OperationsOverrided', {
|
2
|
+
override : 'Ext.data.operation.Operation',
|
3
|
+
|
4
|
+
initialize : function() {
|
5
|
+
this.callOverridden(arguments);
|
6
|
+
},
|
7
|
+
|
8
|
+
execute: function() {
|
9
|
+
var me = this,
|
10
|
+
request;
|
11
|
+
delete me.error;
|
12
|
+
delete me.success;
|
13
|
+
me.complete = me.exception = false;
|
14
|
+
me.setStarted();
|
15
|
+
me.request = request = me.doExecute();
|
16
|
+
// Original version calls setOperation even when request doesn't have this method.
|
17
|
+
if (request && request.setOperation) {
|
18
|
+
request.setOperation(me);
|
19
|
+
}
|
20
|
+
return request;
|
21
|
+
},
|
22
|
+
});
|
data/lib/netzke/basepack.rb
CHANGED
@@ -18,7 +18,7 @@ module Netzke
|
|
18
18
|
class << self
|
19
19
|
# Called from netzke-basepack.rb
|
20
20
|
def init
|
21
|
-
%w[tristate netzkeremotecombo xdatetime basepack grid/columns grid/event_handlers].each do |name|
|
21
|
+
%w[bugfixes tristate netzkeremotecombo xdatetime basepack grid/columns grid/event_handlers].each do |name|
|
22
22
|
Netzke::Core.ext_javascripts << "#{File.dirname(__FILE__)}/../../javascripts/#{name}.js"
|
23
23
|
end
|
24
24
|
|
@@ -326,7 +326,7 @@ module Netzke::Basepack::DataAdapters
|
|
326
326
|
return nil if conditions.empty?
|
327
327
|
|
328
328
|
predicates = conditions.map do |q|
|
329
|
-
q = HashWithIndifferentAccess.new(q)
|
329
|
+
q = HashWithIndifferentAccess.new(Netzke::Support.permit_hash_params(q))
|
330
330
|
|
331
331
|
attr = q[:attr]
|
332
332
|
method, assoc = method_and_assoc(attr)
|
@@ -445,11 +445,13 @@ module Netzke::Basepack::DataAdapters
|
|
445
445
|
when Proc
|
446
446
|
scope.call(relation)
|
447
447
|
when Hash
|
448
|
-
relation.where(scope)
|
448
|
+
relation.where(Netzke::Support.permit_hash_params(scope))
|
449
|
+
when ActionController::Parameters
|
450
|
+
relation.where(Netzke::Support.permit_hash_params(scope))
|
449
451
|
when NilClass
|
450
452
|
relation
|
451
453
|
else
|
452
|
-
raise ArgumentError, "Expected scope to be a Proc or a Hash, got #{scope.class}"
|
454
|
+
raise ArgumentError, "Expected scope to be a Proc, ActionController::Parameters or a Hash, got #{scope.class}"
|
453
455
|
end
|
454
456
|
end
|
455
457
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
f.ownerCt = this;
|
15
15
|
this.insert(this.items.length - 1, Ext.createByAlias('widget.netzkebasepacksearchpanelconditionfield', f));
|
16
16
|
}, this);
|
17
|
-
this.
|
17
|
+
this.updateLayout();
|
18
18
|
},
|
19
19
|
|
20
20
|
netzkeOnAddCondition: function() {
|
@@ -23,7 +23,7 @@
|
|
23
23
|
this.netzkeOnAddCondition();
|
24
24
|
}, this, {single: true});
|
25
25
|
this.add(condField);
|
26
|
-
this.
|
26
|
+
this.updateLayout();
|
27
27
|
this.fireEvent('fieldsnumberchange');
|
28
28
|
},
|
29
29
|
|
@@ -99,7 +99,7 @@
|
|
99
99
|
tbar.insert( buttonIndex, this.actions.apply );
|
100
100
|
}
|
101
101
|
|
102
|
-
tbar.
|
102
|
+
tbar.updateLaytout();
|
103
103
|
},
|
104
104
|
|
105
105
|
/**
|
@@ -213,7 +213,7 @@
|
|
213
213
|
});
|
214
214
|
|
215
215
|
// this.getForm().cleanDestroyed(); // because fields inside of composite fields are not auto-cleaned!
|
216
|
-
this.
|
216
|
+
this.updateLayout();
|
217
217
|
this.inReadonlyMode = onOff;
|
218
218
|
if (this.mode == "lockable") this.netzkeUpdateToolbar();
|
219
219
|
},
|
@@ -131,9 +131,40 @@
|
|
131
131
|
this.netzkeBulkExecute(commands);
|
132
132
|
}, this);
|
133
133
|
|
134
|
+
this.netzkeApplyStoreBugfixes(store)
|
135
|
+
|
134
136
|
return store;
|
135
137
|
},
|
136
138
|
|
139
|
+
// Modifies store, to avoid bugs in Ext.js
|
140
|
+
netzkeApplyStoreBugfixes(store) {
|
141
|
+
store.totalCount = store.totalCount === undefined ? 0 : store.totalCount;
|
142
|
+
|
143
|
+
store._oldGetRange = store.getRange
|
144
|
+
store.getRange = function(start, end, options) {
|
145
|
+
var newEnd;
|
146
|
+
var newStart = start === undefined ? 0 : start;
|
147
|
+
|
148
|
+
if (end !== undefined) { newEnd = end }
|
149
|
+
else if (this.totalCount !== undefined) { newEnd = this.totalCount }
|
150
|
+
else { newEnd = 0 }
|
151
|
+
|
152
|
+
return this._oldGetRange(newStart, newEnd, options)
|
153
|
+
}
|
154
|
+
|
155
|
+
// When store is empty
|
156
|
+
store._oldRangeCached = store.rangeCached;
|
157
|
+
|
158
|
+
store.rangeCached = function(start, end) {
|
159
|
+
var newEnd = end < 0 ? 0 : end;
|
160
|
+
return this._oldRangeCached(start, newEnd);
|
161
|
+
}
|
162
|
+
|
163
|
+
store.prefetch = this.prefetchFix;
|
164
|
+
|
165
|
+
return store
|
166
|
+
},
|
167
|
+
|
137
168
|
/**
|
138
169
|
* @method netzkeStoreConfig
|
139
170
|
* @return {Object} Configuration for the store
|
@@ -148,9 +179,9 @@
|
|
148
179
|
buffered: this.paging == 'buffered'
|
149
180
|
};
|
150
181
|
|
151
|
-
if (this.paging == 'buffered') defaults.pageSize = 300;
|
182
|
+
if (this.paging == 'buffered') { defaults.pageSize = 300; }
|
152
183
|
|
153
|
-
if (this.paging == 'none') defaults.pageSize = 0;
|
184
|
+
if (this.paging == 'none') { defaults.pageSize = 0; }
|
154
185
|
|
155
186
|
return Ext.apply({}, this.storeConfig, defaults);
|
156
187
|
},
|
@@ -192,5 +223,60 @@
|
|
192
223
|
if (store.getNewRecords().length > 0 || store.getModifiedRecords().length > 0) {
|
193
224
|
return confirm(this.i18n.proceedWithUnappliedChanges);
|
194
225
|
}
|
226
|
+
},
|
227
|
+
|
228
|
+
prefetchFix: function(options) {
|
229
|
+
var me = this,
|
230
|
+
pageSize = me.getPageSize(),
|
231
|
+
data = me.getData(),
|
232
|
+
operation, existingPageRequest;
|
233
|
+
// Check pageSize has not been tampered with. That would break page caching
|
234
|
+
if (pageSize) {
|
235
|
+
if (me.lastPageSize && pageSize != me.lastPageSize) {
|
236
|
+
Ext.raise("pageSize cannot be dynamically altered");
|
237
|
+
}
|
238
|
+
if (!data.getPageSize()) {
|
239
|
+
data.setPageSize(pageSize);
|
240
|
+
}
|
241
|
+
} else // Allow first prefetch call to imply the required page size.
|
242
|
+
{
|
243
|
+
me.pageSize = data.setPageSize(pageSize = options.limit);
|
244
|
+
}
|
245
|
+
// So that we can check for tampering next time through
|
246
|
+
me.lastPageSize = pageSize;
|
247
|
+
// Always get whole pages.
|
248
|
+
if (!options.page) {
|
249
|
+
options.page = me.getPageFromRecordIndex(options.start);
|
250
|
+
options.start = (options.page - 1) * pageSize;
|
251
|
+
options.limit = Math.ceil(options.limit / pageSize) * pageSize;
|
252
|
+
}
|
253
|
+
// Currently not requesting this page, or the request was for the last
|
254
|
+
// generation of the data cache (clearing it changes generations)
|
255
|
+
// then request it...
|
256
|
+
existingPageRequest = me.pageRequests[options.page];
|
257
|
+
pageMapGeneraton = existingPageRequest && existingPageRequest.getOperation && existingPageRequest.getOperation().pageMapGeneration !== data.pageMapGeneration;
|
258
|
+
|
259
|
+
if (!existingPageRequest || pageMapGeneraton) {
|
260
|
+
// Copy options into a new object so as not to mutate passed in objects
|
261
|
+
options = Ext.apply({
|
262
|
+
action: 'read',
|
263
|
+
filters: me.getFilters().items,
|
264
|
+
sorters: me.getSorters().items,
|
265
|
+
grouper: me.getGrouper(),
|
266
|
+
internalCallback: me.onProxyPrefetch,
|
267
|
+
internalScope: me
|
268
|
+
}, options);
|
269
|
+
operation = me.createOperation('read', options);
|
270
|
+
// Generation # of the page map to which the requested records belong.
|
271
|
+
// If page map is cleared while this request is in flight, the pageMapGeneration will increment and the payload will be rejected
|
272
|
+
operation.pageMapGeneration = data.pageMapGeneration;
|
273
|
+
if (me.fireEvent('beforeprefetch', me, operation) !== false) {
|
274
|
+
me.pageRequests[options.page] = operation.execute();
|
275
|
+
if (me.getProxy().isSynchronous) {
|
276
|
+
delete me.pageRequests[options.page];
|
277
|
+
}
|
278
|
+
}
|
279
|
+
}
|
280
|
+
return me;
|
195
281
|
}
|
196
282
|
}
|
@@ -86,7 +86,7 @@
|
|
86
86
|
var records = dataRecords.map(function(element){ return { id: element.id, parentId: parentId } });
|
87
87
|
this.panel.server.updateParentId(records, function(response){
|
88
88
|
dataRecords.forEach(function(record){
|
89
|
-
if (record.modified
|
89
|
+
if (record.modified &&
|
90
90
|
Object.keys(record.modified).length == 1
|
91
91
|
&& record.modified["parentId"] !== undefined){
|
92
92
|
record.dirty = false;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-basepack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.5.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Gorin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A set of feature-rich extendible Netzke components (such as Grid, Tree,
|
14
14
|
Form, Window) and component extensions which can be used as building blocks for
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- Rakefile
|
26
26
|
- init.rb
|
27
27
|
- javascripts/basepack.js
|
28
|
+
- javascripts/bugfixes.js
|
28
29
|
- javascripts/grid/columns.js
|
29
30
|
- javascripts/grid/event_handlers.js
|
30
31
|
- javascripts/netzkeremotecombo.js
|
@@ -113,9 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
114
|
version: 1.3.4
|
114
115
|
requirements: []
|
115
116
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.5.
|
117
|
+
rubygems_version: 2.5.2
|
117
118
|
signing_key:
|
118
119
|
specification_version: 4
|
119
120
|
summary: Pre-built Netzke components
|
120
121
|
test_files: []
|
121
|
-
has_rdoc:
|