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
ce2bc5c0
Commit
ce2bc5c0
authored
Jun 04, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly load up merge request
fixed pipeline request throwing an error
parent
03820e9b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
84 additions
and
38 deletions
+84
-38
app/assets/javascripts/ide/components/ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+8
-5
app/assets/javascripts/ide/components/ide_side_bar.vue
app/assets/javascripts/ide/components/ide_side_bar.vue
+7
-1
app/assets/javascripts/ide/components/ide_status_bar.vue
app/assets/javascripts/ide/components/ide_status_bar.vue
+6
-8
app/assets/javascripts/ide/components/merge_requests/dropdown.vue
...ts/javascripts/ide/components/merge_requests/dropdown.vue
+0
-3
app/assets/javascripts/ide/components/merge_requests/item.vue
...assets/javascripts/ide/components/merge_requests/item.vue
+9
-2
app/assets/javascripts/ide/components/merge_requests/list.vue
...assets/javascripts/ide/components/merge_requests/list.vue
+15
-12
app/assets/javascripts/ide/index.js
app/assets/javascripts/ide/index.js
+1
-0
app/assets/javascripts/ide/stores/actions/project.js
app/assets/javascripts/ide/stores/actions/project.js
+1
-2
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
.../javascripts/ide/stores/modules/merge_requests/actions.js
+15
-0
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
...ssets/javascripts/ide/stores/modules/pipelines/actions.js
+3
-0
app/assets/javascripts/ide/stores/mutation_types.js
app/assets/javascripts/ide/stores/mutation_types.js
+3
-0
app/assets/javascripts/ide/stores/mutations.js
app/assets/javascripts/ide/stores/mutations.js
+6
-0
app/assets/javascripts/vue_shared/components/tabs/tabs.js
app/assets/javascripts/vue_shared/components/tabs/tabs.js
+1
-0
app/assets/stylesheets/framework/contextual_sidebar.scss
app/assets/stylesheets/framework/contextual_sidebar.scss
+5
-5
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+4
-0
No files found.
app/assets/javascripts/ide/components/ide_review.vue
View file @
ce2bc5c0
...
@@ -11,17 +11,17 @@ export default {
...
@@ -11,17 +11,17 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'
currentMergeRequest
'
]),
...
mapGetters
([
'
currentMergeRequest
'
]),
...
mapState
([
'
viewer
'
]),
...
mapState
([
'
viewer
'
,
'
currentMergeRequestId
'
]),
showLatestChangesText
()
{
showLatestChangesText
()
{
return
!
this
.
currentMergeRequest
||
this
.
viewer
===
viewerTypes
.
diff
;
return
!
this
.
currentMergeRequest
Id
||
this
.
viewer
===
viewerTypes
.
diff
;
},
},
showMergeRequestText
()
{
showMergeRequestText
()
{
return
this
.
currentMergeRequest
&&
this
.
viewer
===
viewerTypes
.
mr
;
return
this
.
currentMergeRequest
Id
&&
this
.
viewer
===
viewerTypes
.
mr
;
},
},
},
},
mounted
()
{
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
updateViewer
(
this
.
currentMergeRequest
?
viewerTypes
.
mr
:
viewerTypes
.
diff
);
this
.
updateViewer
(
this
.
currentMergeRequest
Id
?
viewerTypes
.
mr
:
viewerTypes
.
diff
);
});
});
},
},
methods
:
{
methods
:
{
...
@@ -54,7 +54,10 @@ export default {
...
@@ -54,7 +54,10 @@ export default {
</
template
>
</
template
>
<
template
v-else-if=
"showMergeRequestText"
>
<
template
v-else-if=
"showMergeRequestText"
>
{{
__
(
'
Merge request
'
)
}}
{{
__
(
'
Merge request
'
)
}}
(
<a
:href=
"currentMergeRequest.web_url"
>
!
{{
currentMergeRequest
.
iid
}}
</a>
)
(
<a
v-if=
"currentMergeRequest"
:href=
"currentMergeRequest.web_url"
>
!
{{
currentMergeRequest
.
iid
}}
</a>
)
</
template
>
</
template
>
</div>
</div>
</template>
</template>
...
...
app/assets/javascripts/ide/components/ide_side_bar.vue
View file @
ce2bc5c0
...
@@ -65,6 +65,8 @@ export default {
...
@@ -65,6 +65,8 @@ export default {
watch
:
{
watch
:
{
currentBranchId
()
{
currentBranchId
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
!
this
.
$refs
.
branchId
)
return
;
this
.
showTooltip
=
this
.
$refs
.
branchId
.
scrollWidth
>
this
.
$refs
.
branchId
.
offsetWidth
;
this
.
showTooltip
=
this
.
$refs
.
branchId
.
scrollWidth
>
this
.
$refs
.
branchId
.
offsetWidth
;
});
});
},
},
...
@@ -145,6 +147,7 @@ export default {
...
@@ -145,6 +147,7 @@ export default {
</div>
</div>
<div
class=
"d-flex"
>
<div
class=
"d-flex"
>
<div
<div
v-if=
"currentBranchId"
class=
"sidebar-context-title ide-sidebar-branch-title"
class=
"sidebar-context-title ide-sidebar-branch-title"
ref=
"branchId"
ref=
"branchId"
v-tooltip
v-tooltip
...
@@ -157,7 +160,10 @@ export default {
...
@@ -157,7 +160,10 @@ export default {
</div>
</div>
<div
<div
v-if=
"currentMergeRequestId"
v-if=
"currentMergeRequestId"
class=
"sidebar-context-title ide-sidebar-branch-title prepend-left-8"
class=
"sidebar-context-title ide-sidebar-branch-title"
:class=
"
{
'prepend-left-8': currentBranchId
}"
>
>
<icon
<icon
name=
"git-merge"
name=
"git-merge"
...
...
app/assets/javascripts/ide/components/ide_status_bar.vue
View file @
ce2bc5c0
...
@@ -35,9 +35,7 @@ export default {
...
@@ -35,9 +35,7 @@ export default {
},
},
watch
:
{
watch
:
{
lastCommit
()
{
lastCommit
()
{
if
(
!
this
.
isPollingInitialized
)
{
this
.
initPipelinePolling
();
this
.
initPipelinePolling
();
}
},
},
},
},
mounted
()
{
mounted
()
{
...
@@ -47,9 +45,8 @@ export default {
...
@@ -47,9 +45,8 @@ export default {
if
(
this
.
intervalId
)
{
if
(
this
.
intervalId
)
{
clearInterval
(
this
.
intervalId
);
clearInterval
(
this
.
intervalId
);
}
}
if
(
this
.
isPollingInitialized
)
{
this
.
stopPipelinePolling
();
this
.
stopPipelinePolling
();
}
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
pipelines
'
,
[
'
fetchLatestPipeline
'
,
'
stopPipelinePolling
'
]),
...
mapActions
(
'
pipelines
'
,
[
'
fetchLatestPipeline
'
,
'
stopPipelinePolling
'
]),
...
@@ -59,8 +56,9 @@ export default {
...
@@ -59,8 +56,9 @@ export default {
},
1000
);
},
1000
);
},
},
initPipelinePolling
()
{
initPipelinePolling
()
{
this
.
fetchLatestPipeline
();
if
(
this
.
lastCommit
)
{
this
.
isPollingInitialized
=
true
;
this
.
fetchLatestPipeline
();
}
},
},
commitAgeUpdate
()
{
commitAgeUpdate
()
{
if
(
this
.
lastCommit
)
{
if
(
this
.
lastCommit
)
{
...
...
app/assets/javascripts/ide/components/merge_requests/dropdown.vue
View file @
ce2bc5c0
...
@@ -12,7 +12,6 @@ export default {
...
@@ -12,7 +12,6 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapGetters
(
'
mergeRequests
'
,
[
'
assignedData
'
,
'
createdData
'
]),
...
mapGetters
(
'
mergeRequests
'
,
[
'
assignedData
'
,
'
createdData
'
]),
...
mapState
([
'
currentMergeRequestId
'
]),
createdMergeRequestLength
()
{
createdMergeRequestLength
()
{
return
this
.
createdData
.
mergeRequests
.
length
;
return
this
.
createdData
.
mergeRequests
.
length
;
},
},
...
@@ -37,7 +36,6 @@ export default {
...
@@ -37,7 +36,6 @@ export default {
</
template
>
</
template
>
<list
<list
type=
"created"
type=
"created"
:current-id=
"currentMergeRequestId"
:empty-text=
"__('You have not created any merge requests')"
:empty-text=
"__('You have not created any merge requests')"
@
hide=
"hideDropdown"
@
hide=
"hideDropdown"
/>
/>
...
@@ -51,7 +49,6 @@ export default {
...
@@ -51,7 +49,6 @@ export default {
</
template
>
</
template
>
<list
<list
type=
"assigned"
type=
"assigned"
:current-id=
"currentMergeRequestId"
:empty-text=
"__('You do not have any assigned merge requests')"
:empty-text=
"__('You do not have any assigned merge requests')"
@
hide=
"hideDropdown"
@
hide=
"hideDropdown"
/>
/>
...
...
app/assets/javascripts/ide/components/merge_requests/item.vue
View file @
ce2bc5c0
...
@@ -14,10 +14,17 @@ export default {
...
@@ -14,10 +14,17 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
currentProjectId
:
{
type
:
String
,
required
:
true
,
},
},
},
computed
:
{
computed
:
{
isActive
()
{
isActive
()
{
return
this
.
item
.
iid
===
parseInt
(
this
.
currentId
,
10
);
return
(
this
.
item
.
iid
===
parseInt
(
this
.
currentId
,
10
)
&&
this
.
currentProjectId
===
this
.
item
.
projectPathWithNamespace
);
},
},
pathWithID
()
{
pathWithID
()
{
return
`
${
this
.
item
.
projectPathWithNamespace
}
!
${
this
.
item
.
iid
}
`
;
return
`
${
this
.
item
.
projectPathWithNamespace
}
!
${
this
.
item
.
iid
}
`
;
...
@@ -35,7 +42,7 @@ export default {
...
@@ -35,7 +42,7 @@ export default {
<button
<button
type=
"button"
type=
"button"
class=
"d-flex align-items-center"
class=
"d-flex align-items-center"
@
click=
"clickItem"
@
click
.prevent.stop
=
"clickItem"
>
>
<span
<span
class=
"d-flex append-right-default"
class=
"d-flex append-right-default"
...
...
app/assets/javascripts/ide/components/merge_requests/list.vue
View file @
ce2bc5c0
<
script
>
<
script
>
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
LoadingIcon
from
'
../../../vue_shared/components/loading_icon.vue
'
;
import
LoadingIcon
from
'
../../../vue_shared/components/loading_icon.vue
'
;
import
Item
from
'
./item.vue
'
;
import
Item
from
'
./item.vue
'
;
...
@@ -14,10 +14,6 @@ export default {
...
@@ -14,10 +14,6 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
currentId
:
{
type
:
String
,
required
:
true
,
},
emptyText
:
{
emptyText
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -30,6 +26,7 @@ export default {
...
@@ -30,6 +26,7 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapGetters
(
'
mergeRequests
'
,
[
'
getData
'
]),
...
mapGetters
(
'
mergeRequests
'
,
[
'
getData
'
]),
...
mapState
([
'
currentMergeRequestId
'
,
'
currentProjectId
'
]),
data
()
{
data
()
{
return
this
.
getData
(
this
.
type
);
return
this
.
getData
(
this
.
type
);
},
},
...
@@ -46,21 +43,26 @@ export default {
...
@@ -46,21 +43,26 @@ export default {
return
this
.
search
!==
''
&&
!
this
.
hasMergeRequests
;
return
this
.
search
!==
''
&&
!
this
.
hasMergeRequests
;
},
},
},
},
watch
:
{
isLoading
:
{
handler
:
'
focusSearch
'
,
},
},
mounted
()
{
mounted
()
{
this
.
loadMergeRequests
();
this
.
loadMergeRequests
();
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
mergeRequests
'
,
[
'
fetchMergeRequests
'
]),
...
mapActions
(
'
mergeRequests
'
,
[
'
fetchMergeRequests
'
,
'
openMergeRequest
'
]),
...
mapActions
([
'
closeAllFiles
'
]),
...
mapActions
([
'
closeAllFiles
'
]),
loadMergeRequests
()
{
loadMergeRequests
()
{
this
.
fetchMergeRequests
({
type
:
this
.
type
,
search
:
this
.
search
});
this
.
fetchMergeRequests
({
type
:
this
.
type
,
search
:
this
.
search
});
},
},
viewMergeRequest
(
item
)
{
viewMergeRequest
(
item
)
{
return
this
.
closeAllFiles
()
this
.
$emit
(
'
hide
'
);
.
then
(()
=>
{
this
.
openMergeRequest
(
{
this
.
$emit
(
'
hide
'
);
projectPath
:
item
.
projectPathWithNamespace
,
this
.
$router
.
push
(
`/project/
${
item
.
projectPathWithNamespace
}
/merge_requests/
${
item
.
iid
}
`
);
id
:
item
.
iid
,
});
});
},
},
searchMergeRequests
:
_
.
debounce
(
function
debounceSearch
()
{
searchMergeRequests
:
_
.
debounce
(
function
debounceSearch
()
{
this
.
loadMergeRequests
();
this
.
loadMergeRequests
();
...
@@ -107,7 +109,8 @@ export default {
...
@@ -107,7 +109,8 @@ export default {
>
>
<item
<item
:item=
"item"
:item=
"item"
:current-id=
"currentId"
:current-id=
"currentMergeRequestId"
:current-project-id=
"currentProjectId"
@
click=
"viewMergeRequest"
@
click=
"viewMergeRequest"
/>
/>
</li>
</li>
...
...
app/assets/javascripts/ide/index.js
View file @
ce2bc5c0
...
@@ -9,6 +9,7 @@ Vue.use(Translate);
...
@@ -9,6 +9,7 @@ Vue.use(Translate);
export
function
initIde
(
el
)
{
export
function
initIde
(
el
)
{
if
(
!
el
)
return
null
;
if
(
!
el
)
return
null
;
window
.
store
=
store
;
return
new
Vue
({
return
new
Vue
({
el
,
el
,
...
...
app/assets/javascripts/ide/stores/actions/project.js
View file @
ce2bc5c0
...
@@ -13,8 +13,7 @@ export const getProjectData = ({ commit, state }, { namespace, projectId, force
...
@@ -13,8 +13,7 @@ export const getProjectData = ({ commit, state }, { namespace, projectId, force
.
then
(
data
=>
{
.
then
(
data
=>
{
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
state
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
state
});
commit
(
types
.
SET_PROJECT
,
{
projectPath
:
`
${
namespace
}
/
${
projectId
}
`
,
project
:
data
});
commit
(
types
.
SET_PROJECT
,
{
projectPath
:
`
${
namespace
}
/
${
projectId
}
`
,
project
:
data
});
if
(
!
state
.
currentProjectId
)
commit
(
types
.
SET_CURRENT_PROJECT
,
`
${
namespace
}
/
${
projectId
}
`
);
commit
(
types
.
SET_CURRENT_PROJECT
,
`
${
namespace
}
/
${
projectId
}
`
);
resolve
(
data
);
resolve
(
data
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
...
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
View file @
ce2bc5c0
import
{
__
}
from
'
../../../../locale
'
;
import
{
__
}
from
'
../../../../locale
'
;
import
Api
from
'
../../../../api
'
;
import
Api
from
'
../../../../api
'
;
import
flash
from
'
../../../../flash
'
;
import
flash
from
'
../../../../flash
'
;
import
router
from
'
../../../ide_router
'
;
import
{
scopes
}
from
'
./constants
'
;
import
{
scopes
}
from
'
./constants
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
rootTypes
from
'
../../mutation_types
'
;
export
const
requestMergeRequests
=
({
commit
},
type
)
=>
export
const
requestMergeRequests
=
({
commit
},
type
)
=>
commit
(
types
.
REQUEST_MERGE_REQUESTS
,
type
);
commit
(
types
.
REQUEST_MERGE_REQUESTS
,
type
);
...
@@ -25,4 +27,17 @@ export const fetchMergeRequests = ({ dispatch, state: { state } }, { type, searc
...
@@ -25,4 +27,17 @@ export const fetchMergeRequests = ({ dispatch, state: { state } }, { type, searc
export
const
resetMergeRequests
=
({
commit
},
type
)
=>
commit
(
types
.
RESET_MERGE_REQUESTS
,
type
);
export
const
resetMergeRequests
=
({
commit
},
type
)
=>
commit
(
types
.
RESET_MERGE_REQUESTS
,
type
);
export
const
openMergeRequest
=
({
commit
,
dispatch
},
{
projectPath
,
id
})
=>
{
commit
(
rootTypes
.
CLEAR_PROJECTS
,
null
,
{
root
:
true
});
commit
(
rootTypes
.
SET_CURRENT_MERGE_REQUEST
,
`
${
id
}
`
,
{
root
:
true
});
commit
(
rootTypes
.
RESET_OPEN_FILES
,
null
,
{
root
:
true
});
dispatch
(
'
pipelines/stopPipelinePolling
'
,
null
,
{
root
:
true
});
dispatch
(
'
pipelines/clearEtagPoll
'
,
null
,
{
root
:
true
});
dispatch
(
'
pipelines/resetLatestPipeline
'
,
null
,
{
root
:
true
});
return
dispatch
(
'
setCurrentBranchId
'
,
''
,
{
root
:
true
}).
then
(()
=>
router
.
push
(
`/project/
${
projectPath
}
/merge_requests/
${
id
}
`
),
);
};
export
default
()
=>
{};
export
default
()
=>
{};
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
View file @
ce2bc5c0
...
@@ -102,4 +102,7 @@ export const fetchJobTrace = ({ dispatch, state }) => {
...
@@ -102,4 +102,7 @@ export const fetchJobTrace = ({ dispatch, state }) => {
.
catch
(()
=>
dispatch
(
'
receiveJobTraceError
'
));
.
catch
(()
=>
dispatch
(
'
receiveJobTraceError
'
));
};
};
export
const
resetLatestPipeline
=
({
commit
})
=>
commit
(
types
.
RECEIVE_LASTEST_PIPELINE_SUCCESS
,
null
);
export
default
()
=>
{};
export
default
()
=>
{};
app/assets/javascripts/ide/stores/mutation_types.js
View file @
ce2bc5c0
...
@@ -68,3 +68,6 @@ export const TOGGLE_FILE_FINDER = 'TOGGLE_FILE_FINDER';
...
@@ -68,3 +68,6 @@ export const TOGGLE_FILE_FINDER = 'TOGGLE_FILE_FINDER';
export
const
BURST_UNUSED_SEAL
=
'
BURST_UNUSED_SEAL
'
;
export
const
BURST_UNUSED_SEAL
=
'
BURST_UNUSED_SEAL
'
;
export
const
SET_RIGHT_PANE
=
'
SET_RIGHT_PANE
'
;
export
const
SET_RIGHT_PANE
=
'
SET_RIGHT_PANE
'
;
export
const
CLEAR_PROJECTS
=
'
CLEAR_PROJECTS
'
;
export
const
RESET_OPEN_FILES
=
'
RESET_OPEN_FILES
'
;
app/assets/javascripts/ide/stores/mutations.js
View file @
ce2bc5c0
...
@@ -157,6 +157,12 @@ export default {
...
@@ -157,6 +157,12 @@ export default {
[
types
.
SET_LINKS
](
state
,
links
)
{
[
types
.
SET_LINKS
](
state
,
links
)
{
Object
.
assign
(
state
,
{
links
});
Object
.
assign
(
state
,
{
links
});
},
},
[
types
.
CLEAR_PROJECTS
](
state
)
{
Object
.
assign
(
state
,
{
projects
:
{},
trees
:
{}
});
},
[
types
.
RESET_OPEN_FILES
](
state
)
{
Object
.
assign
(
state
,
{
openFiles
:
[]
});
},
...
projectMutations
,
...
projectMutations
,
...
mergeRequestMutation
,
...
mergeRequestMutation
,
...
fileMutations
,
...
fileMutations
,
...
...
app/assets/javascripts/vue_shared/components/tabs/tabs.js
View file @
ce2bc5c0
...
@@ -23,6 +23,7 @@ export default {
...
@@ -23,6 +23,7 @@ export default {
setTab
(
e
,
index
)
{
setTab
(
e
,
index
)
{
if
(
this
.
stopPropagation
)
{
if
(
this
.
stopPropagation
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
e
.
preventDefault
();
}
}
this
.
tabs
[
this
.
currentIndex
].
localActive
=
false
;
this
.
tabs
[
this
.
currentIndex
].
localActive
=
false
;
...
...
app/assets/stylesheets/framework/contextual_sidebar.scss
View file @
ce2bc5c0
...
@@ -33,12 +33,12 @@
...
@@ -33,12 +33,12 @@
align-items
:
center
;
align-items
:
center
;
padding
:
10px
16px
10px
10px
;
padding
:
10px
16px
10px
10px
;
color
:
$gl-text-color
;
color
:
$gl-text-color
;
}
&
:hover
,
&
:hover
,
a
:hover
{
a
:hover
{
background-color
:
$link-hover-background
;
background-color
:
$link-hover-background
;
color
:
$gl-text-color
;
color
:
$gl-text-color
;
}
}
}
.avatar-container
{
.avatar-container
{
...
...
app/assets/stylesheets/pages/repo.scss
View file @
ce2bc5c0
...
@@ -1143,6 +1143,10 @@
...
@@ -1143,6 +1143,10 @@
.sidebar-context-title
{
.sidebar-context-title
{
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
.ide-sidebar-branch-title
{
min-width
:
50px
;
}
}
}
.ide-external-link
{
.ide-external-link
{
...
...
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