From 035241e70d05eb0ae75c79fab6b4052e66ff0464 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 23 Mar 2021 15:14:20 +0100 Subject: feat: get avatar searching email --- src/store.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/store.js b/src/store.js index 79bdaff..a56a468 100644 --- a/src/store.js +++ b/src/store.js @@ -11,6 +11,8 @@ export default new Vuex.Store({ commits: [], top_authors: [], emails: {}, + author_avatar: "", + committer_avatar: "", }, getters: { loading: state => { @@ -28,6 +30,12 @@ export default new Vuex.Store({ emails: state => { return state.emails }, + author_avatar: state => { + return state.author_avatar + }, + committer_avatar: state => { + return state.committer_avatar + }, }, mutations: { loading_state: (state, value) => { @@ -45,6 +53,12 @@ export default new Vuex.Store({ load_emails: (state, value) => { state.emails = value }, + load_author_avatar: (state, value) => { + state.author_avatar = value.hash_md5 + }, + load_committer_avatar: (state, value) => { + state.committer_avatar = value.hash_md5 + }, }, actions: { // Get all commits from the api backend @@ -78,6 +92,15 @@ export default new Vuex.Store({ commit('load_top_authors', await response.json()); }) commit('loading_top_authors_state', false) + // Get email + async get_email({commit}, data) { + await fetch(`${this.state.api}/email/search/?q=${data.email}`) + .then(async response => { + if(await response.status == 200) { + commit(`load_${data.type}_avatar`, await response.json()); + } + }) + }, } }, modules: { -- cgit v1.2.3-18-g5258 From 08febdd980c06d752d410be1fa982e5507279f6d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 23 Mar 2021 15:14:32 +0100 Subject: feat: commit details page --- src/components/Commit.vue | 7 ++++-- src/router.js | 7 ++++++ src/sass/_commit.sass | 2 ++ src/store.js | 22 +++++++++++++++++++ src/views/Commit.vue | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 src/views/Commit.vue (limited to 'src') diff --git a/src/components/Commit.vue b/src/components/Commit.vue index 63e1764..a60f40e 100644 --- a/src/components/Commit.vue +++ b/src/components/Commit.vue @@ -32,10 +32,13 @@ | <{{data.committer_email}}> .text - p + p(v-if="!expand") | {{ first_line(data.text) }} span.middot ยท span.date {{ data.date | moment("ddd, D MMM YYYY HH:mm:ss ZZ") }} + p(v-else) + pre {{ data.text }} + span.date {{ data.date | moment("ddd, D MMM YYYY HH:mm:ss ZZ") }} -- cgit v1.2.3-18-g5258