Merge branch 'mg-backport-create-item-dropdown-changes' into 'master'

Update CreateItemDropdown class to allow the glDropdown filterRemote option

See merge request gitlab-org/gitlab-ce!21041
This commit is contained in:
Fatih Acet 2018-08-06 22:21:40 +00:00
commit dd627072b3
2 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ export default class CreateItemDropdown {
this.fieldName = options.fieldName;
this.onSelect = options.onSelect || (() => {});
this.getDataOption = options.getData;
this.getDataRemote = !!options.filterRemote;
this.createNewItemFromValueOption = options.createNewItemFromValue;
this.$dropdown = options.$dropdown;
this.$dropdownContainer = this.$dropdown.parent();
@ -29,7 +30,7 @@ export default class CreateItemDropdown {
this.$dropdown.glDropdown({
data: this.getData.bind(this),
filterable: true,
remote: false,
filterRemote: this.getDataRemote,
search: {
fields: ['text'],
},

View File

@ -116,7 +116,8 @@ export default {
this.model &&
this.hasLastDeploymentKey &&
this.model.last_deployment &&
this.model.last_deployment.deployable
this.model.last_deployment.deployable &&
this.model.last_deployment.deployable.retry_path
);
},