Make use of the filter option for autocompletion

pull/4952/head
manuschiller 8 years ago committed by Oliver Günther
parent b50d191e9b
commit 644d27fd0c
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 7
      frontend/app/components/wp-relations/wp-relation-row/wp-relation-row.directive.ts
  2. 1
      frontend/app/components/wp-relations/wp-relations-create/add-child.template.html
  3. 1
      frontend/app/components/wp-relations/wp-relations-create/empty-parents.template.html
  4. 2
      frontend/app/components/wp-relations/wp-relations-create/wp-relations-autocomplete/wp-relations-autocomplete.directive.ts
  5. 2
      spec/features/work_packages/details/details_relations_spec.rb

@ -38,17 +38,14 @@ class WpRelationRowDirectiveController {
this.text = {
removeButton:this.I18n.t('js.relation_buttons.remove')
};
this.availableRelationTypes = wpRelationsService.getRelationTypes(true);
this.selectedRelationType = _.find(this.availableRelationTypes, {'name': this.relation.type});
};
public get relationReady() {
return this.relatedWorkPackage && this.relatedWorkPackage.$loaded;
}
public saveDescription(newDescription:string) {
this.availableRelationTypes = wpRelationsService.getRelationTypes(true);
this.selectedRelationType = _.find(this.availableRelationTypes, {'name': this.relation.type});
};
public saveDescription() {
this.relation.updateImmediately({
description: this.relation.description

@ -30,6 +30,7 @@
work-package="$ctrl.workPackage"
selected-wp-id="$ctrl.selectedWpId"
selected-relation-type="$ctrl.selectedRelationType"
filter-candidates-for="children"
focus>
</wp-relations-autocomplete>

@ -20,6 +20,7 @@
work-package="$ctrl.workPackage"
selected-wp-id="$ctrl.selectedWpId"
selected-relation-type="$ctrl.selectedRelationType"
filter-candidates-for="parent"
focus>
</wp-relations-autocomplete>
</div>

@ -39,6 +39,7 @@ function wpRelationsAutocompleteDirective($q, PathHelper, $http, I18n) {
scope: {
selectedWpId: '=',
selectedRelationType: '=',
filterCandidatesFor: '@',
workPackage: '='
},
link: function (scope, element, attrs, controllers) {
@ -66,6 +67,7 @@ function wpRelationsAutocompleteDirective($q, PathHelper, $http, I18n) {
return scope.workPackage
.available_relation_candidates.$link.$fetch({
query: query,
type: scope.filterCandidatesFor
}, {
'caching': {
enabled: false

@ -13,8 +13,8 @@ describe 'Work package relations tab', js: true, selenium: true do
login_as user
work_packages_page.visit_tab!('relations')
loading_indicator_saveguard
work_packages_page.expect_subject
loading_indicator_saveguard
end
def add_hierarchy(container, query, expected_text)

Loading…
Cancel
Save