mirror of https://github.com/apache/nifi.git
NIFI-2840:
- Sorting the templates to ensure that the newest templates are listed first. This closes #1391.
This commit is contained in:
parent
b1c9f0e764
commit
083d4043e0
|
@ -170,6 +170,15 @@ nf.ng.TemplateComponent = function (serviceProvider) {
|
|||
}).done(function (response) {
|
||||
var templates = response.templates;
|
||||
if (nf.Common.isDefinedAndNotNull(templates) && templates.length > 0) {
|
||||
// sort the templates
|
||||
templates = templates.sort(function (one, two) {
|
||||
var oneDate = nf.Common.parseDateTime(one.template.timestamp);
|
||||
var twoDate = nf.Common.parseDateTime(two.template.timestamp);
|
||||
|
||||
// newest templates first
|
||||
return twoDate.getTime() - oneDate.getTime();
|
||||
});
|
||||
|
||||
var options = [];
|
||||
$.each(templates, function (_, templateEntity) {
|
||||
if (templateEntity.permissions.canRead === true) {
|
||||
|
|
Loading…
Reference in New Issue