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
Jérome Perrin
gitlab-ce
Commits
0c55c889
Commit
0c55c889
authored
May 11, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some weird code to add/remove the task status
Moved the data into the data method Renamed edited ago class name
parent
1ed0673c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
45 deletions
+46
-45
app/assets/javascripts/issue_show/components/description.vue
app/assets/javascripts/issue_show/components/description.vue
+6
-13
app/assets/javascripts/issue_show/index.js
app/assets/javascripts/issue_show/index.js
+35
-25
app/assets/stylesheets/framework/mobile.scss
app/assets/stylesheets/framework/mobile.scss
+1
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+3
-5
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+1
-1
No files found.
app/assets/javascripts/issue_show/components/description.vue
View file @
0c55c889
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
return
{
return
{
preAnimation
:
false
,
preAnimation
:
false
,
pulseAnimation
:
false
,
pulseAnimation
:
false
,
timeAgoEl
:
$
(
'
.
issue_edited_
ago
'
),
timeAgoEl
:
$
(
'
.
js-issue-edited-
ago
'
),
};
};
},
},
watch
:
{
watch
:
{
...
@@ -49,22 +49,15 @@
...
@@ -49,22 +49,15 @@
taskStatus
()
{
taskStatus
()
{
const
taskRegexMatches
=
this
.
taskStatus
.
match
(
/
(\d
+
)
of
(\d
+
)
/
);
const
taskRegexMatches
=
this
.
taskStatus
.
match
(
/
(\d
+
)
of
(\d
+
)
/
);
const
$issuableHeader
=
$
(
'
.issuable-meta
'
);
const
$issuableHeader
=
$
(
'
.issuable-meta
'
);
let
$tasks
=
$
(
'
#task_status
'
,
$issuableHeader
);
const
$tasks
=
$
(
'
#task_status
'
,
$issuableHeader
);
let
$tasksShort
=
$
(
'
#task_status_short
'
,
$issuableHeader
);
const
$tasksShort
=
$
(
'
#task_status_short
'
,
$issuableHeader
);
if
(
this
.
taskStatus
.
indexOf
(
'
0 of 0
'
)
>=
0
||
this
.
taskStatus
.
trim
()
===
''
)
{
$tasks
.
remove
();
$tasksShort
.
remove
();
}
else
if
(
!
$tasks
.
length
&&
!
$tasksShort
.
length
)
{
$tasks
=
$issuableHeader
.
append
(
'
<span id="task_status" class="hidden-xs hidden-sm"></span>
'
)
.
find
(
'
#task_status
'
);
$tasksShort
=
$issuableHeader
.
append
(
'
<span id="task_status_short" class="hidden-md hidden-lg"></span>
'
)
.
find
(
'
#task_status_short
'
);
}
if
(
taskRegexMatches
)
{
if
(
taskRegexMatches
)
{
$tasks
.
text
(
this
.
taskStatus
);
$tasks
.
text
(
this
.
taskStatus
);
$tasksShort
.
text
(
`
${
taskRegexMatches
[
1
]}
/
${
taskRegexMatches
[
2
]}
task
${
taskRegexMatches
[
2
]
>
1
?
'
s
'
:
''
}
`
);
$tasksShort
.
text
(
`
${
taskRegexMatches
[
1
]}
/
${
taskRegexMatches
[
2
]}
task
${
taskRegexMatches
[
2
]
>
1
?
'
s
'
:
''
}
`
);
}
else
{
$tasks
.
text
(
''
);
$tasksShort
.
text
(
''
);
}
}
},
},
},
},
...
...
app/assets/javascripts/issue_show/index.js
View file @
0c55c889
...
@@ -2,31 +2,41 @@ import Vue from 'vue';
...
@@ -2,31 +2,41 @@ import Vue from 'vue';
import
issuableApp
from
'
./components/app.vue
'
;
import
issuableApp
from
'
./components/app.vue
'
;
import
'
../vue_shared/vue_resource_interceptor
'
;
import
'
../vue_shared/vue_resource_interceptor
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
new
Vue
({
const
issuableElement
=
document
.
getElementById
(
'
js-issuable-app
'
);
el
:
document
.
getElementById
(
'
js-issuable-app
'
),
const
issuableTitleElement
=
issuableElement
.
querySelector
(
'
.title
'
);
components
:
{
const
issuableDescriptionElement
=
issuableElement
.
querySelector
(
'
.wiki
'
);
issuableApp
,
const
issuableDescriptionTextarea
=
issuableElement
.
querySelector
(
'
.js-task-list-field
'
);
},
const
{
data
()
{
canUpdate
,
const
issuableElement
=
this
.
$options
.
el
;
endpoint
,
const
issuableTitleElement
=
issuableElement
.
querySelector
(
'
.title
'
);
issuableRef
,
const
issuableDescriptionElement
=
issuableElement
.
querySelector
(
'
.wiki
'
);
}
=
issuableElement
.
dataset
;
const
issuableDescriptionTextarea
=
issuableElement
.
querySelector
(
'
.js-task-list-field
'
);
const
{
canUpdate
,
endpoint
,
issuableRef
,
}
=
issuableElement
.
dataset
;
return
new
Vue
({
return
{
el
:
issuableElement
,
canUpdate
:
gl
.
utils
.
convertPermissionToBoolean
(
canUpdate
),
components
:
{
endpoint
,
issuableApp
,
issuableRef
,
},
initialTitle
:
issuableTitleElement
.
innerHTML
,
render
:
createElement
=>
createElement
(
'
issuable-app
'
,
{
initialDescriptionHtml
:
issuableDescriptionElement
?
issuableDescriptionElement
.
innerHTML
:
''
,
initialDescriptionText
:
issuableDescriptionTextarea
?
issuableDescriptionTextarea
.
textContent
:
''
,
};
},
render
(
createElement
)
{
return
createElement
(
'
issuable-app
'
,
{
props
:
{
props
:
{
canUpdate
:
gl
.
utils
.
convertPermissionToBoolean
(
canUpdate
)
,
canUpdate
:
this
.
canUpdate
,
endpoint
,
endpoint
:
this
.
endpoint
,
issuableRef
,
issuableRef
:
this
.
issuableRef
,
initialTitle
:
issuableTitleElement
.
innerHTML
,
initialTitle
:
this
.
initialTitle
,
initialDescriptionHtml
:
issuableDescriptionElement
?
issuableDescriptionElement
.
innerHTML
:
''
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionText
:
issuableDescriptionTextarea
?
issuableDescriptionTextarea
.
textContent
:
''
,
initialDescriptionText
:
this
.
initialDescriptionText
,
},
},
})
,
})
;
}
);
}
,
});
})
)
;
app/assets/stylesheets/framework/mobile.scss
View file @
0c55c889
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
}
}
}
}
.issue
_edited_
ago
,
.issue
-edited-
ago
,
.note_edited_ago
{
.note_edited_ago
{
display
:
none
;
display
:
none
;
}
}
...
...
app/helpers/issuables_helper.rb
View file @
0c55c889
...
@@ -136,11 +136,9 @@ module IssuablesHelper
...
@@ -136,11 +136,9 @@ module IssuablesHelper
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"hidden-sm hidden-md hidden-lg"
)
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"hidden-sm hidden-md hidden-lg"
)
end
end
if
issuable
.
tasks?
output
<<
" "
.
html_safe
output
<<
" "
.
html_safe
output
<<
content_tag
(
:span
,
issuable
.
task_status
,
id:
"task_status"
,
class:
"hidden-xs hidden-sm"
)
output
<<
content_tag
(
:span
,
issuable
.
task_status
,
id:
"task_status"
,
class:
"hidden-xs hidden-sm"
)
output
<<
content_tag
(
:span
,
issuable
.
task_status_short
,
id:
"task_status_short"
,
class:
"hidden-md hidden-lg"
)
output
<<
content_tag
(
:span
,
issuable
.
task_status_short
,
id:
"task_status_short"
,
class:
"hidden-md hidden-lg"
)
end
output
output
end
end
...
...
app/views/projects/issues/show.html.haml
View file @
0c55c889
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
.wiki
=
markdown_field
(
@issue
,
:description
)
.wiki
=
markdown_field
(
@issue
,
:description
)
%textarea
.hidden.js-task-list-field
=
@issue
.
description
%textarea
.hidden.js-task-list-field
=
@issue
.
description
=
edited_time_ago_with_tooltip
(
@issue
,
placement:
'bottom'
,
html_class:
'issue
_edited_
ago'
)
=
edited_time_ago_with_tooltip
(
@issue
,
placement:
'bottom'
,
html_class:
'issue
-edited-ago js-issue-edited-
ago'
)
#merge-requests
{
data:
{
url:
referenced_merge_requests_namespace_project_issue_url
(
@project
.
namespace
,
@project
,
@issue
)
}
}
#merge-requests
{
data:
{
url:
referenced_merge_requests_namespace_project_issue_url
(
@project
.
namespace
,
@project
,
@issue
)
}
}
// This element is filled in using JavaScript.
// This element is filled in using JavaScript.
...
...
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