Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function refreshData(query) {
var apiQuery;
state.query = query || $stateParams;
apiQuery = angular.copy(state.query);
apiQuery.facet = exhaustiveFacets;
if (state.data.$cancelRequest) state.data.$cancelRequest();
state.data = DatasetSearch.query(apiQuery, function() {
state.failedRequest = false;
// state.data.facets = facetArrayToMap(state.data.facets, state.data.count);
}, function() {
state.failedRequest = true;
});
// get multiselect facets only for keys that is filtered since we have already asked without multiselect and hence would get the same result twice
apiQuery.facetMultiselect = true;
apiQuery.limit = 0; // no need to get the same results again
apiQuery.facet = [];
multiSelectFacetsKeys.forEach(function(key) {
if (angular.isDefined(apiQuery[key]) && [].concat(apiQuery[key]).length > 0) {
.then((responses) => {
this.enums = responses.enums;
// Reordered available responses
// ["cgi", "none", "text"] => ["none", "cgi", "text"]
this.enums.smsResponseType.splice(
0,
0,
this.enums.smsResponseType.splice(1, 1)[0],
);
this.service = angular.copy(responses.service);
this.smsResponse = angular.copy(result(this.service, 'smsResponse'));
this.senders = responses.senders;
this.computeRemainingChar();
})
.catch((err) => {
onLatLngChange() {
var coordinates = angular.copy(this.feature.geometry.coordinates);
// copy edit field lat/lng in coordinates at correct index
if (this.feature.geometry.type === 'Point') {
coordinates = angular.copy([Number(this.longitudeField.value), Number(this.latitudeField.value)]);
} else if (this.feature.geometry.type === 'LineString') {
coordinates[this.selectedVertexIndex] = angular.copy([Number(this.longitudeField.value), Number(this.latitudeField.value)]);
} else if (this.feature.geometry.type === 'Polygon') {
if (coordinates[0]) {
coordinates[0][this.selectedVertexIndex] = angular.copy([Number(this.longitudeField.value), Number(this.latitudeField.value)]);
}
}
// transform corrdinates to valid GeoJSON
this.toGeoJSON(this.feature, coordinates);
// Check for polygon for intersections
if (this.hasIntersections(this.feature, coordinates)) {
return;
}
.onStart(function(wizard){
wizard.conf = {};
angular.copy(wizard.parentScope.widget, wizard.conf);
console.log("Start conf", wizard.conf)
})
.onStart(function(wizard){
wizard.conf = {};
angular.copy(wizard.parentScope.widget, wizard.conf);
console.log("Start conf", wizard.conf)
})
if (!target.disableDownsampling) {
let interval = this.templateSrv.replace(target.downsampleInterval || options.interval);
if (interval.match(/\.[0-9]+s/)) {
interval = parseFloat(interval) * 1000 + 'ms';
}
query.downsample = interval + '-' + target.downsampleAggregator;
if (target.downsampleFillPolicy && target.downsampleFillPolicy !== 'none') {
query.downsample += '-' + target.downsampleFillPolicy;
}
}
if (target.filters && target.filters.length > 0) {
query.filters = angular.copy(target.filters);
if (query.filters) {
for (const filterKey in query.filters) {
query.filters[filterKey].filter = this.templateSrv.replace(
query.filters[filterKey].filter,
options.scopedVars,
'pipe'
);
}
}
} else {
query.tags = angular.copy(target.tags);
if (query.tags) {
for (const tagKey in query.tags) {
query.tags[tagKey] = this.templateSrv.replace(query.tags[tagKey], options.scopedVars, 'pipe');
}
}
}
}
if (target.filters && target.filters.length > 0) {
query.filters = angular.copy(target.filters);
if (query.filters) {
for (const filterKey in query.filters) {
query.filters[filterKey].filter = this.templateSrv.replace(
query.filters[filterKey].filter,
options.scopedVars,
'pipe'
);
}
}
} else {
query.tags = angular.copy(target.tags);
if (query.tags) {
for (const tagKey in query.tags) {
query.tags[tagKey] = this.templateSrv.replace(query.tags[tagKey], options.scopedVars, 'pipe');
}
}
}
if (target.explicitTags) {
query.explicitTags = true;
}
return query;
}
}
}
if (target.filters && target.filters.length > 0) {
query.filters = angular.copy(target.filters);
if (query.filters) {
for (const filterKey in query.filters) {
query.filters[filterKey].filter = this.templateSrv.replace(
query.filters[filterKey].filter,
options.scopedVars,
'pipe'
);
}
}
} else {
query.tags = angular.copy(target.tags);
if (query.tags) {
for (const tagKey in query.tags) {
query.tags[tagKey] = this.templateSrv.replace(query.tags[tagKey], options.scopedVars, 'pipe');
}
}
}
if (target.explicitTags) {
query.explicitTags = true;
}
return query;
}
scope.copyWithIndex = function(index) {
if (!formDefCache[index]) {
if (subForm) {
var copy = angular.copy(subForm);
copy.arrayIndex = index;
schemaForm.traverseForm(copy, setIndex(index));
formDefCache[index] = copy;
}
}
return formDefCache[index];
};
pendingImportIps: () => angular.copy(pendingImportIps),
},