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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
632d0c0a
Commit
632d0c0a
authored
May 31, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove EditableHelper and move method to IssuablesHelper
parent
33d66a47
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
35 deletions
+30
-35
app/helpers/editable_helper.rb
app/helpers/editable_helper.rb
+0
-13
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+12
-1
spec/helpers/editable_helper_spec.rb
spec/helpers/editable_helper_spec.rb
+0
-21
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+18
-0
No files found.
app/helpers/editable_helper.rb
deleted
100644 → 0
View file @
33d66a47
module
EditableHelper
def
updated_at_by
(
editable
)
return
{}
unless
editable
.
is_edited?
{
updated_at:
editable
.
updated_at
.
to_time
.
iso8601
,
updated_by:
{
name:
editable
.
last_edited_by
.
name
,
path:
user_path
(
editable
.
last_edited_by
)
}
}
end
end
app/helpers/issuables_helper.rb
View file @
632d0c0a
module
IssuablesHelper
module
IssuablesHelper
include
GitlabRoutingHelper
include
GitlabRoutingHelper
include
EditableHelper
def
sidebar_gutter_toggle_icon
def
sidebar_gutter_toggle_icon
sidebar_gutter_collapsed?
?
icon
(
'angle-double-left'
,
{
'aria-hidden'
:
'true'
})
:
icon
(
'angle-double-right'
,
{
'aria-hidden'
:
'true'
})
sidebar_gutter_collapsed?
?
icon
(
'angle-double-left'
,
{
'aria-hidden'
:
'true'
})
:
icon
(
'angle-double-right'
,
{
'aria-hidden'
:
'true'
})
...
@@ -285,4 +284,16 @@ module IssuablesHelper
...
@@ -285,4 +284,16 @@ module IssuablesHelper
data
.
merge
(
updated_at_by
)
data
.
merge
(
updated_at_by
)
end
end
def
updated_at_by
(
issuable
)
return
{}
unless
issuable
.
is_edited?
{
updated_at:
issuable
.
updated_at
.
to_time
.
iso8601
,
updated_by:
{
name:
issuable
.
last_edited_by
.
name
,
path:
user_path
(
issuable
.
last_edited_by
)
}
}
end
end
end
spec/helpers/editable_helper_spec.rb
deleted
100644 → 0
View file @
33d66a47
require
'spec_helper'
describe
EditableHelper
do
describe
'#updated_at_by'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:unedited_editable
)
{
create
(
:issue
)
}
let
(
:edited_editable
)
{
create
(
:issue
,
last_edited_by:
user
,
created_at:
3
.
days
.
ago
,
updated_at:
2
.
days
.
ago
,
last_edited_at:
2
.
days
.
ago
)
}
let
(
:edited_updated_at_by
)
do
{
updated_at:
edited_editable
.
updated_at
.
to_time
.
iso8601
,
updated_by:
{
name:
user
.
name
,
path:
user_path
(
user
)
}
}
end
it
{
expect
(
helper
.
updated_at_by
(
unedited_editable
)).
to
eq
({})
}
it
{
expect
(
helper
.
updated_at_by
(
edited_editable
)).
to
eq
(
edited_updated_at_by
)
}
end
end
spec/helpers/issuables_helper_spec.rb
View file @
632d0c0a
...
@@ -192,4 +192,22 @@ describe IssuablesHelper do
...
@@ -192,4 +192,22 @@ describe IssuablesHelper do
expect
(
helper
.
issuable_filter_present?
).
to
be_falsey
expect
(
helper
.
issuable_filter_present?
).
to
be_falsey
end
end
end
end
describe
'#updated_at_by'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:unedited_issuable
)
{
create
(
:issue
)
}
let
(
:edited_issuable
)
{
create
(
:issue
,
last_edited_by:
user
,
created_at:
3
.
days
.
ago
,
updated_at:
2
.
days
.
ago
,
last_edited_at:
2
.
days
.
ago
)
}
let
(
:edited_updated_at_by
)
do
{
updated_at:
edited_issuable
.
updated_at
.
to_time
.
iso8601
,
updated_by:
{
name:
user
.
name
,
path:
user_path
(
user
)
}
}
end
it
{
expect
(
helper
.
updated_at_by
(
unedited_issuable
)).
to
eq
({})
}
it
{
expect
(
helper
.
updated_at_by
(
edited_issuable
)).
to
eq
(
edited_updated_at_by
)
}
end
end
end
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