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
Léo-Paul Géneau
gitlab-ce
Commits
dd9f8486
Commit
dd9f8486
authored
May 01, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle tasks and fix some specs
parent
a194e874
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
13 deletions
+31
-13
app/assets/javascripts/issue_show/issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+23
-13
spec/features/issues/award_spec.rb
spec/features/issues/award_spec.rb
+6
-0
spec/support/features/issuable_slash_commands_shared_examples.rb
...pport/features/issuable_slash_commands_shared_examples.rb
+2
-0
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
dd9f8486
...
@@ -20,7 +20,7 @@ export default {
...
@@ -20,7 +20,7 @@ export default {
errorCallback
:
(
err
)
=>
{
errorCallback
:
(
err
)
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console
.
error
(
'
ISSUE SHOW REALTIME ERROR
'
,
err
);
console
.
error
(
'
ISSUE SHOW REALTIME ERROR
'
,
err
,
err
.
stack
);
}
else
{
}
else
{
throw
new
Error
(
err
);
throw
new
Error
(
err
);
}
}
...
@@ -29,7 +29,7 @@ export default {
...
@@ -29,7 +29,7 @@ export default {
return
{
return
{
poll
,
poll
,
d
ata
:
{},
apiD
ata
:
{},
current
:
true
,
current
:
true
,
timeoutId
:
null
,
timeoutId
:
null
,
title
:
'
<span></span>
'
,
title
:
'
<span></span>
'
,
...
@@ -43,29 +43,41 @@ export default {
...
@@ -43,29 +43,41 @@ export default {
},
},
methods
:
{
methods
:
{
renderResponse
(
res
)
{
renderResponse
(
res
)
{
const
data
=
JSON
.
parse
(
res
.
body
);
this
.
apiData
=
JSON
.
parse
(
res
.
body
);
this
.
data
=
data
;
this
.
issueIID
=
this
.
apiData
.
issue_number
;
this
.
issueIID
=
this
.
data
.
issue_number
;
this
.
triggerAnimation
();
this
.
triggerAnimation
(
data
);
},
},
updateTaskHTML
()
{
updateTaskHTML
()
{
this
.
taskStatus
=
this
.
data
.
task_status
;
const
tasks
=
document
.
querySelector
(
'
#task_status_short
'
);
document
.
querySelector
(
'
#task_status
'
).
innerText
=
this
.
taskStatus
;
const
zeroTasks
=
this
.
apiData
.
task_status
.
includes
(
'
0 of 0
'
);
if
(
tasks
&&
!
zeroTasks
)
{
tasks
.
innerText
=
this
.
apiData
.
task_status
;
}
else
if
(
this
.
apiData
.
task_status
.
includes
(
'
0 of 0
'
))
{
$
(
'
#task_status_short
'
).
remove
();
}
else
if
(
!
tasks
&&
!
zeroTasks
)
{
$
(
'
.issuable-header
'
).
append
(
`
<span id="task_status_short" class="hidden-md hidden-lg">
${
this
.
apiData
.
task_status
}
</span>
`
);
}
},
},
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
)
{
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
)
{
const
elementStack
=
[];
const
elementStack
=
[];
if
(
!
noTitleChange
)
{
if
(
!
noTitleChange
)
{
this
.
titleText
=
this
.
d
ata
.
title_text
;
this
.
titleText
=
this
.
apiD
ata
.
title_text
;
elementStack
.
push
(
this
.
$el
.
querySelector
(
'
.title
'
));
elementStack
.
push
(
this
.
$el
.
querySelector
(
'
.title
'
));
}
}
if
(
!
noDescriptionChange
)
{
if
(
!
noDescriptionChange
)
{
// only change to true when we need to bind TaskLists the html of description
// only change to true when we need to bind TaskLists the html of description
this
.
descriptionChange
=
true
;
this
.
descriptionChange
=
true
;
this
.
updateTaskHTML
();
if
(
this
.
description
!==
'
<span></span>
'
)
{
if
(
this
.
description
!==
'
<span></span>
'
)
{
this
.
previousDescription
=
this
.
description
;
this
.
previousDescription
=
this
.
description
;
}
}
elementStack
.
push
(
this
.
$el
.
querySelector
(
'
.wiki
'
));
elementStack
.
push
(
this
.
$el
.
querySelector
(
'
.wiki
'
));
}
}
...
@@ -100,10 +112,8 @@ export default {
...
@@ -100,10 +112,8 @@ export default {
// always reset to false before checking the change
// always reset to false before checking the change
this
.
descriptionChange
=
false
;
this
.
descriptionChange
=
false
;
const
{
title
,
description
}
=
this
.
data
;
const
{
title
,
description
}
=
this
.
apiData
;
this
.
descriptionText
=
this
.
data
.
description_text
;
this
.
descriptionText
=
this
.
apiData
.
description_text
;
this
.
updateTaskHTML
();
const
noTitleChange
=
this
.
title
===
title
;
const
noTitleChange
=
this
.
title
===
title
;
const
noDescriptionChange
=
this
.
description
===
description
;
const
noDescriptionChange
=
this
.
description
===
description
;
...
...
spec/features/issues/award_spec.rb
View file @
dd9f8486
...
@@ -6,9 +6,12 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -6,9 +6,12 @@ feature 'Issue awards', js: true, feature: true do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
describe
'logged in'
do
describe
'logged in'
do
include
WaitForVueResource
before
do
before
do
login_as
(
user
)
login_as
(
user
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
wait_for_vue_resource
end
end
it
'adds award to issue'
do
it
'adds award to issue'
do
...
@@ -38,8 +41,11 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -38,8 +41,11 @@ feature 'Issue awards', js: true, feature: true do
end
end
describe
'logged out'
do
describe
'logged out'
do
include
WaitForVueResource
before
do
before
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
wait_for_vue_resource
end
end
it
'does not see award menu button'
do
it
'does not see award menu button'
do
...
...
spec/support/features/issuable_slash_commands_shared_examples.rb
View file @
dd9f8486
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
shared_examples
'issuable record that supports slash commands in its description and notes'
do
|
issuable_type
|
shared_examples
'issuable record that supports slash commands in its description and notes'
do
|
issuable_type
|
include
SlashCommandsHelpers
include
SlashCommandsHelpers
include
WaitForVueResource
let
(
:master
)
{
create
(
:user
)
}
let
(
:master
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
,
username:
'bob'
)
}
let
(
:assignee
)
{
create
(
:user
,
username:
'bob'
)
}
...
@@ -18,6 +19,7 @@ shared_examples 'issuable record that supports slash commands in its description
...
@@ -18,6 +19,7 @@ shared_examples 'issuable record that supports slash commands in its description
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
login_with
(
master
)
login_with
(
master
)
wait_for_vue_resource
end
end
after
do
after
do
...
...
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