Commit b336dcb7 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Merge branch '32959-update-todo-icon' into 'master'

Update Todo icons in collapsed sidebar for Issues and MRs

See merge request gitlab-org/gitlab-ce!22534
parents d16ef877 b9ad4ecc
...@@ -386,8 +386,8 @@ module IssuablesHelper ...@@ -386,8 +386,8 @@ module IssuablesHelper
{ {
todo_text: "Add todo", todo_text: "Add todo",
mark_text: "Mark todo as done", mark_text: "Mark todo as done",
todo_icon: (is_collapsed ? icon('plus-square') : nil), todo_icon: (is_collapsed ? sprite_icon('todo-add') : nil),
mark_icon: (is_collapsed ? icon('check-square', class: 'todo-undone') : nil), mark_icon: (is_collapsed ? sprite_icon('todo-done', css_class: 'todo-undone') : nil),
issuable_id: issuable.id, issuable_id: issuable.id,
issuable_type: issuable.class.name.underscore, issuable_type: issuable.class.name.underscore,
url: project_todos_path(@project), url: project_todos_path(@project),
......
- is_collapsed = local_assigns.fetch(:is_collapsed, false) - is_collapsed = local_assigns.fetch(:is_collapsed, false)
- mark_content = is_collapsed ? icon('check-square', class: 'todo-undone') : _('Mark todo as done') - mark_content = is_collapsed ? sprite_icon('todo-done', css_class: 'todo-undone') : _('Mark todo as done')
- todo_content = is_collapsed ? icon('plus-square') : _('Add todo') - todo_content = is_collapsed ? sprite_icon('todo-add') : _('Add todo')
%button.issuable-todo-btn.js-issuable-todo{ type: 'button', %button.issuable-todo-btn.js-issuable-todo{ type: 'button',
class: (is_collapsed ? 'btn-blank sidebar-collapsed-icon dont-change-state has-tooltip' : 'btn btn-default issuable-header-btn float-right'), class: (is_collapsed ? 'btn-blank sidebar-collapsed-icon dont-change-state has-tooltip' : 'btn btn-default issuable-header-btn float-right'),
......
---
title: Update Todo icons in collapsed sidebar for Issues and MRs
merge_request: 22534
author:
type: changed
...@@ -45,8 +45,10 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -45,8 +45,10 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
expect(document.querySelector('.js-issuable-todo.sidebar-collapsed-icon')).not.toBeNull(); expect(document.querySelector('.js-issuable-todo.sidebar-collapsed-icon')).not.toBeNull();
expect( expect(
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon .fa-plus-square'), document
).not.toBeNull(); .querySelector('.js-issuable-todo.sidebar-collapsed-icon svg use')
.getAttribute('xlink:href'),
).toContain('todo-add');
expect( expect(
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon .todo-undone'), document.querySelector('.js-issuable-todo.sidebar-collapsed-icon .todo-undone'),
...@@ -68,8 +70,10 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -68,8 +70,10 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
).not.toBeNull(); ).not.toBeNull();
expect( expect(
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon .fa-check-square'), document
).not.toBeNull(); .querySelector('.js-issuable-todo.sidebar-collapsed-icon svg.todo-undone use')
.getAttribute('xlink:href'),
).toContain('todo-done');
done(); done();
}); });
......
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