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
Boxiang Sun
gitlab-ce
Commits
69b7c032
Commit
69b7c032
authored
Oct 10, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettify ide modules
parent
550f5574
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
93 additions
and
128 deletions
+93
-128
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
...ascripts/ide/components/commit_sidebar/list_collapsed.vue
+9
-5
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
...avascripts/ide/components/commit_sidebar/stage_button.vue
+1
-4
app/assets/javascripts/ide/components/ide_side_bar.vue
app/assets/javascripts/ide/components/ide_side_bar.vue
+1
-7
app/assets/javascripts/ide/components/merge_requests/list.vue
...assets/javascripts/ide/components/merge_requests/list.vue
+2
-6
app/assets/javascripts/ide/components/nav_dropdown_button.vue
...assets/javascripts/ide/components/nav_dropdown_button.vue
+1
-3
app/assets/javascripts/ide/components/panes/right.vue
app/assets/javascripts/ide/components/panes/right.vue
+4
-13
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+1
-6
app/assets/javascripts/ide/components/shared/tokened_input.vue
...ssets/javascripts/ide/components/shared/tokened_input.vue
+1
-3
app/assets/javascripts/ide/index.js
app/assets/javascripts/ide/index.js
+1
-4
app/assets/javascripts/ide/lib/diff/diff.js
app/assets/javascripts/ide/lib/diff/diff.js
+8
-6
app/assets/javascripts/ide/lib/diff/diff_worker.js
app/assets/javascripts/ide/lib/diff/diff_worker.js
+1
-1
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+47
-47
app/assets/javascripts/ide/stores/actions/project.js
app/assets/javascripts/ide/stores/actions/project.js
+15
-21
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
.../javascripts/ide/stores/modules/merge_requests/actions.js
+1
-2
No files found.
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
View file @
69b7c032
...
@@ -38,14 +38,18 @@ export default {
...
@@ -38,14 +38,18 @@ export default {
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
},
},
additionsTooltip
()
{
additionsTooltip
()
{
return
sprintf
(
n__
(
'
1 %{type} addition
'
,
'
%{count} %{type} additions
'
,
this
.
addedFilesLength
),
{
return
sprintf
(
type
:
this
.
title
.
toLowerCase
(),
n__
(
'
1 %{type} addition
'
,
'
%{count} %{type} additions
'
,
this
.
addedFilesLength
),
count
:
this
.
addedFilesLength
,
{
});
type
:
this
.
title
.
toLowerCase
(),
count
:
this
.
addedFilesLength
,
},
);
},
},
modifiedTooltip
()
{
modifiedTooltip
()
{
return
sprintf
(
return
sprintf
(
n__
(
'
1 %{type} modification
'
,
'
%{count} %{type} modifications
'
,
this
.
modifiedFilesLength
),
{
n__
(
'
1 %{type} modification
'
,
'
%{count} %{type} modifications
'
,
this
.
modifiedFilesLength
),
{
type
:
this
.
title
.
toLowerCase
(),
type
:
this
.
title
.
toLowerCase
(),
count
:
this
.
modifiedFilesLength
,
count
:
this
.
modifiedFilesLength
,
},
},
...
...
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
View file @
69b7c032
...
@@ -25,10 +25,7 @@ export default {
...
@@ -25,10 +25,7 @@ export default {
return
`discard-file-
${
this
.
path
}
`
;
return
`discard-file-
${
this
.
path
}
`
;
},
},
modalTitle
()
{
modalTitle
()
{
return
sprintf
(
return
sprintf
(
__
(
'
Discard changes to %{path}?
'
),
{
path
:
this
.
path
});
__
(
'
Discard changes to %{path}?
'
),
{
path
:
this
.
path
},
);
},
},
},
},
methods
:
{
methods
:
{
...
...
app/assets/javascripts/ide/components/ide_side_bar.vue
View file @
69b7c032
...
@@ -24,13 +24,7 @@ export default {
...
@@ -24,13 +24,7 @@ export default {
IdeProjectHeader
,
IdeProjectHeader
,
},
},
computed
:
{
computed
:
{
...
mapState
([
...
mapState
([
'
loading
'
,
'
currentActivityView
'
,
'
changedFiles
'
,
'
stagedFiles
'
,
'
lastCommitMsg
'
]),
'
loading
'
,
'
currentActivityView
'
,
'
changedFiles
'
,
'
stagedFiles
'
,
'
lastCommitMsg
'
,
]),
...
mapGetters
([
'
currentProject
'
,
'
someUncommitedChanges
'
]),
...
mapGetters
([
'
currentProject
'
,
'
someUncommitedChanges
'
]),
showSuccessMessage
()
{
showSuccessMessage
()
{
return
(
return
(
...
...
app/assets/javascripts/ide/components/merge_requests/list.vue
View file @
69b7c032
...
@@ -37,14 +37,10 @@ export default {
...
@@ -37,14 +37,10 @@ export default {
return
this
.
hasSearchFocus
&&
!
this
.
search
&&
!
this
.
currentSearchType
;
return
this
.
hasSearchFocus
&&
!
this
.
search
&&
!
this
.
currentSearchType
;
},
},
type
()
{
type
()
{
return
this
.
currentSearchType
return
this
.
currentSearchType
?
this
.
currentSearchType
.
type
:
''
;
?
this
.
currentSearchType
.
type
:
''
;
},
},
searchTokens
()
{
searchTokens
()
{
return
this
.
currentSearchType
return
this
.
currentSearchType
?
[
this
.
currentSearchType
]
:
[];
?
[
this
.
currentSearchType
]
:
[];
},
},
},
},
watch
:
{
watch
:
{
...
...
app/assets/javascripts/ide/components/nav_dropdown_button.vue
View file @
69b7c032
...
@@ -13,9 +13,7 @@ export default {
...
@@ -13,9 +13,7 @@ export default {
computed
:
{
computed
:
{
...
mapState
([
'
currentBranchId
'
,
'
currentMergeRequestId
'
]),
...
mapState
([
'
currentBranchId
'
,
'
currentMergeRequestId
'
]),
mergeRequestLabel
()
{
mergeRequestLabel
()
{
return
this
.
currentMergeRequestId
return
this
.
currentMergeRequestId
?
`!
${
this
.
currentMergeRequestId
}
`
:
EMPTY_LABEL
;
?
`!
${
this
.
currentMergeRequestId
}
`
:
EMPTY_LABEL
;
},
},
branchLabel
()
{
branchLabel
()
{
return
this
.
currentBranchId
||
EMPTY_LABEL
;
return
this
.
currentBranchId
||
EMPTY_LABEL
;
...
...
app/assets/javascripts/ide/components/panes/right.vue
View file @
69b7c032
...
@@ -43,34 +43,25 @@ export default {
...
@@ -43,34 +43,25 @@ export default {
{
{
show
:
this
.
currentMergeRequestId
,
show
:
this
.
currentMergeRequestId
,
title
:
__
(
'
Merge Request
'
),
title
:
__
(
'
Merge Request
'
),
views
:
[
views
:
[
rightSidebarViews
.
mergeRequestInfo
],
rightSidebarViews
.
mergeRequestInfo
,
],
icon
:
'
text-description
'
,
icon
:
'
text-description
'
,
},
},
{
{
show
:
true
,
show
:
true
,
title
:
__
(
'
Pipelines
'
),
title
:
__
(
'
Pipelines
'
),
views
:
[
views
:
[
rightSidebarViews
.
pipelines
,
rightSidebarViews
.
jobsDetail
],
rightSidebarViews
.
pipelines
,
rightSidebarViews
.
jobsDetail
,
],
icon
:
'
rocket
'
,
icon
:
'
rocket
'
,
},
},
{
{
show
:
this
.
showLivePreview
,
show
:
this
.
showLivePreview
,
title
:
__
(
'
Live preview
'
),
title
:
__
(
'
Live preview
'
),
views
:
[
views
:
[
rightSidebarViews
.
clientSidePreview
],
rightSidebarViews
.
clientSidePreview
,
],
icon
:
'
live-preview
'
,
icon
:
'
live-preview
'
,
},
},
];
];
},
},
tabs
()
{
tabs
()
{
return
this
.
defaultTabs
return
this
.
defaultTabs
.
concat
(
this
.
extensionTabs
).
filter
(
tab
=>
tab
.
show
);
.
concat
(
this
.
extensionTabs
)
.
filter
(
tab
=>
tab
.
show
);
},
},
tabViews
()
{
tabViews
()
{
return
_
.
flatten
(
this
.
tabs
.
map
(
tab
=>
tab
.
views
));
return
_
.
flatten
(
this
.
tabs
.
map
(
tab
=>
tab
.
views
));
...
...
app/assets/javascripts/ide/components/repo_editor.vue
View file @
69b7c032
...
@@ -25,12 +25,7 @@ export default {
...
@@ -25,12 +25,7 @@ export default {
...
mapState
(
'
rightPane
'
,
{
...
mapState
(
'
rightPane
'
,
{
rightPaneIsOpen
:
'
isOpen
'
,
rightPaneIsOpen
:
'
isOpen
'
,
}),
}),
...
mapState
([
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
,
'
currentActivityView
'
]),
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
,
'
currentActivityView
'
,
]),
...
mapGetters
([
...
mapGetters
([
'
currentMergeRequest
'
,
'
currentMergeRequest
'
,
'
getStagedFile
'
,
'
getStagedFile
'
,
...
...
app/assets/javascripts/ide/components/shared/tokened_input.vue
View file @
69b7c032
...
@@ -30,9 +30,7 @@ export default {
...
@@ -30,9 +30,7 @@ export default {
},
},
computed
:
{
computed
:
{
placeholderText
()
{
placeholderText
()
{
return
this
.
tokens
.
length
return
this
.
tokens
.
length
?
''
:
this
.
placeholder
;
?
''
:
this
.
placeholder
;
},
},
},
},
watch
:
{
watch
:
{
...
...
app/assets/javascripts/ide/index.js
View file @
69b7c032
...
@@ -21,10 +21,7 @@ Vue.use(Translate);
...
@@ -21,10 +21,7 @@ Vue.use(Translate);
export
function
initIde
(
el
,
options
=
{})
{
export
function
initIde
(
el
,
options
=
{})
{
if
(
!
el
)
return
null
;
if
(
!
el
)
return
null
;
const
{
const
{
extraInitialData
=
()
=>
({}),
rootComponent
=
ide
}
=
options
;
extraInitialData
=
()
=>
({}),
rootComponent
=
ide
,
}
=
options
;
return
new
Vue
({
return
new
Vue
({
el
,
el
,
...
...
app/assets/javascripts/ide/lib/diff/diff.js
View file @
69b7c032
...
@@ -11,14 +11,16 @@ export const computeDiff = (originalContent, newContent) => {
...
@@ -11,14 +11,16 @@ export const computeDiff = (originalContent, newContent) => {
if
(
findOnLine
)
{
if
(
findOnLine
)
{
Object
.
assign
(
findOnLine
,
change
,
{
Object
.
assign
(
findOnLine
,
change
,
{
modified
:
true
,
modified
:
true
,
endLineNumber
:
(
lineNumber
+
change
.
count
)
-
1
,
endLineNumber
:
lineNumber
+
change
.
count
-
1
,
});
});
}
else
if
(
'
added
'
in
change
||
'
removed
'
in
change
)
{
}
else
if
(
'
added
'
in
change
||
'
removed
'
in
change
)
{
acc
.
push
(
Object
.
assign
({},
change
,
{
acc
.
push
(
lineNumber
,
Object
.
assign
({},
change
,
{
modified
:
undefined
,
lineNumber
,
endLineNumber
:
(
lineNumber
+
change
.
count
)
-
1
,
modified
:
undefined
,
}));
endLineNumber
:
lineNumber
+
change
.
count
-
1
,
}),
);
}
}
if
(
!
change
.
removed
)
{
if
(
!
change
.
removed
)
{
...
...
app/assets/javascripts/ide/lib/diff/diff_worker.js
View file @
69b7c032
import
{
computeDiff
}
from
'
./diff
'
;
import
{
computeDiff
}
from
'
./diff
'
;
// eslint-disable-next-line no-restricted-globals
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
self
.
addEventListener
(
'
message
'
,
e
=>
{
const
{
data
}
=
e
;
const
{
data
}
=
e
;
// eslint-disable-next-line no-restricted-globals
// eslint-disable-next-line no-restricted-globals
...
...
app/assets/javascripts/ide/stores/actions/merge_request.js
View file @
69b7c032
...
@@ -116,57 +116,57 @@ export const openMergeRequest = (
...
@@ -116,57 +116,57 @@ export const openMergeRequest = (
targetProjectId
,
targetProjectId
,
mergeRequestId
,
mergeRequestId
,
})
})
.
then
(
mr
=>
{
.
then
(
mr
=>
{
dispatch
(
'
setCurrentBranchId
'
,
mr
.
source_branch
);
dispatch
(
'
setCurrentBranchId
'
,
mr
.
source_branch
);
dispatch
(
'
getBranchData
'
,
{
dispatch
(
'
getBranchData
'
,
{
projectId
,
projectId
,
branchId
:
mr
.
source_branch
,
branchId
:
mr
.
source_branch
,
});
});
return
dispatch
(
'
getFiles
'
,
{
return
dispatch
(
'
getFiles
'
,
{
projectId
,
projectId
,
branchId
:
mr
.
source_branch
,
branchId
:
mr
.
source_branch
,
});
});
})
})
.
then
(()
=>
.
then
(()
=>
dispatch
(
'
getMergeRequestVersions
'
,
{
dispatch
(
'
getMergeRequestVersions
'
,
{
projectId
,
projectId
,
targetProjectId
,
targetProjectId
,
mergeRequestId
,
mergeRequestId
,
}),
}),
)
)
.
then
(()
=>
.
then
(()
=>
dispatch
(
'
getMergeRequestChanges
'
,
{
dispatch
(
'
getMergeRequestChanges
'
,
{
projectId
,
projectId
,
targetProjectId
,
targetProjectId
,
mergeRequestId
,
mergeRequestId
,
}),
}),
)
)
.
then
(
mrChanges
=>
{
.
then
(
mrChanges
=>
{
if
(
mrChanges
.
changes
.
length
)
{
if
(
mrChanges
.
changes
.
length
)
{
dispatch
(
'
updateActivityBarView
'
,
activityBarViews
.
review
);
dispatch
(
'
updateActivityBarView
'
,
activityBarViews
.
review
);
}
}
mrChanges
.
changes
.
forEach
((
change
,
ind
)
=>
{
mrChanges
.
changes
.
forEach
((
change
,
ind
)
=>
{
const
changeTreeEntry
=
state
.
entries
[
change
.
new_path
];
const
changeTreeEntry
=
state
.
entries
[
change
.
new_path
];
if
(
changeTreeEntry
)
{
if
(
changeTreeEntry
)
{
dispatch
(
'
setFileMrChange
'
,
{
dispatch
(
'
setFileMrChange
'
,
{
file
:
changeTreeEntry
,
file
:
changeTreeEntry
,
mrChange
:
change
,
mrChange
:
change
,
});
if
(
ind
<
10
)
{
dispatch
(
'
getFileData
'
,
{
path
:
change
.
new_path
,
makeFileActive
:
ind
===
0
,
});
});
if
(
ind
<
10
)
{
dispatch
(
'
getFileData
'
,
{
path
:
change
.
new_path
,
makeFileActive
:
ind
===
0
,
});
}
}
}
}
});
})
.
catch
(
e
=>
{
flash
(
__
(
'
Error while loading the merge request. Please try again.
'
));
throw
e
;
});
});
})
.
catch
(
e
=>
{
flash
(
__
(
'
Error while loading the merge request. Please try again.
'
));
throw
e
;
});
app/assets/javascripts/ide/stores/actions/project.js
View file @
69b7c032
...
@@ -125,10 +125,7 @@ export const showBranchNotFoundError = ({ dispatch }, branchId) => {
...
@@ -125,10 +125,7 @@ export const showBranchNotFoundError = ({ dispatch }, branchId) => {
});
});
};
};
export
const
openBranch
=
(
export
const
openBranch
=
({
dispatch
,
state
},
{
projectId
,
branchId
,
basePath
})
=>
{
{
dispatch
,
state
},
{
projectId
,
branchId
,
basePath
},
)
=>
{
dispatch
(
'
setCurrentBranchId
'
,
branchId
);
dispatch
(
'
setCurrentBranchId
'
,
branchId
);
dispatch
(
'
getBranchData
'
,
{
dispatch
(
'
getBranchData
'
,
{
...
@@ -136,23 +133,20 @@ export const openBranch = (
...
@@ -136,23 +133,20 @@ export const openBranch = (
branchId
,
branchId
,
});
});
return
(
return
dispatch
(
'
getFiles
'
,
{
dispatch
(
'
getFiles
'
,
{
projectId
,
projectId
,
branchId
,
branchId
,
}).
then
(()
=>
{
})
if
(
basePath
)
{
.
then
(()
=>
{
const
path
=
basePath
.
slice
(
-
1
)
===
'
/
'
?
basePath
.
slice
(
0
,
-
1
)
:
basePath
;
if
(
basePath
)
{
const
treeEntryKey
=
Object
.
keys
(
state
.
entries
).
find
(
const
path
=
basePath
.
slice
(
-
1
)
===
'
/
'
?
basePath
.
slice
(
0
,
-
1
)
:
basePath
;
key
=>
key
===
path
&&
!
state
.
entries
[
key
].
pending
,
const
treeEntryKey
=
Object
.
keys
(
state
.
entries
).
find
(
);
key
=>
key
===
path
&&
!
state
.
entries
[
key
].
pending
,
const
treeEntry
=
state
.
entries
[
treeEntryKey
];
);
const
treeEntry
=
state
.
entries
[
treeEntryKey
];
if
(
treeEntry
)
{
if
(
treeEntry
)
{
dispatch
(
'
handleTreeEntryAction
'
,
treeEntry
);
dispatch
(
'
handleTreeEntryAction
'
,
treeEntry
);
}
}
}
}
)
}
);
}
);
};
};
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
View file @
69b7c032
...
@@ -3,8 +3,7 @@ import Api from '../../../../api';
...
@@ -3,8 +3,7 @@ import Api from '../../../../api';
import
{
scopes
}
from
'
./constants
'
;
import
{
scopes
}
from
'
./constants
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
const
requestMergeRequests
=
({
commit
})
=>
export
const
requestMergeRequests
=
({
commit
})
=>
commit
(
types
.
REQUEST_MERGE_REQUESTS
);
commit
(
types
.
REQUEST_MERGE_REQUESTS
);
export
const
receiveMergeRequestsError
=
({
commit
,
dispatch
},
{
type
,
search
})
=>
{
export
const
receiveMergeRequestsError
=
({
commit
,
dispatch
},
{
type
,
search
})
=>
{
dispatch
(
dispatch
(
'
setErrorMessage
'
,
'
setErrorMessage
'
,
...
...
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