Commit 514a5b25 authored by Simon Knox's avatar Simon Knox

add label to Projects dropdown, fix update url

parent 4a3e1fb7
......@@ -81,18 +81,19 @@ export default {
},
mounted() {
this.$refs.input.focus();
$(this.$refs.projectsDropdown).glDropdown({
filterable: true,
filterRemote: true,
search: {
fields: ['name_with_namespace'],
},
data(term, callback) {
console.log(term);
return Api.groupProjects(this.groupId, term, callback);
},
text: project => project.name,
});
if (this.groupId) {
$(this.$refs.projectsDropdown).glDropdown({
filterable: true,
filterRemote: true,
search: {
fields: ['name_with_namespace'],
},
data(term, callback) {
return Api.groupProjects(this.groupId, term, callback);
},
text: project => project.name,
});
}
},
template: `
<div class="card board-new-issue-form">
......@@ -113,31 +114,36 @@ export default {
ref="input"
autocomplete="off"
:id="list.id + '-title'" />
<div class="dropdown prepend-top-10">
<button
@click="loadProjects"
class="dropdown-menu-toggle"
type="button"
data-toggle="dropdown"
aria-expanded="false">
{{ selectedProject.name || 'Select a project' }}
<i class="fa fa-chevron-down"></i>
</button>
<div class="dropdown-menu dropdown-menu-selectable">
<ul>
<li v-for="project in projects">
<a
href="#"
role="button"
:class="{ 'is-active': project.id == selectedProject.id }"
@click.prevent="selectedProject = project">
{{ project.name }}
</a>
</li>
</ul>
<template v-if="groupId">
<label class="label-light prepend-top-10"
:for="list.id + '-project'">
Project
</label>
<div class="dropdown">
<button
@click="loadProjects"
class="dropdown-menu-toggle wide"
type="button"
data-toggle="dropdown"
aria-expanded="false">
{{ selectedProject.name || 'Select a project' }}
<i class="fa fa-chevron-down"></i>
</button>
<div class="dropdown-menu dropdown-menu-selectable wide">
<ul>
<li v-for="project in projects">
<a
href="#"
role="button"
:class="{ 'is-active': project.id == selectedProject.id }"
@click.prevent="selectedProject = project">
{{ project.name }}
</a>
</li>
</ul>
</div>
</div>
</div>
</template>
<div class="clearfix prepend-top-10">
<button class="btn btn-success pull-left"
type="submit"
......
......@@ -59,7 +59,6 @@ gl.issueBoards.BoardSidebar = Vue.extend({
this.list = this.detail.list;
this.$nextTick(() => {
new UsersSelect();
this.endpoint = this.$refs.assigneeDropdown.dataset.issueUpdate;
});
},
......
......@@ -90,7 +90,7 @@ class ListIssue {
data.issue.label_ids = [''];
}
return Vue.http.patch(this.updateUrl, data);
return Vue.http.patch(url, data);
}
}
......
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