@onehat/data 1.22.4 → 1.22.6
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.
- package/package.json +1 -1
- package/src/Property/Json.js +1 -1
- package/src/Repository/OneBuild.js +2 -1
- package/src/Repository/Tree.js +17 -12
package/package.json
CHANGED
package/src/Property/Json.js
CHANGED
|
@@ -126,7 +126,7 @@ JsonProperty.className = 'Json';
|
|
|
126
126
|
JsonProperty.type = 'json';
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
// For the sake of OneBuild, create an alias of Json, that's Tag
|
|
129
|
+
// For the sake of OneBuild backwards compatibility, create an alias of Json, that's Tag
|
|
130
130
|
export class TagProperty extends JsonProperty {}
|
|
131
131
|
TagProperty.className = 'Tag';
|
|
132
132
|
TagProperty.type = 'tag';
|
|
@@ -354,7 +354,8 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
354
354
|
|
|
355
355
|
if (!success) {
|
|
356
356
|
this.markLoading(false);
|
|
357
|
-
|
|
357
|
+
this.throwError(message);
|
|
358
|
+
return;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
// Click duplicateId. The new row appears directly above the one that was duplicated
|
package/src/Repository/Tree.js
CHANGED
|
@@ -186,26 +186,31 @@ class TreeRepository extends OneBuildRepository {
|
|
|
186
186
|
this.throwError(message);
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
+
|
|
189
190
|
|
|
190
191
|
// Set the current entities
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
const children = [];
|
|
193
|
+
_.each(root, (data) => {
|
|
194
|
+
if (data.id === treeNode.id) {
|
|
195
|
+
// This is the node we're loading, so update it directly
|
|
196
|
+
treeNode.loadOriginalData(data);
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const entity = Repository._createEntity(this.schema, data, this, true);
|
|
200
|
+
this._relayEntityEvents(entity);
|
|
201
|
+
children.push(entity);
|
|
196
202
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
this._setPaginationVars();
|
|
203
|
+
if (children.length) {
|
|
204
|
+
this.entities = this.entities.concat(children);
|
|
205
|
+
this.assembleTreeNodes();
|
|
206
|
+
this._setPaginationVars();
|
|
207
|
+
}
|
|
203
208
|
|
|
204
209
|
this.rehash();
|
|
205
210
|
// this.emit('changeData', this.entities);
|
|
206
211
|
this.emit('load', this);
|
|
207
212
|
|
|
208
|
-
return
|
|
213
|
+
return treeNode;
|
|
209
214
|
})
|
|
210
215
|
.finally(() => {
|
|
211
216
|
this.markLoading(false);
|