Commit 2a7bfacf authored by Phil Hughes's avatar Phil Hughes

improved success message after commit with new sidebar

parent 93f0eb07
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
/> />
</button> </button>
</li> </li>
<li v-show="hasChanges"> <li>
<button <button
type="button" type="button"
class="ide-sidebar-link js-ide-review-mode" class="ide-sidebar-link js-ide-review-mode"
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
/> />
</button> </button>
</li> </li>
<li> <li v-show="hasChanges">
<button <button
type="button" type="button"
class="ide-sidebar-link js-ide-commit-mode" class="ide-sidebar-link js-ide-commit-mode"
......
<script> <script>
import { mapGetters, mapState } from 'vuex'; import { mapState } from 'vuex';
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import * as consts from '../../stores/modules/commit/constants'; import * as consts from '../../stores/modules/commit/constants';
import RadioGroup from './radio_group.vue'; import RadioGroup from './radio_group.vue';
......
...@@ -21,13 +21,10 @@ export default { ...@@ -21,13 +21,10 @@ export default {
}; };
}, },
computed: { computed: {
...mapState(['lastCommitMsg', 'changedFiles', 'stagedFiles', 'currentActivityView']), ...mapState(['changedFiles', 'stagedFiles', 'currentActivityView', 'lastCommitMsg']),
...mapState('commit', ['commitMessage', 'submitCommitLoading']), ...mapState('commit', ['commitMessage', 'submitCommitLoading']),
...mapGetters(['hasChanges']), ...mapGetters(['hasChanges', 'someUncommitedChanges']),
...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled']), ...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled']),
someUncommitedChanges() {
return !!(this.changedFiles.length || this.stagedFiles.length);
},
overviewText() { overviewText() {
return sprintf( return sprintf(
__( __(
...@@ -126,8 +123,7 @@ export default { ...@@ -126,8 +123,7 @@ export default {
ref="formEl" ref="formEl"
> >
<success-message <success-message
v-if="lastCommitMsg && !someUncommitedChanges" v-show="(lastCommitMsg && someUncommitedChanges)"
:committed-state-svg-path="committedStateSvgPath"
/> />
<commit-message-field <commit-message-field
:text="commitMessage" :text="commitMessage"
......
...@@ -2,14 +2,8 @@ ...@@ -2,14 +2,8 @@
import { mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
props: {
committedStateSvgPath: {
type: String,
required: true,
},
},
computed: { computed: {
...mapState(['lastCommitMsg']), ...mapState(['lastCommitMsg', 'committedStateSvgPath']),
}, },
}; };
</script> </script>
......
...@@ -11,6 +11,8 @@ import ActivityBar from './activity_bar.vue'; ...@@ -11,6 +11,8 @@ import ActivityBar from './activity_bar.vue';
import CommitSection from './repo_commit_section.vue'; import CommitSection from './repo_commit_section.vue';
import CommitForm from './commit_sidebar/form.vue'; import CommitForm from './commit_sidebar/form.vue';
import IdeReview from './ide_review.vue'; import IdeReview from './ide_review.vue';
import SuccessMessage from './commit_sidebar/success_message.vue';
import { activityBarViews } from '../constants';
export default { export default {
components: { components: {
...@@ -25,10 +27,24 @@ export default { ...@@ -25,10 +27,24 @@ export default {
IdeTree, IdeTree,
CommitForm, CommitForm,
IdeReview, IdeReview,
SuccessMessage,
}, },
computed: { computed: {
...mapState(['loading', 'currentBranchId', 'currentActivityView']), ...mapState([
...mapGetters(['currentProject']), 'loading',
'currentBranchId',
'currentActivityView',
'changedFiles',
'stagedFiles',
'lastCommitMsg',
]),
...mapGetters(['currentProject', 'someUncommitedChanges']),
showSuccessMessage() {
return (
this.currentActivityView === activityBarViews.edit &&
(this.lastCommitMsg && !this.someUncommitedChanges)
);
},
}, },
}; };
</script> </script>
...@@ -96,6 +112,9 @@ export default { ...@@ -96,6 +112,9 @@ export default {
/> />
</div> </div>
<commit-form /> <commit-form />
<success-message
v-show="showSuccessMessage"
/>
</template> </template>
</div> </div>
</resizable-panel> </resizable-panel>
......
...@@ -27,14 +27,11 @@ export default { ...@@ -27,14 +27,11 @@ export default {
'unusedSeal', 'unusedSeal',
]), ]),
...mapState('commit', ['commitMessage', 'submitCommitLoading']), ...mapState('commit', ['commitMessage', 'submitCommitLoading']),
...mapGetters(['lastOpenedFile', 'hasChanges']), ...mapGetters(['lastOpenedFile', 'hasChanges', 'someUncommitedChanges']),
...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled']), ...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled']),
showStageUnstageArea() { showStageUnstageArea() {
return !!(this.someUncommitedChanges || this.lastCommitMsg || !this.unusedSeal); return !!(this.someUncommitedChanges || this.lastCommitMsg || !this.unusedSeal);
}, },
someUncommitedChanges() {
return !!(this.changedFiles.length || this.stagedFiles.length);
},
}, },
watch: { watch: {
hasChanges() { hasChanges() {
......
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
'getStagedFile', 'getStagedFile',
'isEditModeActive', 'isEditModeActive',
'isCommitModeActive', 'isCommitModeActive',
'isReviewModeActive',
]), ]),
shouldHideEditor() { shouldHideEditor() {
return this.file && this.file.binary && !this.file.content; return this.file && this.file.binary && !this.file.content;
......
...@@ -59,6 +59,10 @@ export const lastOpenedFile = state => ...@@ -59,6 +59,10 @@ export const lastOpenedFile = state =>
export const isEditModeActive = state => state.currentActivityView === activityBarViews.edit; export const isEditModeActive = state => state.currentActivityView === activityBarViews.edit;
export const isCommitModeActive = state => state.currentActivityView === activityBarViews.commit; export const isCommitModeActive = state => state.currentActivityView === activityBarViews.commit;
export const isReviewModeActive = state => state.currentActivityView === activityBarViews.review;
export const someUncommitedChanges = state =>
!!(state.changedFiles.length || state.stagedFiles.length);
// prevent babel-plugin-rewire from generating an invalid default during karma tests // prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {}; export default () => {};
...@@ -443,6 +443,7 @@ ...@@ -443,6 +443,7 @@
} }
.multi-file-commit-panel-inner { .multi-file-commit-panel-inner {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
...@@ -485,7 +486,6 @@ ...@@ -485,7 +486,6 @@
margin-bottom: 0; margin-bottom: 0;
border-bottom: 1px solid $white-dark; border-bottom: 1px solid $white-dark;
padding: $gl-btn-padding $gl-padding; padding: $gl-btn-padding $gl-padding;
min-height: 56px;
} }
.multi-file-commit-panel-header-title { .multi-file-commit-panel-header-title {
...@@ -612,24 +612,14 @@ ...@@ -612,24 +612,14 @@
.btn { .btn {
font-size: $gl-font-size; font-size: $gl-font-size;
} }
.multi-file-commit-panel-success-message {
top: 0;
}
} }
.multi-file-commit-panel-bottom { .multi-file-commit-panel-bottom {
position: relative; position: relative;
.multi-file-commit-panel-success-message {
position: absolute;
top: 1px;
left: 3px;
bottom: 0;
right: 0;
z-index: 10;
background: $gray-light;
overflow: auto;
display: flex;
flex-direction: column;
justify-content: center;
}
} }
.dirty-diff { .dirty-diff {
...@@ -870,6 +860,7 @@ ...@@ -870,6 +860,7 @@
.ide-activity-bar { .ide-activity-bar {
position: relative; position: relative;
flex: 0 0 60px; flex: 0 0 60px;
z-index: 1;
} }
.ide-file-finder-overlay { .ide-file-finder-overlay {
...@@ -1032,3 +1023,17 @@ ...@@ -1032,3 +1023,17 @@
.ide-new-modal-label { .ide-new-modal-label {
line-height: 34px; line-height: 34px;
} }
.multi-file-commit-panel-success-message {
position: absolute;
top: 61px;
left: 1px;
bottom: 0;
right: 0;
z-index: 10;
background: $white-light;
overflow: auto;
display: flex;
flex-direction: column;
justify-content: center;
}
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