Commit a88097b1 authored by Kushal Pandya's avatar Kushal Pandya Committed by Jarka Kadlecová

[ci skip] Update todos dropdown

parent f7de209a
......@@ -39,6 +39,7 @@ export default class Todos {
}
initFilters() {
this.initFilterDropdown($('.js-group-search'), 'group_id', ['text']);
this.initFilterDropdown($('.js-project-search'), 'project_id', ['text']);
this.initFilterDropdown($('.js-type-search'), 'type');
this.initFilterDropdown($('.js-action-search'), 'action_id');
......@@ -47,14 +48,16 @@ export default class Todos {
}
initFilterDropdown($dropdown, fieldName, searchFields) {
$dropdown.glDropdown({
fieldName,
selectable: true,
filterable: searchFields ? true : false,
search: { fields: searchFields },
data: $dropdown.data('data'),
clicked: () => $dropdown.closest('form.filter-form').submit(),
});
if ($dropdown.length) {
$dropdown.glDropdown({
fieldName,
selectable: true,
filterable: searchFields ? true : false,
search: { fields: searchFields },
data: $dropdown.data('data'),
clicked: () => $dropdown.closest('form.filter-form').submit(),
});
}
}
updateRowStateClicked(e) {
......
......@@ -25,7 +25,7 @@ export default {
type: String,
required: true,
},
isAddTodo: {
isTodo: {
type: Boolean,
required: false,
default: true,
......@@ -38,7 +38,7 @@ export default {
},
data() {
return {
isButtonTypeAddTodo: this.isAddTodo,
isButtonTypeTodo: this.isTodo,
isActionActive: false,
};
},
......@@ -49,13 +49,13 @@ export default {
'btn btn-default btn-todo issuable-header-btn float-right';
},
buttonLabel() {
return this.isButtonTypeAddTodo ? MARK_TEXT : TODO_TEXT;
return this.isButtonTypeTodo ? MARK_TEXT : TODO_TEXT;
},
collapsedButtonIconClasses() {
return this.isButtonTypeAddTodo ? 'todo-undone' : '';
return this.isButtonTypeTodo ? 'todo-undone' : '';
},
collapsedButtonIcon() {
return this.isButtonTypeAddTodo ? 'check-circle' : 'plus-square';
return this.isButtonTypeTodo ? 'check-circle' : 'plus-square';
},
},
};
......
......@@ -102,6 +102,10 @@
type: Boolean,
required: true,
},
todoExists: {
type: Boolean,
required: true,
},
namespace: {
type: String,
required: false,
......@@ -182,6 +186,7 @@
:initial-labels="labels"
:initial-participants="participants"
:initial-subscribed="subscribed"
:initial-todo-exists="todoExists"
:namespace="namespace"
:update-path="updateEndpoint"
:labels-path="labelsPath"
......
......@@ -10,6 +10,7 @@ export default () => {
// Convert backend casing to match frontend style guide
props.epicId = props.epic_id;
props.todoExists = props.todo_exists;
props.startDate = props.start_date;
props.endDate = props.end_date;
......
......@@ -61,6 +61,10 @@ export default {
type: Boolean,
required: true,
},
initialTodoExists: {
type: Boolean,
required: true,
},
namespace: {
type: String,
required: false,
......@@ -222,6 +226,7 @@ export default {
v-if="!collapsed"
:collapsed="collapsed"
:issuable-id="epicId"
:is-todo="initialTodoExists"
issuable-type="epic"
/>
</div>
......@@ -232,6 +237,7 @@ export default {
<sidebar-todo
:collapsed="collapsed"
:issuable-id="epicId"
:is-todo="initialTodoExists"
issuable-type="epic"
/>
</div>
......
......@@ -14,7 +14,7 @@ module EE
return default_label if group_id.nil?
return "Any group" if group_id == "0"
group = Group.find_by(id: group_id)
group = ::Group.find_by(id: group_id)
if group
group.full_name
......
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