summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-12-04 11:55:45 +0100
committerTim Zallmann <tzallmann@gitlab.com>2017-12-04 11:55:45 +0100
commit6c8a196aa6ed7f09b5f905d92dc204929bce9c47 (patch)
treef083715219a291a7732a90c093805d1d93e7061f
parent5a0a0e4ca31cf18ca194de9044f68bc6741ea043 (diff)
downloadgitlab-ce-6c8a196aa6ed7f09b5f905d92dc204929bce9c47.tar.gz
Showing Last Commit
-rw-r--r--app/assets/javascripts/ide/components/ide_status_bar.vue23
-rw-r--r--app/assets/javascripts/ide/stores/actions/tree.js2
-rw-r--r--app/assets/javascripts/ide/stores/mutations.js2
-rw-r--r--app/assets/javascripts/ide/stores/state.js5
4 files changed, 22 insertions, 10 deletions
diff --git a/app/assets/javascripts/ide/components/ide_status_bar.vue b/app/assets/javascripts/ide/components/ide_status_bar.vue
index 64833582113..942fc2b0f2d 100644
--- a/app/assets/javascripts/ide/components/ide_status_bar.vue
+++ b/app/assets/javascripts/ide/components/ide_status_bar.vue
@@ -1,11 +1,19 @@
<script>
import { mapState } from 'vuex';
import Icon from '../../vue_shared/components/icon.vue';
+import tooltip from '../../vue_shared/directives/tooltip';
+import timeAgoMixin from '../../vue_shared/mixins/timeago';
export default {
components: {
Icon,
},
+ directives: {
+ tooltip,
+ },
+ mixins: [
+ timeAgoMixin,
+ ],
computed: {
...mapState([
'selectedFile',
@@ -26,14 +34,21 @@ export default {
{{ selectedFile.branchId }}
</div>
<div
- class="col-sm-3">
+ class="col-sm-4">
<div
- v-if="selectedFile.lastCommit && selectedFile.lastCommit.message">
- Last commit: {{ selectedFile.lastCommit.message }}
+ v-tooltip
+ :title="selectedFile.lastCommit.message"
+ v-if="selectedFile.lastCommit && selectedFile.lastCommit.id">
+ Last commit:
+ <a
+ :href="selectedFile.lastCommit.url">
+ {{ timeFormated(selectedFile.lastCommit.updatedAt) }} by
+ {{ selectedFile.lastCommit.author }}
+ </a>
</div>
</div>
<div
- class="col-sm-1 col-sm-offset-3 text-right">
+ class="col-sm-1 col-sm-offset-2 text-right">
{{ selectedFile.name }}
</div>
<div
diff --git a/app/assets/javascripts/ide/stores/actions/tree.js b/app/assets/javascripts/ide/stores/actions/tree.js
index 01e8da37b84..0a00d33b702 100644
--- a/app/assets/javascripts/ide/stores/actions/tree.js
+++ b/app/assets/javascripts/ide/stores/actions/tree.js
@@ -117,7 +117,7 @@ export const createTempTree = ({ state, commit, dispatch }, name) => {
};
export const getLastCommitData = ({ state, commit, dispatch, getters }, tree = state) => {
- if (tree.lastCommitPath === null || getters.isCollapsed) return;
+ if (tree.lastCommitPath === null) return;
service.getTreeLastCommit(tree.lastCommitPath)
.then((res) => {
diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js
index 6756c7a4ec9..2e68a24ca91 100644
--- a/app/assets/javascripts/ide/stores/mutations.js
+++ b/app/assets/javascripts/ide/stores/mutations.js
@@ -46,8 +46,10 @@ export default {
},
[types.SET_LAST_COMMIT_DATA](state, { entry, lastCommit }) {
Object.assign(entry.lastCommit, {
+ id: lastCommit.commit.id,
url: lastCommit.commit_path,
message: lastCommit.commit.message,
+ author: lastCommit.commit.author_name,
updatedAt: lastCommit.commit.authored_date,
});
},
diff --git a/app/assets/javascripts/ide/stores/state.js b/app/assets/javascripts/ide/stores/state.js
index 1b545d50f58..c66c6e927e8 100644
--- a/app/assets/javascripts/ide/stores/state.js
+++ b/app/assets/javascripts/ide/stores/state.js
@@ -15,11 +15,6 @@ export default () => ({
openFiles: [],
selectedFile: null,
path: '',
- project: {
- id: 0,
- name: '',
- url: '',
- },
parentTreeUrl: '',
trees: {},
projects: {},