@onehat/data 1.4.0 → 1.4.4
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
CHANGED
|
@@ -4,8 +4,9 @@ import EventEmitter from '@onehat/events';
|
|
|
4
4
|
import Repository from '../Repository';
|
|
5
5
|
import Command from './Command';
|
|
6
6
|
import moment from 'relative-time-parser'; // Notice this version of moment is imported from 'relative-time-parser', and may be out of sync with our general 'moment' package
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
v4 as uuid,
|
|
9
|
+
} from 'uuid';
|
|
9
10
|
import _ from 'lodash';
|
|
10
11
|
|
|
11
12
|
export const MODE_LOCAL_MIRROR = 'MODE_LOCAL_MIRROR';
|
|
@@ -4,6 +4,21 @@ import AjaxRepository from './Ajax';
|
|
|
4
4
|
import qs from 'qs';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
|
|
7
|
+
const nonConditionFilters = [
|
|
8
|
+
'q',
|
|
9
|
+
'hydrate',
|
|
10
|
+
'fields',
|
|
11
|
+
'distinct',
|
|
12
|
+
'leftJoinWith',
|
|
13
|
+
'join',
|
|
14
|
+
'where',
|
|
15
|
+
'matching',
|
|
16
|
+
'contain',
|
|
17
|
+
'order',
|
|
18
|
+
'limit',
|
|
19
|
+
'page',
|
|
20
|
+
];
|
|
21
|
+
|
|
7
22
|
/**
|
|
8
23
|
* This class contains overrides of specific functions in
|
|
9
24
|
* AjaxRepository that are unique to OneBuild.
|
|
@@ -129,12 +144,16 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
129
144
|
// Clear existing "conditions" params
|
|
130
145
|
if (!_.isEmpty(this._params)) {
|
|
131
146
|
this._params = _.omitBy(this._params, (value, key) => {
|
|
132
|
-
return key.match(/^conditions/);
|
|
147
|
+
return key.match(/^conditions/) || _.includes(nonConditionFilters, key);
|
|
133
148
|
});
|
|
134
149
|
}
|
|
135
150
|
|
|
136
151
|
_.each(this.filters, (filter, ix) => {
|
|
137
|
-
|
|
152
|
+
if (_.includes(nonConditionFilters, filter.name)) {
|
|
153
|
+
this.setParam(filter.name, filter.value);
|
|
154
|
+
} else {
|
|
155
|
+
this.setParam('conditions[' + filter.name + ']', filter.value);
|
|
156
|
+
}
|
|
138
157
|
});
|
|
139
158
|
|
|
140
159
|
if (this.isLoaded) {
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import EventEmitter from '@onehat/events';
|
|
4
4
|
import Entity from '../Entity';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
v4 as uuid,
|
|
7
|
+
} from 'uuid';
|
|
7
8
|
import _ from 'lodash';
|
|
8
9
|
|
|
9
10
|
/**
|