diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee91987c..5a6fa1a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Birthdays: move today's birthdays out of notifications into right sidebar. - Performance: improve scrolling/navigation between feeds by using a virtual window library. - Admin: admin UI into 3-column layout. +- Admin: include external link to frontend repo for the running commit. ### Removed - Theme: Halloween theme. diff --git a/app/soapbox/features/admin/tabs/dashboard.tsx b/app/soapbox/features/admin/tabs/dashboard.tsx index 6b7de2747..dd0f9f1bd 100644 --- a/app/soapbox/features/admin/tabs/dashboard.tsx +++ b/app/soapbox/features/admin/tabs/dashboard.tsx @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom'; import { getSubscribersCsv, getUnsubscribersCsv, getCombinedCsv } from 'soapbox/actions/email-list'; import List, { ListItem } from 'soapbox/components/list'; -import { CardTitle, IconButton, Stack } from 'soapbox/components/ui'; +import { CardTitle, Icon, IconButton, Stack } from 'soapbox/components/ui'; import { useAppDispatch, useOwnAccount, useFeatures, useInstance } from 'soapbox/hooks'; import sourceCode from 'soapbox/utils/code'; import { download } from 'soapbox/utils/download'; @@ -113,7 +113,18 @@ const Dashboard: React.FC = () => { }> - {sourceCode.displayName} {sourceCode.version} + + {sourceCode.displayName} {sourceCode.version} + + + }> diff --git a/app/soapbox/utils/code.js b/app/soapbox/utils/code.js index 3316a931f..205bda6b6 100644 --- a/app/soapbox/utils/code.js +++ b/app/soapbox/utils/code.js @@ -3,6 +3,8 @@ const { execSync } = require('child_process'); const pkg = require('../../../package.json'); +const { CI_COMMIT_TAG, CI_COMMIT_REF_NAME, CI_COMMIT_SHA } = process.env; + const shortRepoName = url => new URL(url).pathname.substring(1); const trimHash = hash => hash.substring(0, 7); @@ -10,14 +12,12 @@ const tryGit = cmd => { try { return String(execSync(cmd)); } catch (e) { - return null; + return undefined; } }; const version = pkg => { // Try to discern from GitLab CI first - const { CI_COMMIT_TAG, CI_COMMIT_REF_NAME, CI_COMMIT_SHA } = process.env; - if (CI_COMMIT_TAG === `v${pkg.version}` || CI_COMMIT_REF_NAME === 'stable') { return pkg.version; } @@ -43,4 +43,5 @@ module.exports = { repository: shortRepoName(pkg.repository.url), version: version(pkg), homepage: pkg.homepage, + ref: CI_COMMIT_TAG || CI_COMMIT_SHA || tryGit('git rev-parse HEAD'), };