ende 0.5.9 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/components/component/matches-selector/{0.1.4 → 0.1.5}/component.json +1 -1
- data/components/component/matches-selector/{0.1.4 → 0.1.5}/index.js +1 -0
- data/components/indefinido/indemma/master/component.json +1 -1
- data/components/indefinido/indemma/master/lib/record/associable.js +47 -11
- data/components/indefinido/indemma/master/lib/record/scopable.js +4 -1
- data/components/indefinido/indemma/master/lib/record/validatable.js +19 -1
- data/lib/assets/javascripts/aura/extensions/devise.js.coffee +7 -0
- data/lib/assets/javascripts/aura/extensions/resources.js.coffee.erb +0 -1
- data/lib/ende/version.rb +1 -1
- data/vendor/assets/components/ende_build.js +2891 -2837
- metadata +4 -8
- data/build/build.css +0 -112
- data/build/build.js +0 -36465
- data/lib/assets/javascripts/aura/extensions/widget/#composable.js.coffee# +0 -135
- data/vendor/assets/javascripts/ende/build.js +0 -29724
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ef17acb592f82967df3a8ac261e041cfc75e89d
|
4
|
+
data.tar.gz: 763d3c38a214e34619757c030b7231201ff84ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fd008aa547188f0475a326e43b893f036cd362a24d2ed14a8669a6a7ee2dbae82c7dc0d4e3eedd146377c9dbdfbfef0c799019096e7791839721e1eb853785
|
7
|
+
data.tar.gz: bb733db893fe3c8a198380616b45d088e8af96513ceba71836ba899f8129b6bf410dad1d1f80091220226a518e7a52c6f2b0b460147fb0d7e658c8e9b5623a34
|
@@ -95,18 +95,31 @@ descriptors = {
|
|
95
95
|
return this.owner.observed[this.resource + '_id'];
|
96
96
|
},
|
97
97
|
setter: function(resource_id) {
|
98
|
-
var association_name, current_resource_id, _ref;
|
98
|
+
var association_name, change, current_resource_id, _ref, _ref1;
|
99
99
|
|
100
100
|
association_name = this.resource.toString();
|
101
|
-
if (
|
101
|
+
if (resource_id == null) {
|
102
102
|
this.dirty = true;
|
103
|
-
this.owner[association_name] =
|
103
|
+
this.owner[association_name] = null;
|
104
104
|
return resource_id;
|
105
105
|
}
|
106
106
|
current_resource_id = (_ref = this.owner.observed[association_name]) != null ? _ref._id : void 0;
|
107
107
|
if (resource_id !== current_resource_id) {
|
108
108
|
this.owner.observed[association_name + '_id'] = resource_id;
|
109
109
|
this.owner.observed[association_name] = null;
|
110
|
+
if (!Object.observe) {
|
111
|
+
if ((_ref1 = this.owner.observation.observers[association_name + '_id']) != null) {
|
112
|
+
_ref1.check_();
|
113
|
+
}
|
114
|
+
} else {
|
115
|
+
change = {
|
116
|
+
oldValue: current_resource_id,
|
117
|
+
type: 'update',
|
118
|
+
name: association_name + '_id',
|
119
|
+
object: this.owner
|
120
|
+
};
|
121
|
+
Object.getNotifier(this.owner).notify(change);
|
122
|
+
}
|
110
123
|
}
|
111
124
|
return resource_id;
|
112
125
|
}
|
@@ -119,7 +132,7 @@ descriptors = {
|
|
119
132
|
associated = this.owner.observed[association_name];
|
120
133
|
associated_id = this.owner.observed[association_name + '_id'];
|
121
134
|
if (!(((associated != null ? associated._id : void 0) != null) || associated_id)) {
|
122
|
-
return associated;
|
135
|
+
return associated || null;
|
123
136
|
}
|
124
137
|
if (associated != null ? associated.sustained : void 0) {
|
125
138
|
return associated;
|
@@ -140,8 +153,29 @@ descriptors = {
|
|
140
153
|
return this.owner.observed[association_name] = associated;
|
141
154
|
},
|
142
155
|
setter: function(associated) {
|
143
|
-
|
144
|
-
|
156
|
+
var association_name, change, current_value, _ref;
|
157
|
+
|
158
|
+
association_name = this.resource.toString();
|
159
|
+
current_value = this.owner.observed[association_name];
|
160
|
+
if (current_value === associated) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
this.owner.observed[association_name] = associated;
|
164
|
+
this.owner.observed[association_name + '_id'] = associated ? associated._id : null;
|
165
|
+
if (!Object.observe) {
|
166
|
+
if ((_ref = this.owner.observation.observers[association_name]) != null) {
|
167
|
+
_ref.check_();
|
168
|
+
}
|
169
|
+
} else {
|
170
|
+
change = {
|
171
|
+
oldValue: current_value,
|
172
|
+
type: 'update',
|
173
|
+
name: association_name,
|
174
|
+
object: this.owner
|
175
|
+
};
|
176
|
+
Object.getNotifier(this.owner).notify(change);
|
177
|
+
}
|
178
|
+
return associated;
|
145
179
|
}
|
146
180
|
}
|
147
181
|
}
|
@@ -167,10 +201,9 @@ callbacks = {
|
|
167
201
|
}
|
168
202
|
association.resource = model.singularize(association.resource);
|
169
203
|
association.add.apply(association, associations_attributes);
|
170
|
-
|
171
|
-
} else {
|
172
|
-
_results.push(void 0);
|
204
|
+
association.resource = model.pluralize(association.resource);
|
173
205
|
}
|
206
|
+
_results.push(delete this["" + association_name + "_attributes"]);
|
174
207
|
}
|
175
208
|
return _results;
|
176
209
|
}
|
@@ -284,6 +317,7 @@ associable = {
|
|
284
317
|
association_proxy[this.resource.toString()] = this;
|
285
318
|
this["build_" + resource] = $.proxy(singular.build, association_proxy);
|
286
319
|
this["create_" + resource] = $.proxy(singular.create, association_proxy);
|
320
|
+
this["" + association_name + "_attributes"] = $.extend(this[association_name], this["" + association_name + "_attributes"]);
|
287
321
|
}
|
288
322
|
callbacks.has_one.nest_attributes.call(this);
|
289
323
|
}
|
@@ -329,13 +363,15 @@ associable = {
|
|
329
363
|
parent_resource: this.resource,
|
330
364
|
owner: record
|
331
365
|
};
|
332
|
-
old_resource =
|
366
|
+
old_resource = record[resource];
|
333
367
|
Object.defineProperty(record, resource.toString(), {
|
334
368
|
get: $.proxy(descriptors.belongs_to.resource.getter, association_proxy),
|
335
369
|
set: $.proxy(descriptors.belongs_to.resource.setter, association_proxy),
|
336
370
|
configurable: true
|
337
371
|
});
|
338
|
-
_results.push(
|
372
|
+
_results.push(record.after_initialize.push((function() {
|
373
|
+
return this[resource] = old_resource;
|
374
|
+
})));
|
339
375
|
}
|
340
376
|
return _results;
|
341
377
|
}
|
@@ -22,10 +22,13 @@ util = {
|
|
22
22
|
map: function(records) {
|
23
23
|
var index, record, _i, _len, _results;
|
24
24
|
|
25
|
+
if (this.build) {
|
26
|
+
return record;
|
27
|
+
}
|
25
28
|
_results = [];
|
26
29
|
for (index = _i = 0, _len = records.length; _i < _len; index = ++_i) {
|
27
30
|
record = records[index];
|
28
|
-
_results.push(
|
31
|
+
_results.push(this.call(this, record));
|
29
32
|
}
|
30
33
|
return _results;
|
31
34
|
}
|
@@ -87,6 +87,8 @@ initializers = {
|
|
87
87
|
return this.ignores.indexOf(name) === -1;
|
88
88
|
},
|
89
89
|
define_triggers: function() {
|
90
|
+
var original_validate;
|
91
|
+
|
90
92
|
this.errors = errorsable({
|
91
93
|
model: model[this.resource]
|
92
94
|
});
|
@@ -103,8 +105,18 @@ initializers = {
|
|
103
105
|
modified = !!Object.keys($.extend(added, removed, changed)).filter(initializers.reserved_filter, initializers).length;
|
104
106
|
return modified && (this.validated = false);
|
105
107
|
});
|
106
|
-
|
108
|
+
Object.defineProperty(this, 'valid', {
|
107
109
|
get: function() {
|
110
|
+
var _ref;
|
111
|
+
|
112
|
+
if (((_ref = this.validation) != null ? _ref.state() : void 0) === 'pending') {
|
113
|
+
this.validation.done(function() {
|
114
|
+
if (this.dirty || !this.validated) {
|
115
|
+
return this.valid;
|
116
|
+
}
|
117
|
+
});
|
118
|
+
return null;
|
119
|
+
}
|
108
120
|
this.validate();
|
109
121
|
if (this.validation.state() === 'resolved') {
|
110
122
|
return !this.errors.length;
|
@@ -117,6 +129,12 @@ initializers = {
|
|
117
129
|
},
|
118
130
|
enumerable: false
|
119
131
|
});
|
132
|
+
original_validate = this.validate;
|
133
|
+
this.validate = function() {};
|
134
|
+
this.validation = $.Deferred();
|
135
|
+
this.observation.deliver(true);
|
136
|
+
this.validation = null;
|
137
|
+
return this.validate = original_validate;
|
120
138
|
},
|
121
139
|
create_validators: function(definitions) {
|
122
140
|
var definition, name, validator, validator_options, _ref, _results;
|
@@ -66,6 +66,13 @@ define 'aura/extensions/devise', ->
|
|
66
66
|
sandbox.signed_in = false
|
67
67
|
mediator.emit 'session.restoration_failed'
|
68
68
|
|
69
|
+
# TODO change when restoring the session through GET #show
|
70
|
+
# Ignore session restoration errors, for now
|
71
|
+
@errors.clear()
|
72
|
+
|
73
|
+
# TODO implement #show on devise/sessions_controller, and
|
74
|
+
# try to restore session not by creating a new one, but
|
75
|
+
# trying to retrieve the current one
|
69
76
|
attempt.rejectWith @, arguments
|
70
77
|
|
71
78
|
restoration.always ->
|
data/lib/ende/version.rb
CHANGED