BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
feeba2ec
Commit
feeba2ec
authored
Jun 20, 2017
by
Filipa Lacerda
Committed by
kushalpandya
Jun 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'issue-task-status-fix' into 'master'
Stop showing task status if no tasks are present Closes #33880 See merge request !12303
parent
9a415064
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
34 deletions
+41
-34
app.vue
app/assets/javascripts/issue_show/components/app.vue
+6
-0
description.vue
app/assets/javascripts/issue_show/components/description.vue
+16
-12
index.js
app/assets/javascripts/issue_show/index.js
+1
-0
index.js
app/assets/javascripts/issue_show/stores/index.js
+2
-19
issuables_helper.rb
app/helpers/issuables_helper.rb
+4
-3
description_spec.js
spec/javascripts/issue_show/components/description_spec.js
+12
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
feeba2ec
...
...
@@ -51,6 +51,11 @@ export default {
required
:
false
,
default
:
''
,
},
initialTaskStatus
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
updatedAt
:
{
type
:
String
,
required
:
false
,
...
...
@@ -105,6 +110,7 @@ export default {
updatedAt
:
this
.
updatedAt
,
updatedByName
:
this
.
updatedByName
,
updatedByPath
:
this
.
updatedByPath
,
taskStatus
:
this
.
initialTaskStatus
,
});
return
{
...
...
app/assets/javascripts/issue_show/components/description.vue
View file @
feeba2ec
...
...
@@ -37,18 +37,7 @@
});
},
taskStatus
()
{
const
taskRegexMatches
=
this
.
taskStatus
.
match
(
/
(\d
+
)
of
(\d
+
)
/
);
const
$issuableHeader
=
$
(
'.issuable-meta'
);
const
$tasks
=
$
(
'#task_status'
,
$issuableHeader
);
const
$tasksShort
=
$
(
'#task_status_short'
,
$issuableHeader
);
if
(
taskRegexMatches
)
{
$tasks
.
text
(
this
.
taskStatus
);
$tasksShort
.
text
(
`
${
taskRegexMatches
[
1
]}
/
${
taskRegexMatches
[
2
]}
task
${
taskRegexMatches
[
2
]
>
1
?
's'
:
''
}
`
);
}
else
{
$tasks
.
text
(
''
);
$tasksShort
.
text
(
''
);
}
this
.
updateTaskStatusText
();
},
},
methods
:
{
...
...
@@ -64,9 +53,24 @@
});
}
},
updateTaskStatusText
()
{
const
taskRegexMatches
=
this
.
taskStatus
.
match
(
/
(\d
+
)
of
((?!
0
)\d
+
)
/
);
const
$issuableHeader
=
$
(
'.issuable-meta'
);
const
$tasks
=
$
(
'#task_status'
,
$issuableHeader
);
const
$tasksShort
=
$
(
'#task_status_short'
,
$issuableHeader
);
if
(
taskRegexMatches
)
{
$tasks
.
text
(
this
.
taskStatus
);
$tasksShort
.
text
(
`
${
taskRegexMatches
[
1
]}
/
${
taskRegexMatches
[
2
]}
task
${
taskRegexMatches
[
2
]
>
1
?
's'
:
''
}
`
);
}
else
{
$tasks
.
text
(
''
);
$tasksShort
.
text
(
''
);
}
},
},
mounted
()
{
this
.
renderGFM
();
this
.
updateTaskStatusText
();
},
};
</
script
>
...
...
app/assets/javascripts/issue_show/index.js
View file @
feeba2ec
...
...
@@ -45,6 +45,7 @@ document.addEventListener('DOMContentLoaded', () => {
updatedAt
:
this
.
updatedAt
,
updatedByName
:
this
.
updatedByName
,
updatedByPath
:
this
.
updatedByPath
,
initialTaskStatus
:
this
.
initialTaskStatus
,
},
});
},
...
...
app/assets/javascripts/issue_show/stores/index.js
View file @
feeba2ec
export
default
class
Store
{
constructor
({
titleHtml
,
titleText
,
descriptionHtml
,
descriptionText
,
updatedAt
,
updatedByName
,
updatedByPath
,
})
{
this
.
state
=
{
titleHtml
,
titleText
,
descriptionHtml
,
descriptionText
,
taskStatus
:
''
,
updatedAt
,
updatedByName
,
updatedByPath
,
};
constructor
(
initialState
)
{
this
.
state
=
initialState
;
this
.
formState
=
{
title
:
''
,
confidential
:
false
,
...
...
app/helpers/issuables_helper.rb
View file @
feeba2ec
...
...
@@ -138,8 +138,8 @@ module IssuablesHelper
end
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_short
,
id:
"task_status_short"
,
class:
"hidden-md hidden-lg"
)
output
<<
content_tag
(
:span
,
(
issuable
.
task_status
if
issuable
.
tasks?
)
,
id:
"task_status"
,
class:
"hidden-xs hidden-sm"
)
output
<<
content_tag
(
:span
,
(
issuable
.
task_status_short
if
issuable
.
tasks?
)
,
id:
"task_status_short"
,
class:
"hidden-md hidden-lg"
)
output
end
...
...
@@ -216,7 +216,8 @@ module IssuablesHelper
initialTitleHtml:
markdown_field
(
issuable
,
:title
),
initialTitleText:
issuable
.
title
,
initialDescriptionHtml:
markdown_field
(
issuable
,
:description
),
initialDescriptionText:
issuable
.
description
initialDescriptionText:
issuable
.
description
,
initialTaskStatus:
issuable
.
task_status
}
data
.
merge!
(
updated_at_by
(
issuable
))
...
...
spec/javascripts/issue_show/components/description_spec.js
View file @
feeba2ec
...
...
@@ -95,6 +95,18 @@ describe('Description component', () => {
done
();
});
});
it
(
'clears task status text when no tasks are present'
,
(
done
)
=>
{
vm
.
taskStatus
=
'0 of 0'
;
setTimeout
(()
=>
{
expect
(
document
.
querySelector
(
'.issuable-meta #task_status'
).
textContent
.
trim
(),
).
toBe
(
''
);
done
();
});
});
});
it
(
'applies syntax highlighting and math when description changed'
,
(
done
)
=>
{
...
...
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