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. - name: Patch motd.md to include privacy policy.
run: cp netlify/motd.md public/public/motd.md 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 - name: Patch base URL
run: echo "HD_BASE_URL=\"https://hedgedoc.dev/\"" >> .env.production 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. - name: Patch motd.md to include privacy policy.
run: cp netlify/motd.md public/public/motd.md 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 - name: Patch base URL
run: echo "HD_BASE_URL=\"${{ env.DEPLOY_URL }}\"" >> .env.production 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 RUN apk add --no-cache libc6-compat
ENV NODE_ENV=production ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
ARG BUILD_VERSION=CLIENT_VERSION_MISSING
ENV YARN_CACHE_FOLDER=/tmp/.yarn ENV YARN_CACHE_FOLDER=/tmp/.yarn
USER node USER node
@ -29,7 +28,6 @@ ARG TURBO_TOKEN
RUN rm -rf frontend/public/public RUN rm -rf frontend/public/public
RUN rm -rf frontend/src/pages/api 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 RUN yarn turbo run build --filter=frontend --no-cache --no-daemon
# RUNNER # RUNNER

View file

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

View file

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

View file

@ -5,7 +5,6 @@
*/ */
import links from '../../links.json' import links from '../../links.json'
import { Logger } from '../../utils/logger' import { Logger } from '../../utils/logger'
import frontendVersion from '../../version.json'
import { UiIcon } from '../common/icons/ui-icon' import { UiIcon } from '../common/icons/ui-icon'
import { ExternalLink } from '../common/links/external-link' import { ExternalLink } from '../common/links/external-link'
import type { ErrorInfo, PropsWithChildren, ReactNode } from 'react' import type { ErrorInfo, PropsWithChildren, ReactNode } from 'react'
@ -54,11 +53,7 @@ export class ErrorBoundary extends Component<PropsWithChildren<unknown>> {
the app. the app.
</p> </p>
If you can reproduce this error, then we would be glad if you&#32; If you can reproduce this error, then we would be glad if you&#32;
<ExternalLink <ExternalLink text={'open an issue on github'} href={links.issues} className={'text-primary'} />
text={'open an issue on github'}
href={frontendVersion.issueTrackerUrl}
className={'text-primary'}
/>
&#32; or <ExternalLink text={'contact us on matrix.'} href={links.chat} 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'}> <Button onClick={() => this.refreshPage()} title={'Reload App'} className={'mt-4'}>
<UiIcon icon={IconArrowRepeat} /> <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 { useApplicationState } from '../../../../hooks/common/use-application-state'
import links from '../../../../links.json' import links from '../../../../links.json'
import { cypressId } from '../../../../utils/cypress-attribute' 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 type { CommonModalProps } from '../../../common/modals/common-modal'
import { CommonModal } 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 React, { useMemo } from 'react'
import { Modal, Row } from 'react-bootstrap' import { Modal } from 'react-bootstrap'
/** /**
* Renders a modal with the version information. * Renders a modal with the version information.
@ -39,24 +40,27 @@ export const VersionInfoModal: React.FC<CommonModalProps> = ({ onHide, show }) =
<CommonModal <CommonModal
{...cypressId('version-modal')} {...cypressId('version-modal')}
show={show} show={show}
modalSize={'sm'}
onHide={onHide} onHide={onHide}
showCloseButton={true} showCloseButton={true}
titleI18nKey={'landing.versionInfo.title'}> titleI18nKey={'landing.versionInfo.title'}>
<Modal.Body> <Modal.Body>
<Row> <h5>HedgeDoc</h5>
<VersionInfoModalColumn <CopyableField content={backendVersion} />
titleI18nKey={'landing.versionInfo.serverVersion'} <ShowIf condition={!!links.sourceCode}>
version={backendVersion} <TranslatedExternalLink
issueTrackerLink={links.backendIssues} i18nKey={'landing.versionInfo.sourceCode'}
sourceCodeLink={links.backendSourceCode} className={'btn btn-sm btn-primary d-block mb-2'}
href={links.sourceCode}
/> />
<VersionInfoModalColumn </ShowIf>
titleI18nKey={'landing.versionInfo.clientVersion'} <ShowIf condition={!!links.issues}>
version={frontendVersion.version} <TranslatedExternalLink
issueTrackerLink={frontendVersion.issueTrackerUrl} i18nKey={'landing.versionInfo.issueTracker'}
sourceCodeLink={frontendVersion.sourceCodeUrl} className={'btn btn-sm btn-primary d-block mb-2'}
href={links.issues}
/> />
</Row> </ShowIf>
</Modal.Body> </Modal.Body>
</CommonModal> </CommonModal>
) )

View file

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