Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 <TheFooter> Add commit hash link #76

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions components/TheFooter.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<template lang="pug">
<footer class="TheFooter">
OverlayLoadingLogo(animate-when="scrolled-into-view")
a(href="https://www.schoolsyst.com/").logotype-wrapper: Logotype.logotype
code.version
span.channel {{ version.channel }}
span(title="Incrémentée par l'ajout de fonctionnalités").feat {{ version.feature }}.
span(title="Incrémentée lors de changements dans l'interface").ui {{ version.ui }}.
span(title="Incrémentée quand des bugs sont réglés").bug {{ version.bug }}
p.open-source
| Projet open source, code disponible chez
a(href="//github.com/schoolsyst") GitHub
p.wakatime
img(title="API" src="https://wakatime.com/badge/github/schoolsyst/backend.svg")
span.plus-sign +
img(title="Application web" src="https://wakatime.com/badge/github/schoolsyst/frontend.svg")
</footer>
footer.TheFooter
OverlayLoadingLogo(animate-when="scrolled-into-view")
a(href="https://www.schoolsyst.com/").logotype-wrapper: Logotype.logotype
code.version
span.channel {{ version.channel }}
span(title="Incrémentée par l'ajout de fonctionnalités").feat {{ version.feature }}.
span(title="Incrémentée lors de changements dans l'interface").ui {{ version.ui }}.
span(title="Incrémentée quand des bugs sont réglés").bug {{ version.bug }}
p.open-source
| Projet open source, code disponible chez
a(href="//github.com/schoolsyst") GitHub
p.wakatime
img(title="API" src="https://wakatime.com/badge/github/schoolsyst/backend.svg")
span.plus-sign +
img(title="Application web" src="https://wakatime.com/badge/github/schoolsyst/frontend.svg")
code.build-number
| commit
a(:href="`https://github.com/schoolsyst/frontend/commit/${version.build.full}`") {{ version.build.short }}
</template>

<script>
Expand Down
13 changes: 11 additions & 2 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ import { toDate, addDays, isBefore, format } from 'date-fns'
import tinycolor from 'tinycolor2'
import constantCase from 'constant-case'
import Vue from 'vue'
const npm = require('~/package.json')
const version = require('~/package.json').version.split('.')

const version = npm.version.split('.')
// eslint-disable-next-line import/order
const commitHash = require('child_process')
.execSync('git rev-parse HEAD')
.toString()
.trim()
const commitHashShort = commitHash.slice(0, 7)

export const state = () => ({
version: {
feature: version[0],
ui: version[1],
bug: version[2],
channel: 'beta',
build: {
full: commitHash,
short: commitHashShort,
},
},
now: toDate(Date.now()), // For time-dependent getters.
tomorrow: addDays(toDate(Date.now()), 1),
Expand Down