mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
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:
parent
d19d048cc8
commit
bced0c478b
11 changed files with 23 additions and 101 deletions
|
@ -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>
|
||||
)
|
||||
}
|
|
@ -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>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue