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
7eba9b7d
Commit
7eba9b7d
authored
Oct 26, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-26
parents
e8df1bfe
2a8c3f6d
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
91 additions
and
20 deletions
+91
-20
app/assets/javascripts/jobs/components/sidebar.vue
app/assets/javascripts/jobs/components/sidebar.vue
+6
-5
app/assets/javascripts/jobs/components/stages_dropdown.vue
app/assets/javascripts/jobs/components/stages_dropdown.vue
+0
-1
app/assets/javascripts/jobs/store/mutations.js
app/assets/javascripts/jobs/store/mutations.js
+1
-1
app/assets/javascripts/jobs/store/state.js
app/assets/javascripts/jobs/store/state.js
+1
-3
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+17
-0
app/assets/stylesheets/framework/typography.scss
app/assets/stylesheets/framework/typography.scss
+1
-1
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/views/shared/notifications/_button.html.haml
app/views/shared/notifications/_button.html.haml
+2
-2
changelogs/unreleased/51306-fix-inaccessible-dropdown-for-codeless-projects.yml
...51306-fix-inaccessible-dropdown-for-codeless-projects.yml
+5
-0
changelogs/unreleased/52115-Link-button-in-markdown-editor-should-recognize-URLs.yml
...-Link-button-in-markdown-editor-should-recognize-URLs.yml
+5
-0
changelogs/unreleased/53133-jobs-list.yml
changelogs/unreleased/53133-jobs-list.yml
+5
-0
changelogs/unreleased/avoid-lock-when-introduce-new-failure-reason.yml
...released/avoid-lock-when-introduce-new-failure-reason.yml
+5
-0
lib/api/runner.rb
lib/api/runner.rb
+1
-2
spec/javascripts/jobs/components/sidebar_spec.js
spec/javascripts/jobs/components/sidebar_spec.js
+3
-2
spec/javascripts/jobs/store/mutations_spec.js
spec/javascripts/jobs/store/mutations_spec.js
+2
-2
spec/javascripts/lib/utils/text_markdown_spec.js
spec/javascripts/lib/utils/text_markdown_spec.js
+27
-0
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+9
-0
No files found.
app/assets/javascripts/jobs/components/sidebar.vue
View file @
7eba9b7d
...
...
@@ -31,7 +31,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
job
'
,
'
stages
'
,
'
jobs
'
,
'
selectedStage
'
]),
...
mapState
([
'
job
'
,
'
stages
'
,
'
jobs
'
,
'
selectedStage
'
,
'
isLoadingStages
'
]),
coverage
()
{
return
`
${
this
.
job
.
coverage
}
%`
;
},
...
...
@@ -59,10 +59,10 @@ export default {
return
''
;
}
let
t
=
this
.
job
.
metadata
.
timeout_human_readable
;
if
(
this
.
job
.
metadata
.
timeout_source
!==
''
)
{
t
+=
` (from
${
this
.
job
.
metadata
.
timeout_source
}
)`
;
}
let
t
=
this
.
job
.
metadata
.
timeout_human_readable
;
if
(
this
.
job
.
metadata
.
timeout_source
!==
''
)
{
t
+=
` (from
${
this
.
job
.
metadata
.
timeout_source
}
)`
;
}
return
t
;
},
...
...
@@ -270,6 +270,7 @@ export default {
/>
<stages-dropdown
v-if=
"!isLoadingStages"
:stages=
"stages"
:pipeline=
"job.pipeline"
:selected-stage=
"selectedStage"
...
...
app/assets/javascripts/jobs/components/stages_dropdown.vue
View file @
7eba9b7d
...
...
@@ -22,7 +22,6 @@ export default {
required
:
true
,
},
},
computed
:
{
hasRef
()
{
return
!
_
.
isEmpty
(
this
.
pipeline
.
ref
);
...
...
app/assets/javascripts/jobs/store/mutations.js
View file @
7eba9b7d
...
...
@@ -71,7 +71,7 @@ export default {
* after the first request,
* and we do not want to hijack that
*/
if
(
state
.
selectedStage
===
'
More
'
&&
job
.
stage
)
{
if
(
state
.
selectedStage
===
''
&&
job
.
stage
)
{
state
.
selectedStage
=
job
.
stage
;
}
},
...
...
app/assets/javascripts/jobs/store/state.js
View file @
7eba9b7d
import
{
__
}
from
'
~/locale
'
;
export
default
()
=>
({
jobEndpoint
:
null
,
traceEndpoint
:
null
,
...
...
@@ -29,7 +27,7 @@ export default () => ({
// sidebar dropdown & list of jobs
isLoadingStages
:
false
,
isLoadingJobs
:
false
,
selectedStage
:
__
(
'
More
'
)
,
selectedStage
:
''
,
stages
:
[],
jobs
:
[],
});
app/assets/javascripts/lib/utils/text_markdown.js
View file @
7eba9b7d
...
...
@@ -2,6 +2,8 @@
import
$
from
'
jquery
'
;
import
{
insertText
}
from
'
~/lib/utils/common_utils
'
;
const
LINK_TAG_PATTERN
=
'
[{text}](url)
'
;
function
selectedText
(
text
,
textarea
)
{
return
text
.
substring
(
textarea
.
selectionStart
,
textarea
.
selectionEnd
);
}
...
...
@@ -76,6 +78,21 @@ export function insertMarkdownText({ textArea, text, tag, blockTag, selected, wr
removedFirstNewLine
=
false
;
currentLineEmpty
=
false
;
// check for link pattern and selected text is an URL
// if so fill in the url part instead of the text part of the pattern.
if
(
tag
===
LINK_TAG_PATTERN
)
{
if
(
URL
)
{
try
{
const
ignoredUrl
=
new
URL
(
selected
);
// valid url
tag
=
'
[text]({text})
'
;
select
=
'
text
'
;
}
catch
(
e
)
{
// ignore - no valid url
}
}
}
// Remove the first newline
if
(
selected
.
indexOf
(
'
\n
'
)
===
0
)
{
removedFirstNewLine
=
true
;
...
...
app/assets/stylesheets/framework/typography.scss
View file @
7eba9b7d
...
...
@@ -34,7 +34,7 @@
margin-bottom
:
0
;
}
*
:first-child
:not
(
.katex-display
)
{
*
:first-child
{
margin-top
:
0
;
}
...
...
app/models/commit_status.rb
View file @
7eba9b7d
...
...
@@ -111,7 +111,7 @@ class CommitStatus < ActiveRecord::Base
before_transition
any
=>
:failed
do
|
commit_status
,
transition
|
failure_reason
=
transition
.
args
.
first
commit_status
.
failure_reason
=
failure_reason
commit_status
.
failure_reason
=
CommitStatus
.
failure_reasons
[
failure_reason
]
end
after_transition
do
|
commit_status
,
transition
|
...
...
app/views/shared/notifications/_button.html.haml
View file @
7eba9b7d
...
...
@@ -9,11 +9,11 @@
%button
.dropdown-new.btn.btn-default.has-tooltip.notifications-btn
#notifications-button
{
type:
"button"
,
title:
"Notification setting"
,
"aria-label"
=>
"Notification setting: #{notification_title(notification_setting.level)}"
,
data:
{
container:
"body"
,
toggle:
"modal"
,
target:
"#"
+
notifications_menu_identifier
(
"modal"
,
notification_setting
),
display:
'static'
}
}
=
icon
(
"bell"
,
class:
"js-notification-loading"
)
=
notification_title
(
notification_setting
.
level
)
%button
.btn.dropdown-toggle
{
data:
{
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
)
}
}
%button
.btn.dropdown-toggle
{
data:
{
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
)
,
flip:
"false"
}
}
=
icon
(
'caret-down'
)
.sr-only
Toggle dropdown
-
else
%button
.dropdown-new.btn.btn-default.has-tooltip.notifications-btn
#notifications-button
{
type:
"button"
,
title:
"Notification setting"
,
"aria-label"
=>
"Notification setting: #{notification_title(notification_setting.level)}"
,
data:
{
container:
"body"
,
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
),
display:
'static'
}
}
%button
.dropdown-new.btn.btn-default.has-tooltip.notifications-btn
#notifications-button
{
type:
"button"
,
title:
"Notification setting"
,
"aria-label"
=>
"Notification setting: #{notification_title(notification_setting.level)}"
,
data:
{
container:
"body"
,
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
),
flip:
"false"
}
}
=
icon
(
"bell"
,
class:
"js-notification-loading"
)
=
notification_title
(
notification_setting
.
level
)
=
icon
(
"caret-down"
)
...
...
changelogs/unreleased/51306-fix-inaccessible-dropdown-for-codeless-projects.yml
0 → 100644
View file @
7eba9b7d
---
title
:
Fix inaccessible dropdown for code-less projects
merge_request
:
22137
author
:
type
:
other
changelogs/unreleased/52115-Link-button-in-markdown-editor-should-recognize-URLs.yml
0 → 100644
View file @
7eba9b7d
---
title
:
Link button in markdown editor recognize URLs
merge_request
:
1983
author
:
Johann Hubert Sonntagbauer
type
:
changed
changelogs/unreleased/53133-jobs-list.yml
0 → 100644
View file @
7eba9b7d
---
title
:
Fix stage dropdown not rendering in different languages
merge_request
:
22604
author
:
type
:
other
changelogs/unreleased/avoid-lock-when-introduce-new-failure-reason.yml
0 → 100644
View file @
7eba9b7d
---
title
:
Support backward compatibility when introduce new failure reason
merge_request
:
22566
author
:
type
:
changed
lib/api/runner.rb
View file @
7eba9b7d
...
...
@@ -142,8 +142,7 @@ module API
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:trace
,
type:
String
,
desc:
%q(Job's full trace)
optional
:state
,
type:
String
,
desc:
%q(Job's status: success, failed)
optional
:failure_reason
,
type:
String
,
values:
CommitStatus
.
failure_reasons
.
keys
,
desc:
%q(Job's failure_reason)
optional
:failure_reason
,
type:
String
,
desc:
%q(Job's failure_reason)
end
put
'/:id'
do
job
=
authenticate_job!
...
...
spec/javascripts/jobs/components/sidebar_spec.js
View file @
7eba9b7d
...
...
@@ -140,10 +140,11 @@ describe('Sidebar details block', () => {
});
describe
(
'
while fetching stages
'
,
()
=>
{
it
(
'
renders dropdown with More label
'
,
()
=>
{
it
(
'
it does not render dropdown
'
,
()
=>
{
store
.
dispatch
(
'
requestStages
'
);
vm
=
mountComponentWithStore
(
SidebarComponent
,
{
store
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-selected-stage
'
)
.
textContent
.
trim
()).
toEqual
(
'
More
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-selected-stage
'
)
).
toBeNull
(
);
});
});
...
...
spec/javascripts/jobs/store/mutations_spec.js
View file @
7eba9b7d
...
...
@@ -124,8 +124,8 @@ describe('Jobs Store Mutations', () => {
expect
(
stateCopy
.
job
).
toEqual
({
id
:
1312321
});
});
it
(
'
sets selectedStage when the selectedStage is
More
'
,
()
=>
{
expect
(
stateCopy
.
selectedStage
).
toEqual
(
'
More
'
);
it
(
'
sets selectedStage when the selectedStage is
empty
'
,
()
=>
{
expect
(
stateCopy
.
selectedStage
).
toEqual
(
''
);
mutations
[
types
.
RECEIVE_JOB_SUCCESS
](
stateCopy
,
{
id
:
1312321
,
stage
:
'
deploy
'
});
expect
(
stateCopy
.
selectedStage
).
toEqual
(
'
deploy
'
);
...
...
spec/javascripts/lib/utils/text_markdown_spec.js
View file @
7eba9b7d
...
...
@@ -166,6 +166,33 @@ describe('init markdown', () => {
expect
(
textArea
.
selectionStart
).
toEqual
(
expectedText
.
lastIndexOf
(
select
));
expect
(
textArea
.
selectionEnd
).
toEqual
(
expectedText
.
lastIndexOf
(
select
)
+
select
.
length
);
});
it
(
'
should support selected urls
'
,
()
=>
{
const
expectedUrl
=
'
http://www.gitlab.com
'
;
const
expectedSelectionText
=
'
text
'
;
const
expectedText
=
`text [
${
expectedSelectionText
}
](
${
expectedUrl
}
) text`
;
const
initialValue
=
`text
${
expectedUrl
}
text`
;
textArea
.
value
=
initialValue
;
const
selectedIndex
=
initialValue
.
indexOf
(
expectedUrl
);
textArea
.
setSelectionRange
(
selectedIndex
,
selectedIndex
+
expectedUrl
.
length
);
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
,
blockTag
:
null
,
selected
:
expectedUrl
,
wrap
:
false
,
select
,
});
expect
(
textArea
.
value
).
toEqual
(
expectedText
);
expect
(
textArea
.
selectionStart
).
toEqual
(
expectedText
.
indexOf
(
expectedSelectionText
,
1
));
expect
(
textArea
.
selectionEnd
).
toEqual
(
expectedText
.
indexOf
(
expectedSelectionText
,
1
)
+
expectedSelectionText
.
length
,
);
});
});
});
});
spec/requests/api/runner_spec.rb
View file @
7eba9b7d
...
...
@@ -802,6 +802,15 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
it
{
expect
(
job
).
to
be_runner_system_failure
}
end
context
'when failure_reason is unrecognized value'
do
before
do
update_job
(
state:
'failed'
,
failure_reason:
'what_is_this'
)
job
.
reload
end
it
{
expect
(
job
).
to
be_unknown_failure
}
end
end
context
'when trace is given'
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