mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
switch to angular expression evaluation syntax, update usage and tests accordingly
This commit is contained in:
parent
53d376d6c4
commit
17fa030f97
10 changed files with 13 additions and 13 deletions
|
@ -113,7 +113,7 @@ define(function (require) {
|
|||
.then(function () {
|
||||
notify.info('Saved Dashboard as "' + dash.title + '"');
|
||||
if (dash.id !== $routeParams.id) {
|
||||
kbnUrl.change('/dashboard/{id}', {id: dash.id});
|
||||
kbnUrl.change('/dashboard/{{id}}', {id: dash.id});
|
||||
}
|
||||
})
|
||||
.catch(notify.fatal);
|
||||
|
|
|
@ -23,7 +23,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
this.urlFor = function (id) {
|
||||
return kbnUrl.eval('#/dashboard/{id}', {id: id});
|
||||
return kbnUrl.eval('#/dashboard/{{id}}', {id: id});
|
||||
};
|
||||
|
||||
this.delete = function (ids) {
|
||||
|
|
|
@ -228,7 +228,7 @@ define(function (require) {
|
|||
.then(function () {
|
||||
notify.info('Saved Data Source "' + savedSearch.title + '"');
|
||||
if (savedSearch.id !== $route.current.params.id) {
|
||||
kbnUrl.change('/discover/{id}', { id: savedSearch.id });
|
||||
kbnUrl.change('/discover/{{id}}', { id: savedSearch.id });
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
|
@ -27,7 +27,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
this.urlFor = function (id) {
|
||||
return kbnUrl.eval('#/discover/{id}', {id: id});
|
||||
return kbnUrl.eval('#/discover/{{id}}', {id: id});
|
||||
};
|
||||
|
||||
this.delete = function (ids) {
|
||||
|
|
|
@ -31,7 +31,7 @@ define(function (require) {
|
|||
.map(function (id) {
|
||||
return {
|
||||
id: id,
|
||||
url: kbnUrl.eval('#/settings/indices/{id}', {id: id}),
|
||||
url: kbnUrl.eval('#/settings/indices/{{id}}', {id: id}),
|
||||
class: 'sidebar-item-title ' + ($scope.edittingId === id ? 'active' : ''),
|
||||
default: $scope.defaultIndex === id
|
||||
};
|
||||
|
|
|
@ -157,7 +157,7 @@ define(function (require) {
|
|||
|
||||
if (savedVis.id === $route.current.params.id) return;
|
||||
|
||||
kbnUrl.change('/visualize/edit/{id}', {id: savedVis.id});
|
||||
kbnUrl.change('/visualize/edit/{{id}}', {id: savedVis.id});
|
||||
}, notify.fatal);
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
this.urlFor = function (id) {
|
||||
return kbnUrl.eval('#/visualize/edit/{id}', {id: id});
|
||||
return kbnUrl.eval('#/visualize/edit/{{id}}', {id: id});
|
||||
};
|
||||
|
||||
this.delete = function (ids) {
|
||||
|
|
|
@ -26,7 +26,7 @@ define(function (require) {
|
|||
|
||||
module.controller('VisualizeWizardStep1', function ($route, $scope, $location, timefilter, kbnUrl) {
|
||||
$scope.step2WithSearchUrl = function (hit) {
|
||||
return kbnUrl.eval('#/visualize/step/2?savedSearchId={id}', {id: hit.id});
|
||||
return kbnUrl.eval('#/visualize/step/2?savedSearchId={{id}}', {id: hit.id});
|
||||
};
|
||||
|
||||
timefilter.enabled = false;
|
||||
|
@ -38,7 +38,7 @@ define(function (require) {
|
|||
|
||||
$scope.$watch('indexPattern.selection', function (pattern) {
|
||||
if (!pattern) return;
|
||||
kbnUrl.change('/visualize/step/2?indexPattern={pattern}', {pattern: pattern});
|
||||
kbnUrl.change('/visualize/step/2?indexPattern={{pattern}}', {pattern: pattern});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ define(function (require) {
|
|||
$rootScope.$on('$routeChangeStart', reloadingComplete);
|
||||
|
||||
function parseUrlPrams(url, paramObj) {
|
||||
return url.replace(/\{([^\}]+)\}/g, function (match, expr) {
|
||||
return url.replace(/\{\{([^\}]+)\}\}/g, function (match, expr) {
|
||||
var key = expr.split('|')[0].trim();
|
||||
|
||||
if (_.isUndefined(paramObj[key])) {
|
||||
|
|
|
@ -137,7 +137,7 @@ define(function (require) {
|
|||
var params = { replace: faker.Lorem.words(3).join(' ') };
|
||||
var check = encodeURIComponent(params.replace);
|
||||
|
||||
kbnUrl.change(url + '{replace}', params);
|
||||
kbnUrl.change(url + '{{replace}}', params);
|
||||
|
||||
expect(locationUrlSpy.secondCall.args[0]).to.be(url + check);
|
||||
});
|
||||
|
@ -146,7 +146,7 @@ define(function (require) {
|
|||
// build url by piecing together these parts
|
||||
var urlParts = ['/', '/', '?', '&', '#'];
|
||||
// make sure it can parse templates with weird spacing
|
||||
var wrappers = [ ['{', '}'], ['{ ', ' }'], ['{', ' }'], ['{ ', '}'], ['{ ', ' }']];
|
||||
var wrappers = [ ['{{', '}}'], ['{{ ', ' }}'], ['{{', ' }}'], ['{{ ', '}}'], ['{{ ', ' }}']];
|
||||
// make sure filters are evaluated via angular expressions
|
||||
var objIndex = 4; // used to case one replace as an object
|
||||
var filters = ['', 'uppercase', '', 'uppercase', 'rison'];
|
||||
|
@ -192,7 +192,7 @@ define(function (require) {
|
|||
});
|
||||
|
||||
it('should throw when params are missing', function () {
|
||||
var url = '/{replace-me}/{but-not-me}';
|
||||
var url = '/{{replace-me}}/{{but-not-me}}';
|
||||
var params = {
|
||||
'replace-me': 'done'
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue