Commit fffa5640 authored by Phil Hughes's avatar Phil Hughes

fixed closing last file not opening the next available file

fixed right sidebar not being collapsible
parent 816b4202
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
.ide-new-btn { .ide-new-btn {
display: none; display: none;
margin-top: -4px;
margin-bottom: -4px; margin-bottom: -4px;
margin-right: -8px; margin-right: -8px;
} }
...@@ -84,7 +83,6 @@ ...@@ -84,7 +83,6 @@
fill: $gl-text-color-secondary; fill: $gl-text-color-secondary;
} }
} }
} }
a { a {
...@@ -290,7 +288,7 @@ ...@@ -290,7 +288,7 @@
.margin-view-overlays .insert-sign, .margin-view-overlays .insert-sign,
.margin-view-overlays .delete-sign { .margin-view-overlays .delete-sign {
opacity: .4; opacity: 0.4;
} }
} }
} }
...@@ -548,7 +546,6 @@ ...@@ -548,7 +546,6 @@
height: 10px; height: 10px;
margin-left: 3px; margin-left: 3px;
} }
} }
.multi-file-commit-list-path { .multi-file-commit-list-path {
...@@ -626,7 +623,7 @@ ...@@ -626,7 +623,7 @@
top: 0; top: 0;
width: 100px; width: 100px;
height: 1px; height: 1px;
background-color: rgba($red-500, .5); background-color: rgba($red-500, 0.5);
} }
} }
} }
...@@ -697,8 +694,12 @@ ...@@ -697,8 +694,12 @@
} }
.multi-file-commit-panel .multi-file-commit-panel-inner-scroll { .multi-file-commit-panel .multi-file-commit-panel-inner-scroll {
max-height: calc(100vh - #{$header-height + $flash-height + $context-header-height}); max-height: calc(
min-height: calc(100vh - #{$header-height + $flash-height + $context-header-height}); 100vh - #{$header-height + $flash-height + $context-header-height}
);
min-height: calc(
100vh - #{$header-height + $flash-height + $context-header-height}
);
} }
} }
} }
...@@ -729,17 +730,24 @@ ...@@ -729,17 +730,24 @@
} }
.ide-view { .ide-view {
height: calc(100vh - #{$header-height + $performance-bar-height + $flash-height}); height: calc(
100vh - #{$header-height + $performance-bar-height + $flash-height}
);
} }
.multi-file-commit-panel .multi-file-commit-panel-inner-scroll { .multi-file-commit-panel .multi-file-commit-panel-inner-scroll {
max-height: calc(100vh - #{$header-height + $performance-bar-height + $flash-height + $context-header-height}); max-height: calc(
min-height: calc(100vh - #{$header-height + $performance-bar-height + $flash-height + $context-header-height}); 100vh - #{$header-height + $performance-bar-height + $flash-height +
$context-header-height}
);
min-height: calc(
100vh - #{$header-height + $performance-bar-height + $flash-height +
$context-header-height}
);
} }
} }
} }
.dragHandle { .dragHandle {
position: absolute; position: absolute;
top: 0; top: 0;
......
<script> <script>
import { mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import icon from '~/vue_shared/components/icon.vue'; import icon from '~/vue_shared/components/icon.vue';
import panelResizer from '~/vue_shared/components/panel_resizer.vue'; import panelResizer from '~/vue_shared/components/panel_resizer.vue';
import repoCommitSection from './repo_commit_section.vue'; import repoCommitSection from './repo_commit_section.vue';
import ResizablePanel from './resizable_panel.vue'; import ResizablePanel from './resizable_panel.vue';
export default { export default {
components: { components: {
repoCommitSection, repoCommitSection,
icon, icon,
panelResizer, panelResizer,
ResizablePanel, ResizablePanel,
},
props: {
noChangesStateSvgPath: {
type: String,
required: true,
}, },
props: { committedStateSvgPath: {
noChangesStateSvgPath: { type: String,
type: String, required: true,
required: true,
},
committedStateSvgPath: {
type: String,
required: true,
},
}, },
computed: { },
...mapState([ computed: {
'changedFiles', ...mapState(['changedFiles', 'rightPanelCollapsed']),
'rightPanelCollapsed', ...mapGetters(['currentIcon']),
]), },
...mapGetters([ methods: {
'currentIcon', ...mapActions(['setPanelCollapsedStatus']),
]), },
}, };
};
</script> </script>
<template> <template>
...@@ -66,7 +64,10 @@ ...@@ -66,7 +64,10 @@
<button <button
type="button" type="button"
class="btn btn-transparent multi-file-commit-panel-collapse-btn" class="btn btn-transparent multi-file-commit-panel-collapse-btn"
@click.stop="toggleCollapsed" @click.stop="setPanelCollapsedStatus({
side: 'right',
collapsed: !rightPanelCollapsed,
})"
> >
<icon <icon
:name="currentIcon" :name="currentIcon"
......
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import skeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue'; import skeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue';
import fileIcon from '~/vue_shared/components/file_icon.vue'; import fileIcon from '~/vue_shared/components/file_icon.vue';
import router from '../ide_router'; import router from '../ide_router';
import newDropdown from './new_dropdown/index.vue'; import newDropdown from './new_dropdown/index.vue';
import fileStatusIcon from './repo_file_status_icon.vue'; import fileStatusIcon from './repo_file_status_icon.vue';
import changedFileIcon from './changed_file_icon.vue'; import changedFileIcon from './changed_file_icon.vue';
export default { export default {
name: 'RepoFile', name: 'RepoFile',
components: { components: {
skeletonLoadingContainer, skeletonLoadingContainer,
newDropdown, newDropdown,
fileStatusIcon, fileStatusIcon,
fileIcon, fileIcon,
changedFileIcon, changedFileIcon,
},
props: {
file: {
type: Object,
required: true,
}, },
props: { level: {
file: { type: Number,
type: Object, required: true,
required: true,
},
level: {
type: Number,
required: true,
},
}, },
computed: { },
isTree() { computed: {
return this.file.type === 'tree'; isTree() {
}, return this.file.type === 'tree';
isBlob() {
return this.file.type === 'blob';
},
levelIndentation() {
return {
marginLeft: `${this.level * 16}px`,
};
},
fileClass() {
return {
'file-open': this.isBlob && this.file.opened,
'file-active': this.isBlob && this.file.active,
folder: this.isTree,
};
},
}, },
updated() { isBlob() {
if (this.file.type === 'blob' && this.file.active) { return this.file.type === 'blob';
this.$el.scrollIntoView(); },
} levelIndentation() {
return {
marginLeft: `${this.level * 16}px`,
};
},
fileClass() {
return {
'file-open': this.isBlob && this.file.opened,
'file-active': this.isBlob && this.file.active,
folder: this.isTree,
};
}, },
methods: { },
...mapActions(['toggleTreeOpen', 'updateDelayViewerUpdated']), updated() {
clickFile() { if (this.file.type === 'blob' && this.file.active) {
// Manual Action if a tree is selected/opened this.$el.scrollIntoView();
if ( }
this.isTree && },
this.$router.currentRoute.path === `/project${this.file.url}` methods: {
) { ...mapActions(['toggleTreeOpen', 'updateDelayViewerUpdated']),
this.toggleTreeOpen(this.file.path); clickFile() {
} // Manual Action if a tree is selected/opened
if (
this.isTree &&
this.$router.currentRoute.path === `/project${this.file.url}`
) {
this.toggleTreeOpen(this.file.path);
}
const delayPromise = this.file.changed const delayPromise = this.file.changed
? Promise.resolve() ? Promise.resolve()
: this.updateDelayViewerUpdated(true); : this.updateDelayViewerUpdated(true);
return delayPromise.then(() => { return delayPromise.then(() => {
router.push(`/project${this.file.url}`); router.push(`/project${this.file.url}`);
}); });
},
}, },
}; },
};
</script> </script>
<template> <template>
...@@ -101,16 +101,17 @@ ...@@ -101,16 +101,17 @@
:file="file" :file="file"
/> />
</span> </span>
<changed-file-icon
:file="file"
v-if="file.changed || file.tempFile"
class="prepend-top-5 pull-right"
/>
<new-dropdown <new-dropdown
v-if="isTree" v-if="isTree"
:project-id="file.projectId" :project-id="file.projectId"
:branch="file.branchId" :branch="file.branchId"
:path="file.path" :path="file.path"
/> class="pull-right prepend-left-8"
<changed-file-icon
:file="file"
v-if="file.changed || file.tempFile"
class="prepend-top-5"
/> />
</div> </div>
</div> </div>
......
...@@ -7,7 +7,7 @@ import router from '../../ide_router'; ...@@ -7,7 +7,7 @@ import router from '../../ide_router';
import { setPageTitle } from '../utils'; import { setPageTitle } from '../utils';
export const closeFile = ({ commit, state, getters, dispatch }, path) => { export const closeFile = ({ commit, state, getters, dispatch }, path) => {
const indexOfClosedFile = state.openFiles.indexOf(path); const indexOfClosedFile = state.openFiles.findIndex(f => f.path === path);
const file = state.entries[path]; const file = state.entries[path];
const fileWasActive = file.active; const fileWasActive = file.active;
...@@ -16,7 +16,7 @@ export const closeFile = ({ commit, state, getters, dispatch }, path) => { ...@@ -16,7 +16,7 @@ export const closeFile = ({ commit, state, getters, dispatch }, path) => {
if (state.openFiles.length > 0 && fileWasActive) { if (state.openFiles.length > 0 && fileWasActive) {
const nextIndexToOpen = indexOfClosedFile === 0 ? 0 : indexOfClosedFile - 1; const nextIndexToOpen = indexOfClosedFile === 0 ? 0 : indexOfClosedFile - 1;
const nextFileToOpen = state.entries[state.openFiles[nextIndexToOpen]]; const nextFileToOpen = state.entries[state.openFiles[nextIndexToOpen].path];
router.push(`/project${nextFileToOpen.url}`); router.push(`/project${nextFileToOpen.url}`);
} else if (!state.openFiles.length) { } else if (!state.openFiles.length) {
......
...@@ -137,6 +137,7 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) = ...@@ -137,6 +137,7 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
} }
dispatch('setLastCommitMessage', data); dispatch('setLastCommitMessage', data);
dispatch('updateCommitMessage', '');
if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH_MR) { if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH_MR) {
dispatch( dispatch(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment