enhancement: remove frontend version

As frontend and backend are managed inside a monorepo and distributed together, there is no sense in keeping separate frontend and backend version information.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-03-31 00:33:30 +02:00 committed by Tilman Vatteroth
parent d19d048cc8
commit bced0c478b
11 changed files with 23 additions and 101 deletions

View file

@ -39,9 +39,6 @@ jobs:
- name: Patch motd.md to include privacy policy.
run: cp netlify/motd.md public/public/motd.md
- name: Patch version.json to include git hash
run: jq ".version = \"0.0.0+${GITHUB_SHA:0:8}\"" src/version.json > src/_version.json && mv src/_version.json src/version.json
- name: Patch base URL
run: echo "HD_BASE_URL=\"https://hedgedoc.dev/\"" >> .env.production

View file

@ -62,9 +62,6 @@ jobs:
- name: Patch motd.md to include privacy policy.
run: cp netlify/motd.md public/public/motd.md
- name: Patch version.json to include git hash
run: jq ".version = \"0.0.0+${GITHUB_SHA:0:8}\"" src/version.json > src/_version.json && mv src/_version.json src/version.json
- name: Patch base URL
run: echo "HD_BASE_URL=\"${{ env.DEPLOY_URL }}\"" >> .env.production

View file

@ -13,7 +13,6 @@ FROM base AS builder
RUN apk add --no-cache libc6-compat
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ARG BUILD_VERSION=CLIENT_VERSION_MISSING
ENV YARN_CACHE_FOLDER=/tmp/.yarn
USER node
@ -29,7 +28,6 @@ ARG TURBO_TOKEN
RUN rm -rf frontend/public/public
RUN rm -rf frontend/src/pages/api
RUN sed -i "s/CLIENT_VERSION_MISSING/${BUILD_VERSION}/" frontend/src/version.json
RUN yarn turbo run build --filter=frontend --no-cache --no-daemon
# RUNNER

View file

@ -157,8 +157,6 @@
"issueTracker": "Found a bug? Fill an issue!",
"sourceCode": "Read the source code",
"versionInfo": "Version info",
"serverVersion": "Server version",
"clientVersion": "Client version",
"title": "You are using"
}
},

View file

@ -49,7 +49,7 @@ export const LinksTabContent: React.FC = () => {
<li>
<TranslatedExternalLink
i18nKey='editor.help.contacts.reportIssue'
href={links.backendIssues}
href={links.issues}
icon={IconTag}
className='text-primary'
/>

View file

@ -5,7 +5,6 @@
*/
import links from '../../links.json'
import { Logger } from '../../utils/logger'
import frontendVersion from '../../version.json'
import { UiIcon } from '../common/icons/ui-icon'
import { ExternalLink } from '../common/links/external-link'
import type { ErrorInfo, PropsWithChildren, ReactNode } from 'react'
@ -54,11 +53,7 @@ export class ErrorBoundary extends Component<PropsWithChildren<unknown>> {
the app.
</p>
If you can reproduce this error, then we would be glad if you&#32;
<ExternalLink
text={'open an issue on github'}
href={frontendVersion.issueTrackerUrl}
className={'text-primary'}
/>
<ExternalLink text={'open an issue on github'} href={links.issues} className={'text-primary'} />
&#32; or <ExternalLink text={'contact us on matrix.'} href={links.chat} className={'text-primary'} />
<Button onClick={() => this.refreshPage()} title={'Reload App'} className={'mt-4'}>
<UiIcon icon={IconArrowRepeat} />

View file

@ -1,59 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { CopyableField } from '../../../common/copyable/copyable-field/copyable-field'
import { TranslatedExternalLink } from '../../../common/links/translated-external-link'
import { ShowIf } from '../../../common/show-if/show-if'
import React from 'react'
import { Col } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
export interface VersionInfoModalColumnProps {
titleI18nKey: string
version: string
sourceCodeLink: string
issueTrackerLink: string
}
/**
* Renders a column in the {@link VersionInfoModal}.
*
* @param titleI18nKey
* @param issueTrackerLink
* @param sourceCodeLink
* @param version
* @constructor
*/
export const VersionInfoModalColumn: React.FC<VersionInfoModalColumnProps> = ({
titleI18nKey,
issueTrackerLink,
sourceCodeLink,
version
}) => {
useTranslation()
return (
<Col md={6} className={'flex-column'}>
<h5>
<Trans i18nKey={titleI18nKey} />
</h5>
<CopyableField content={version} />
<ShowIf condition={!!sourceCodeLink}>
<TranslatedExternalLink
i18nKey={'landing.versionInfo.sourceCode'}
className={'btn btn-sm btn-primary d-block mb-2'}
href={sourceCodeLink}
/>
</ShowIf>
<ShowIf condition={!!issueTrackerLink}>
<TranslatedExternalLink
i18nKey={'landing.versionInfo.issueTracker'}
className={'btn btn-sm btn-primary d-block mb-2'}
href={issueTrackerLink}
/>
</ShowIf>
</Col>
)
}

View file

@ -7,12 +7,13 @@ import type { BackendVersion } from '../../../../api/config/types'
import { useApplicationState } from '../../../../hooks/common/use-application-state'
import links from '../../../../links.json'
import { cypressId } from '../../../../utils/cypress-attribute'
import frontendVersion from '../../../../version.json'
import { CopyableField } from '../../../common/copyable/copyable-field/copyable-field'
import { TranslatedExternalLink } from '../../../common/links/translated-external-link'
import type { CommonModalProps } from '../../../common/modals/common-modal'
import { CommonModal } from '../../../common/modals/common-modal'
import { VersionInfoModalColumn } from './version-info-modal-column'
import { ShowIf } from '../../../common/show-if/show-if'
import React, { useMemo } from 'react'
import { Modal, Row } from 'react-bootstrap'
import { Modal } from 'react-bootstrap'
/**
* Renders a modal with the version information.
@ -39,24 +40,27 @@ export const VersionInfoModal: React.FC<CommonModalProps> = ({ onHide, show }) =
<CommonModal
{...cypressId('version-modal')}
show={show}
modalSize={'sm'}
onHide={onHide}
showCloseButton={true}
titleI18nKey={'landing.versionInfo.title'}>
<Modal.Body>
<Row>
<VersionInfoModalColumn
titleI18nKey={'landing.versionInfo.serverVersion'}
version={backendVersion}
issueTrackerLink={links.backendIssues}
sourceCodeLink={links.backendSourceCode}
<h5>HedgeDoc</h5>
<CopyableField content={backendVersion} />
<ShowIf condition={!!links.sourceCode}>
<TranslatedExternalLink
i18nKey={'landing.versionInfo.sourceCode'}
className={'btn btn-sm btn-primary d-block mb-2'}
href={links.sourceCode}
/>
<VersionInfoModalColumn
titleI18nKey={'landing.versionInfo.clientVersion'}
version={frontendVersion.version}
issueTrackerLink={frontendVersion.issueTrackerUrl}
sourceCodeLink={frontendVersion.sourceCodeUrl}
</ShowIf>
<ShowIf condition={!!links.issues}>
<TranslatedExternalLink
i18nKey={'landing.versionInfo.issueTracker'}
className={'btn btn-sm btn-primary d-block mb-2'}
href={links.issues}
/>
</Row>
</ShowIf>
</Modal.Body>
</CommonModal>
)

View file

@ -2,8 +2,8 @@
"chat": "https://matrix.to/#/#hedgedoc:matrix.org",
"community": "https://community.hedgedoc.org",
"githubOrg": "https://github.com/hedgedoc/",
"backendSourceCode": "https://github.com/hedgedoc/hedgedoc",
"backendIssues": "https://github.com/hedgedoc/hedgedoc/issues",
"sourceCode": "https://github.com/hedgedoc/hedgedoc",
"issues": "https://github.com/hedgedoc/hedgedoc/issues",
"mastodon": "https://social.hedgedoc.org",
"translate": "https://translate.hedgedoc.org",
"webpage": "https://hedgedoc.org"

View file

@ -1,5 +0,0 @@
{
"version": "CLIENT_VERSION_MISSING",
"sourceCodeUrl": "https://github.com/hedgedoc/hedgedoc",
"issueTrackerUrl": "https://github.com/hedgedoc/hedgedoc/issues"
}

View file

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
SPDX-License-Identifier: CC0-1.0