Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
74d81d16
Commit
74d81d16
authored
May 14, 2020
by
Arun Kumar Mohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate filename displayed in design todos
parent
ac669daf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+6
-5
changelogs/unreleased/fix-design-todos-filename-duplication.yml
...logs/unreleased/fix-design-todos-filename-duplication.yml
+5
-0
spec/helpers/todos_helper_spec.rb
spec/helpers/todos_helper_spec.rb
+36
-1
No files found.
app/helpers/todos_helper.rb
View file @
74d81d16
...
...
@@ -37,11 +37,12 @@ module TodosHelper
end
def
todo_target_title
(
todo
)
if
todo
.
target
# Design To Dos' filenames are displayed in `#todo_target_link` (see `Design#to_reference`),
# so to avoid displaying duplicate filenames in the To Do list for designs,
# we return an empty string here.
return
""
if
todo
.
target
.
blank?
||
todo
.
for_design?
"
\"
#{
todo
.
target
.
title
}
\"
"
else
""
end
end
def
todo_parent_path
(
todo
)
...
...
changelogs/unreleased/fix-design-todos-filename-duplication.yml
0 → 100644
View file @
74d81d16
---
title
:
Fix duplicate filename displayed in design todos
merge_request
:
32274
author
:
Arun Kumar Mohan
type
:
fixed
spec/helpers/todos_helper_spec.rb
View file @
74d81d16
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
TodosHelper
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:author
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
title:
'Issue 1'
)
}
let_it_be
(
:design
)
{
create
(
:design
,
issue:
issue
)
}
let_it_be
(
:note
)
do
create
(
:note
,
...
...
@@ -68,6 +68,41 @@ describe TodosHelper do
end
end
describe
'#todo_target_title'
do
context
'when the target does not exist'
do
let
(
:todo
)
{
double
(
'Todo'
,
target:
nil
)
}
it
'returns an empty string'
do
title
=
helper
.
todo_target_title
(
todo
)
expect
(
title
).
to
eq
(
""
)
end
end
context
'when given a design todo'
do
let
(
:todo
)
{
design_todo
}
it
'returns an empty string'
do
title
=
helper
.
todo_target_title
(
todo
)
expect
(
title
).
to
eq
(
""
)
end
end
context
'when given a non-design todo'
do
let
(
:todo
)
do
create
(
:todo
,
:assigned
,
user:
user
,
project:
issue
.
project
,
target:
issue
,
author:
author
)
end
it
'returns the title'
do
title
=
helper
.
todo_target_title
(
todo
)
expect
(
title
).
to
eq
(
"
\"
Issue 1
\"
"
)
end
end
end
describe
'#todo_target_path'
do
context
'when given a design'
do
let
(
:todo
)
{
design_todo
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment