Commit 8bdfee8b authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Prep for moving droplab to npm

parent c2cb2fb4
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"plugins": [ "plugins": [
["istanbul", { ["istanbul", {
"exclude": [ "exclude": [
"app/assets/javascripts/droplab/**/*",
"spec/javascripts/**/*" "spec/javascripts/**/*"
] ]
}], }],
......
...@@ -5,6 +5,5 @@ ...@@ -5,6 +5,5 @@
/public/ /public/
/tmp/ /tmp/
/vendor/ /vendor/
/app/assets/javascripts/droplab
karma.config.js karma.config.js
webpack.config.js webpack.config.js
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import droplabFilter from '../droplab/plugins/filter'; import Filter from '@gitlab-org/droplab/dist/plugins/Filter';
require('./filtered_search_dropdown'); require('./filtered_search_dropdown');
...@@ -7,7 +7,7 @@ require('./filtered_search_dropdown'); ...@@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
constructor(droplab, dropdown, input, filter) { constructor(droplab, dropdown, input, filter) {
super(droplab, dropdown, input, filter); super(droplab, dropdown, input, filter);
this.config = { this.config = {
droplabFilter: { Filter: {
template: 'hint', template: 'hint',
filterFunction: gl.DropdownUtils.filterHint.bind(null, input), filterFunction: gl.DropdownUtils.filterHint.bind(null, input),
}, },
...@@ -68,12 +68,12 @@ require('./filtered_search_dropdown'); ...@@ -68,12 +68,12 @@ require('./filtered_search_dropdown');
} }
}); });
this.droplab.changeHookList(this.hookId, this.dropdown, [droplabFilter], this.config); this.droplab.changeHookList(this.hookId, this.dropdown, [Filter], this.config);
this.droplab.setData(this.hookId, dropdownData); this.droplab.setData(this.hookId, dropdownData);
} }
init() { init() {
this.droplab.addHook(this.input, this.dropdown, [droplabFilter], this.config).init(); this.droplab.addHook(this.input, this.dropdown, [Filter], this.config).init();
} }
} }
......
import droplabAjax from '../droplab/plugins/ajax'; import Ajax from '@gitlab-org/droplab/dist/plugins/Ajax';
import droplabFilter from '../droplab/plugins/filter'; import Filter from '@gitlab-org/droplab/dist/plugins/Filter';
require('./filtered_search_dropdown'); require('./filtered_search_dropdown');
...@@ -9,12 +9,12 @@ require('./filtered_search_dropdown'); ...@@ -9,12 +9,12 @@ require('./filtered_search_dropdown');
super(droplab, dropdown, input, filter); super(droplab, dropdown, input, filter);
this.symbol = symbol; this.symbol = symbol;
this.config = { this.config = {
droplabAjax: { Ajax: {
endpoint, endpoint,
method: 'setData', method: 'setData',
loadingTemplate: this.loadingTemplate, loadingTemplate: this.loadingTemplate,
}, },
droplabFilter: { Filter: {
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input), filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
template: 'title', template: 'title',
}, },
...@@ -30,13 +30,13 @@ require('./filtered_search_dropdown'); ...@@ -30,13 +30,13 @@ require('./filtered_search_dropdown');
renderContent(forceShowList = false) { renderContent(forceShowList = false) {
this.droplab this.droplab
.changeHookList(this.hookId, this.dropdown, [droplabAjax, droplabFilter], this.config); .changeHookList(this.hookId, this.dropdown, [Ajax, Filter], this.config);
super.renderContent(forceShowList); super.renderContent(forceShowList);
} }
init() { init() {
this.droplab this.droplab
.addHook(this.input, this.dropdown, [droplabAjax, droplabFilter], this.config).init(); .addHook(this.input, this.dropdown, [Ajax, Filter], this.config).init();
} }
} }
......
import droplabAjaxFilter from '../droplab/plugins/ajax_filter'; import AjaxFilter from '@gitlab-org/droplab/dist/plugins/AjaxFilter';
require('./filtered_search_dropdown'); require('./filtered_search_dropdown');
...@@ -7,7 +7,7 @@ require('./filtered_search_dropdown'); ...@@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
constructor(droplab, dropdown, input, filter) { constructor(droplab, dropdown, input, filter) {
super(droplab, dropdown, input, filter); super(droplab, dropdown, input, filter);
this.config = { this.config = {
droplabAjaxFilter: { AjaxFilter: {
endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`, endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`,
searchKey: 'search', searchKey: 'search',
params: { params: {
...@@ -28,7 +28,7 @@ require('./filtered_search_dropdown'); ...@@ -28,7 +28,7 @@ require('./filtered_search_dropdown');
} }
renderContent(forceShowList = false) { renderContent(forceShowList = false) {
this.droplab.changeHookList(this.hookId, this.dropdown, [droplabAjaxFilter], this.config); this.droplab.changeHookList(this.hookId, this.dropdown, [AjaxFilter], this.config);
super.renderContent(forceShowList); super.renderContent(forceShowList);
} }
...@@ -56,7 +56,7 @@ require('./filtered_search_dropdown'); ...@@ -56,7 +56,7 @@ require('./filtered_search_dropdown');
} }
init() { init() {
this.droplab.addHook(this.input, this.dropdown, [droplabAjaxFilter], this.config).init(); this.droplab.addHook(this.input, this.dropdown, [AjaxFilter], this.config).init();
} }
} }
......
import DropLab from '../droplab/droplab'; import DropLab from '@gitlab-org/droplab';
import FilteredSearchContainer from './container'; import FilteredSearchContainer from './container';
(() => { (() => {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment