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
3e2d0e1a
Commit
3e2d0e1a
authored
Mar 14, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed opening/changing/closing files
[ci skip]
parent
f6240a82
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
34 additions
and
65 deletions
+34
-65
ee/app/assets/javascripts/ide/components/ide.vue
ee/app/assets/javascripts/ide/components/ide.vue
+4
-4
ee/app/assets/javascripts/ide/components/ide_context_bar.vue
ee/app/assets/javascripts/ide/components/ide_context_bar.vue
+2
-4
ee/app/assets/javascripts/ide/components/ide_side_bar.vue
ee/app/assets/javascripts/ide/components/ide_side_bar.vue
+1
-1
ee/app/assets/javascripts/ide/components/repo_commit_section.vue
...assets/javascripts/ide/components/repo_commit_section.vue
+1
-3
ee/app/assets/javascripts/ide/components/repo_file.vue
ee/app/assets/javascripts/ide/components/repo_file.vue
+7
-8
ee/app/assets/javascripts/ide/components/repo_file_buttons.vue
...p/assets/javascripts/ide/components/repo_file_buttons.vue
+0
-2
ee/app/assets/javascripts/ide/components/repo_tabs.vue
ee/app/assets/javascripts/ide/components/repo_tabs.vue
+1
-7
ee/app/assets/javascripts/ide/stores/actions/file.js
ee/app/assets/javascripts/ide/stores/actions/file.js
+3
-3
ee/app/assets/javascripts/ide/stores/getters.js
ee/app/assets/javascripts/ide/stores/getters.js
+3
-6
ee/app/assets/javascripts/ide/stores/mutation_types.js
ee/app/assets/javascripts/ide/stores/mutation_types.js
+0
-1
ee/app/assets/javascripts/ide/stores/mutations.js
ee/app/assets/javascripts/ide/stores/mutations.js
+2
-9
ee/app/assets/javascripts/ide/stores/mutations/file.js
ee/app/assets/javascripts/ide/stores/mutations/file.js
+10
-4
ee/app/assets/javascripts/ide/stores/mutations/tree.js
ee/app/assets/javascripts/ide/stores/mutations/tree.js
+0
-5
spec/javascripts/ide/stores/mutations/tree_spec.js
spec/javascripts/ide/stores/mutations/tree_spec.js
+0
-8
No files found.
ee/app/assets/javascripts/ide/components/ide.vue
View file @
3e2d0e1a
...
...
@@ -31,13 +31,13 @@
},
},
computed
:
{
...
mapState
([
'
changedFiles
'
,
'
openFiles
'
,
]),
...
mapGetters
([
'
activeFile
'
,
]),
...
mapGetters
({
openFiles
:
'
openFilesMap
'
,
changedFiles
:
'
changedFilesMap
'
,
}),
},
mounted
()
{
const
returnValue
=
'
Are you sure you want to lose unsaved changes?
'
;
...
...
ee/app/assets/javascripts/ide/components/ide_context_bar.vue
View file @
3e2d0e1a
<
script
>
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
}
from
'
vuex
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
panelResizer
from
'
~/vue_shared/components/panel_resizer.vue
'
;
import
repoCommitSection
from
'
./repo_commit_section.vue
'
;
...
...
@@ -24,11 +24,9 @@
},
computed
:
{
...
mapState
([
'
changedFiles
'
,
'
rightPanelCollapsed
'
,
]),
...
mapGetters
({
changedFiles
:
'
changedFilesMap
'
,
}),
currentIcon
()
{
return
this
.
rightPanelCollapsed
?
'
angle-double-left
'
:
'
angle-double-right
'
;
},
...
...
ee/app/assets/javascripts/ide/components/ide_side_bar.vue
View file @
3e2d0e1a
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
}
from
'
vuex
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
panelResizer
from
'
~/vue_shared/components/panel_resizer.vue
'
;
import
skeletonLoadingContainer
from
'
~/vue_shared/components/skeleton_loading_container.vue
'
;
...
...
ee/app/assets/javascripts/ide/components/repo_commit_section.vue
View file @
3e2d0e1a
...
...
@@ -36,10 +36,8 @@ export default {
'
currentBranchId
'
,
'
rightPanelCollapsed
'
,
'
lastCommitMsg
'
,
'
changedFiles
'
,
]),
...
mapGetters
({
changedFiles
:
'
changedFilesMap
'
,
}),
...
mapState
(
'
commit
'
,
[
'
commitMessage
'
,
'
submitCommitLoading
'
,
...
...
ee/app/assets/javascripts/ide/components/repo_file.vue
View file @
3e2d0e1a
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
timeAgoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
skeletonLoadingContainer
from
'
~/vue_shared/components/skeleton_loading_container.vue
'
;
import
fileIcon
from
'
~/vue_shared/components/file_icon.vue
'
;
...
...
@@ -130,11 +128,12 @@
</
template
>
</div>
</div>
<repo-file
v-if=
"file.opened"
v-for=
"childFile in file.tree"
:key=
"childFile.key"
:file=
"childFile"
/>
<
template
v-if=
"file.opened"
>
<repo-file
v-for=
"childFile in file.tree"
:key=
"childFile.key"
:file=
"childFile"
/>
</
template
>
</div>
</template>
ee/app/assets/javascripts/ide/components/repo_file_buttons.vue
View file @
3e2d0e1a
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
export
default
{
props
:
{
file
:
{
...
...
ee/app/assets/javascripts/ide/components/repo_tabs.vue
View file @
3e2d0e1a
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
import
RepoTab
from
'
./repo_tab.vue
'
;
export
default
{
components
:
{
'
repo-tab
'
:
RepoTab
,
RepoTab
,
},
props
:
{
files
:
{
...
...
@@ -12,11 +11,6 @@
required
:
true
,
},
},
computed
:
{
...
mapGetters
([
'
openFilesMap
'
,
]),
},
};
</
script
>
...
...
ee/app/assets/javascripts/ide/stores/actions/file.js
View file @
3e2d0e1a
...
...
@@ -82,11 +82,11 @@ export const changeFileContent = ({ state, commit }, { path, content }) => {
const
file
=
state
.
entries
[
path
];
commit
(
types
.
UPDATE_FILE_CONTENT
,
{
path
,
content
});
const
indexOfChangedFile
=
state
.
changedFiles
.
indexOf
(
path
);
const
indexOfChangedFile
=
state
.
changedFiles
.
findIndex
(
f
=>
f
.
path
===
path
);
if
(
!
file
.
changed
&&
indexOfChangedFile
===
-
1
)
{
if
(
file
.
changed
&&
indexOfChangedFile
===
-
1
)
{
commit
(
types
.
ADD_FILE_TO_CHANGED
,
path
);
}
else
if
(
file
.
changed
&&
indexOfChangedFile
!==
-
1
)
{
}
else
if
(
!
file
.
changed
&&
indexOfChangedFile
!==
-
1
)
{
commit
(
types
.
REMOVE_FILE_FROM_CHANGED
,
path
);
}
};
...
...
ee/app/assets/javascripts/ide/stores/getters.js
View file @
3e2d0e1a
export
const
openFilesMap
=
state
=>
state
.
openFiles
.
map
(
path
=>
state
.
entries
[
path
]);
export
const
changedFilesMap
=
state
=>
state
.
changedFiles
.
map
(
path
=>
state
.
entries
[
path
]);
export
const
activeFile
=
state
=>
openFilesMap
(
state
).
find
(
file
=>
file
.
active
)
||
null
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
export
const
canEditFile
=
(
state
)
=>
{
const
currentActiveFile
=
activeFile
(
state
);
...
...
@@ -10,9 +7,9 @@ export const canEditFile = (state) => {
(
currentActiveFile
&&
!
currentActiveFile
.
renderError
&&
!
currentActiveFile
.
binary
);
};
export
const
addedFiles
=
state
=>
changedFilesMap
(
state
)
.
filter
(
f
=>
f
.
tempFile
);
export
const
addedFiles
=
state
=>
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
);
export
const
modifiedFiles
=
state
=>
changedFilesMap
(
state
)
.
filter
(
f
=>
!
f
.
tempFile
);
export
const
modifiedFiles
=
state
=>
state
.
changedFiles
.
filter
(
f
=>
!
f
.
tempFile
);
export
const
treeList
=
(
state
)
=>
{
const
tree
=
state
.
trees
[
`
${
state
.
currentProjectId
}
/master`
];
...
...
ee/app/assets/javascripts/ide/stores/mutation_types.js
View file @
3e2d0e1a
export
const
SET_INITIAL_DATA
=
'
SET_INITIAL_DATA
'
;
export
const
TOGGLE_LOADING
=
'
TOGGLE_LOADING
'
;
export
const
SET_PARENT_TREE_URL
=
'
SET_PARENT_TREE_URL
'
;
export
const
SET_LAST_COMMIT_DATA
=
'
SET_LAST_COMMIT_DATA
'
;
export
const
SET_LAST_COMMIT_MSG
=
'
SET_LAST_COMMIT_MSG
'
;
export
const
SET_LEFT_PANEL_COLLAPSED
=
'
SET_LEFT_PANEL_COLLAPSED
'
;
...
...
ee/app/assets/javascripts/ide/stores/mutations.js
View file @
3e2d0e1a
...
...
@@ -10,14 +10,8 @@ export default {
},
[
types
.
TOGGLE_LOADING
](
state
,
{
entry
,
forceValue
=
undefined
})
{
if
(
entry
.
path
)
{
Object
.
assign
(
state
,
{
entries
:
{
...
state
.
entries
,
[
entry
.
path
]:
{
...
state
.
entries
[
entry
.
path
],
loading
:
forceValue
!==
undefined
?
forceValue
:
!
state
.
entries
[
entry
.
path
].
loading
,
},
},
Object
.
assign
(
state
.
entries
[
entry
.
path
],
{
loading
:
forceValue
!==
undefined
?
forceValue
:
!
state
.
entries
[
entry
.
path
].
loading
,
});
}
else
{
Object
.
assign
(
entry
,
{
...
...
@@ -41,7 +35,6 @@ export default {
});
},
[
types
.
SET_LAST_COMMIT_DATA
](
state
,
{
entry
,
lastCommit
})
{
console
.
log
(
entry
);
Object
.
assign
(
entry
.
lastCommit
,
{
id
:
lastCommit
.
commit
.
id
,
url
:
lastCommit
.
commit_path
,
...
...
ee/app/assets/javascripts/ide/stores/mutations/file.js
View file @
3e2d0e1a
...
...
@@ -12,9 +12,11 @@ export default {
});
if
(
state
.
entries
[
path
].
opened
)
{
state
.
openFiles
.
push
(
path
);
state
.
openFiles
.
push
(
state
.
entries
[
path
]
);
}
else
{
state
.
openFiles
.
splice
(
state
.
openFiles
.
indexOf
(
path
),
1
);
Object
.
assign
(
state
,
{
openFiles
:
state
.
openFiles
.
filter
(
f
=>
f
.
path
!==
path
),
});
}
},
[
types
.
SET_FILE_DATA
](
state
,
{
data
,
file
})
{
...
...
@@ -67,10 +69,14 @@ export default {
parent
.
tree
.
push
(
file
);
},
[
types
.
ADD_FILE_TO_CHANGED
](
state
,
path
)
{
state
.
changedFiles
.
push
(
path
);
Object
.
assign
(
state
,
{
changedFiles
:
state
.
changedFiles
.
concat
(
state
.
entries
[
path
]),
});
},
[
types
.
REMOVE_FILE_FROM_CHANGED
](
state
,
path
)
{
state
.
changedFiles
.
splice
(
state
.
changedFiles
.
indexOf
(
path
),
1
);
Object
.
assign
(
state
,
{
changedFiles
:
state
.
changedFiles
.
filter
(
f
=>
f
.
path
!==
path
),
});
},
[
types
.
TOGGLE_FILE_CHANGED
](
state
,
{
file
,
changed
})
{
Object
.
assign
(
state
.
entries
[
file
.
path
],
{
...
...
ee/app/assets/javascripts/ide/stores/mutations/tree.js
View file @
3e2d0e1a
...
...
@@ -21,11 +21,6 @@ export default {
tree
:
data
,
});
},
[
types
.
SET_PARENT_TREE_URL
](
state
,
url
)
{
Object
.
assign
(
state
,
{
parentTreeUrl
:
url
,
});
},
[
types
.
SET_LAST_COMMIT_URL
](
state
,
{
tree
=
state
,
url
})
{
Object
.
assign
(
tree
,
{
lastCommitPath
:
url
,
...
...
spec/javascripts/ide/stores/mutations/tree_spec.js
View file @
3e2d0e1a
...
...
@@ -47,14 +47,6 @@ describe('Multi-file store tree mutations', () => {
});
});
describe
(
'
SET_PARENT_TREE_URL
'
,
()
=>
{
it
(
'
sets the parent tree url
'
,
()
=>
{
mutations
.
SET_PARENT_TREE_URL
(
localState
,
'
test
'
);
expect
(
localState
.
parentTreeUrl
).
toBe
(
'
test
'
);
});
});
describe
(
'
CREATE_TMP_TREE
'
,
()
=>
{
it
(
'
adds tree into parent tree
'
,
()
=>
{
const
tmpEntry
=
file
(
'
tmpTree
'
);
...
...
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