Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DC-10324-upgrade-loan-manager-to-rails713 #483

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function (grunt) {

concat: {
'src-js': {
src: ['src/configuration.js', 'src/logger.js', 'src/constants.js', 'src/list.builder.js', 'src/data.processor.js', 'src/template.js', 'src/core.js'],
src: ['src/dependencies.js', 'src/configuration.js', 'src/logger.js', 'src/constants.js', 'src/list.builder.js', 'src/data.processor.js', 'src/template.js', 'src/core.js'],
dest: '<%= project.js.dest %>'
}
},
Expand Down Expand Up @@ -200,6 +200,8 @@ module.exports = function (grunt) {

grunt.registerTask('build', ['qunit:unit', 'concat', 'comments', 'uglify', 'sass:dev', 'sass:dist', 'usebanner', 'copy', 'clean']);

grunt.registerTask('build:js', ['concat', 'comments', 'copy', 'clean']);

grunt.registerTask('devel', ['build', 'qunit:integration']);

grunt.registerTask('build:dev', ['build']);
Expand Down
2 changes: 1 addition & 1 deletion dist/easy-autocomplete.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/easy-autocomplete.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/easy-autocomplete.themes.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/easy-autocomplete.themes.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 26 additions & 25 deletions dist/jquery.easy-autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
/*
* easy-autocomplete
* jQuery plugin for autocompletion
*
* @author Łukasz Pawełczak (http://github.com/pawelczak)
* @version 1.4.0
* Copyright License:
*/
import jQuery from "jquery";

/*
* EasyAutocomplete - Configuration
* EasyAutocomplete - Configuration
*/
var EasyAutocomplete = (function (scope) {

Expand Down Expand Up @@ -125,9 +118,7 @@ var EasyAutocomplete = (function (scope) {

categoriesAssigned: false,

categories: [{
maxNumberOfElements: 4
}]
categories: []

};

Expand Down Expand Up @@ -394,9 +385,9 @@ var EasyAutocomplete = (function (scope) {
})(EasyAutocomplete || {});

/*
* EasyAutocomplete - ListBuilderService
* EasyAutocomplete - ListBuilderService
*
* @author Łukasz Pawełczak
* @author Łukasz Pawełczak
*
*/
var EasyAutocomplete = (function (scope) {
Expand All @@ -418,23 +409,33 @@ var EasyAutocomplete = (function (scope) {
return listBuilder;
};

this.updateCategories = function (listBuilder, data) {

if (configuration.get('categoriesAssigned')) {
this.updateCategories = function(listBuilder, data) {
if (configuration.get("categoriesAssigned")) {

listBuilder = [];
listBuilder = [];

for (var i = 0; i < configuration.get("categories").length; i += 1) {
if (configuration.get('categories').length == 0) {
$.each(data, function( index, value ) {
var builder = convertToListBuilder({
listLocation: index,
maxNumberOfElements: 10,
header: index.replace(/[_\s]+/g, ' ')
}, data);

var builder = convertToListBuilder(configuration.get('categories')[i], data);
listBuilder.push(builder);
});
} else {
for (var i = 0; i < configuration.get("categories").length; i += 1) {

listBuilder.push(builder);
}
var builder = convertToListBuilder(configuration.get('categories')[i], data);

}
listBuilder.push(builder);
}
}
}

return listBuilder;
};
return listBuilder;
};

this.convertXml = function (listBuilder) {
if (configuration.get('dataType').toUpperCase() === 'XML') {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.easy-autocomplete.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/maps/easy-autocomplete.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/maps/easy-autocomplete.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/maps/easy-autocomplete.themes.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/maps/easy-autocomplete.themes.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "easy-autocomplete",
"title": "jQuery plugin for autocompletion",
"author": "Łukasz Pawełczak (http://github.com/pawelczak)",
"version": "1.4.0",
"version": "1.4.4",
"keywords": [
"jquery",
"jquery-plugin",
Expand Down
7 changes: 2 additions & 5 deletions src/configuration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* EasyAutocomplete - Configuration
* EasyAutocomplete - Configuration
*/
var EasyAutocomplete = (function (scope) {

Expand Down Expand Up @@ -118,10 +118,7 @@ var EasyAutocomplete = (function (scope) {

categoriesAssigned: false,

categories: [{
//listLocation: "",
maxNumberOfElements: 4
}]
categories: []

};

Expand Down
1 change: 1 addition & 0 deletions src/dependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import jQuery from "jquery";
36 changes: 23 additions & 13 deletions src/list.builder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* EasyAutocomplete - ListBuilderService
* EasyAutocomplete - ListBuilderService
*
* @author Łukasz Pawełczak
* @author Łukasz Pawełczak
*
*/
var EasyAutocomplete = (function (scope) {
Expand All @@ -23,23 +23,33 @@ var EasyAutocomplete = (function (scope) {
return listBuilder;
};

this.updateCategories = function (listBuilder, data) {
this.updateCategories = function(listBuilder, data) {
if (configuration.get("categoriesAssigned")) {

if (configuration.get('categoriesAssigned')) {
listBuilder = [];

listBuilder = [];
if (configuration.get('categories').length == 0) {
$.each(data, function( index, value ) {
var builder = convertToListBuilder({
listLocation: index,
maxNumberOfElements: 10,
header: index.replace(/[_\s]+/g, ' ')
}, data);

for (var i = 0; i < configuration.get("categories").length; i += 1) {
listBuilder.push(builder);
});
} else {
for (var i = 0; i < configuration.get("categories").length; i += 1) {

var builder = convertToListBuilder(configuration.get('categories')[i], data);
var builder = convertToListBuilder(configuration.get('categories')[i], data);

listBuilder.push(builder);
}

}
listBuilder.push(builder);
}
}
}

return listBuilder;
};
return listBuilder;
};

this.convertXml = function (listBuilder) {
if (configuration.get('dataType').toUpperCase() === 'XML') {
Expand Down
4 changes: 1 addition & 3 deletions test/configuration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Tests for Configuration module - EasyAutocomplete
* Tests for Configuration module - EasyAutocomplete
*
* @author Łukasz Pawełczak
*/
Expand Down Expand Up @@ -577,8 +577,6 @@ QUnit.test('Categories parameters', function (assert) {

assert.equal(6, actualOptions.get('categories')[1].maxNumberOfElements, 'Passed - maxNumberOfElements');

assert.equal('url', actualOptions.get('categories')[2].listLocation, 'Passed - listLocation');
assert.equal(4, actualOptions.get('categories')[2].maxNumberOfElements, 'Passed - maxNumberOfElements - default');
});


Expand Down