diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-03-23 15:15:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 15:15:04 +0100 |
commit | 4bc0c4b4d51281b6dde2f77e33fd6c93dba83d03 (patch) | |
tree | 17ef25b0567097346cfb8ba233b9b1d010984676 /src/views | |
parent | 3718df3919de151cc754e273cb56b2e72dbe2caa (diff) | |
parent | 08febdd980c06d752d410be1fa982e5507279f6d (diff) |
Merge pull request #9 from gico-net/feat/commit-details-page
Commit details page
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/Commit.vue | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/views/Commit.vue b/src/views/Commit.vue new file mode 100644 index 0000000..d8b0050 --- /dev/null +++ b/src/views/Commit.vue @@ -0,0 +1,54 @@ +<template lang="pug"> + main + header-blue + b-container(v-if="loading") + b-overlay(:show="true" spinner-large) + b-container(v-else) + commit-card( + :data="commit" + :author="author_avatar" + :committer="committer_avatar" + :expand="true" + ) +</template> + +<script> +import HeaderBlue from '@/components/HeaderBlue'; +import Commit from '@/components/Commit'; + +export default { + name: "Commit", + props: ["hash"], + components: { + 'header-blue': HeaderBlue, + 'commit-card': Commit, + }, + async mounted() { + this.$store.dispatch('set_loading', true); + await this.$store.dispatch('get_commit', this.hash); + await this.$store.dispatch('get_email', + {type: 'author', email: this.commit.author_email}); + if(this.commit.author_email != this.commit.committer_email) { + await this.$store.dispatch('get_email', + {type: 'committer', email: this.commit.committer_email}); + } else { + await this.$store.dispatch('set_committer', this.author_avatar) + } + this.$store.dispatch('set_loading', false); + }, + computed: { + loading: function() { + return this.$store.getters.loading; + }, + commit: function() { + return this.$store.getters.commit; + }, + author_avatar: function() { + return this.$store.getters.author_avatar; + }, + committer_avatar: function() { + return this.$store.getters.committer_avatar; + }, + }, +} +</script> |