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
f0e1ee5f
Commit
f0e1ee5f
authored
Mar 25, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for Tests on file.js and tabs tests
parent
1814fc3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+20
-23
spec/javascripts/ide/components/repo_tabs_spec.js
spec/javascripts/ide/components/repo_tabs_spec.js
+1
-0
No files found.
app/assets/javascripts/ide/stores/actions/file.js
View file @
f0e1ee5f
...
@@ -48,29 +48,26 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
...
@@ -48,29 +48,26 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
export
const
getFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
makeFileActive
=
true
})
=>
{
export
const
getFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
makeFileActive
=
true
})
=>
{
const
file
=
state
.
entries
[
path
];
const
file
=
state
.
entries
[
path
];
return
new
Promise
((
resolve
,
reject
)
=>
{
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
return
service
service
.
getFileData
(
file
.
url
)
.
getFileData
(
file
.
url
)
.
then
(
res
=>
{
.
then
(
res
=>
{
const
pageTitle
=
decodeURI
(
normalizeHeaders
(
res
.
headers
)[
'
PAGE-TITLE
'
]);
const
pageTitle
=
decodeURI
(
normalizeHeaders
(
res
.
headers
)[
'
PAGE-TITLE
'
]);
setPageTitle
(
pageTitle
);
setPageTitle
(
pageTitle
);
return
res
.
json
();
return
res
.
json
();
})
})
.
then
(
data
=>
{
.
then
(
data
=>
{
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
commit
(
types
.
TOGGLE_FILE_OPEN
,
path
);
commit
(
types
.
TOGGLE_FILE_OPEN
,
path
);
if
(
makeFileActive
)
dispatch
(
'
setFileActive
'
,
file
.
path
);
if
(
makeFileActive
)
dispatch
(
'
setFileActive
'
,
file
.
path
);
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
})
})
.
catch
(()
=>
{
.
catch
(
err
=>
{
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
flash
(
'
Error loading file data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
);
flash
(
'
Error loading file data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
);
});
reject
(
err
);
});
});
};
};
export
const
setFileMrChange
=
({
state
,
commit
},
{
file
,
mrChange
})
=>
{
export
const
setFileMrChange
=
({
state
,
commit
},
{
file
,
mrChange
})
=>
{
...
...
spec/javascripts/ide/components/repo_tabs_spec.js
View file @
f0e1ee5f
...
@@ -17,6 +17,7 @@ describe('RepoTabs', () => {
...
@@ -17,6 +17,7 @@ describe('RepoTabs', () => {
files
:
openedFiles
,
files
:
openedFiles
,
viewer
:
'
editor
'
,
viewer
:
'
editor
'
,
hasChanges
:
false
,
hasChanges
:
false
,
hasMergeRequest
:
false
,
});
});
openedFiles
[
0
].
active
=
true
;
openedFiles
[
0
].
active
=
true
;
...
...
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