Skip to content

Commit

Permalink
Minor adjustments to <LatestGitHubRelease /> component
Browse files Browse the repository at this point in the history
  • Loading branch information
olemp committed Mar 30, 2023
1 parent 7c1c948 commit d2da4f1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const LatestGitHubRelease: FC = () => {
<div className={styles.root}>
<div>
<span className={styles.label}>{strings.LatestGitHubReleaseLabel}</span>
<span className={styles.latestGitHubReleaseLink}>
<span className={styles.latestGitHubReleaseLink} title={strings.LatestGitHubReleaseLinkTitle}>
<Link href={latestGitHubRelease.html_url} target='_blank' rel='noopener noreferrer'>
{latestGitHubVersion.toString()}
</Link>
Expand All @@ -37,4 +37,4 @@ export const LatestGitHubRelease: FC = () => {
</div>
</div>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import strings from 'PortfolioExtensionsStrings'
import { useContext } from 'react'
import { FooterContext } from '../../context'

/**
* Component logic hook for the `LatestGitHubRelease` component.
* Returns the latest GitHub release, latest GitHub version, installed
* version and version comparison icon props.
*/
export function useLatestGitHubRelease() {
const { props } = useContext(FooterContext)
const latestGitHubRelease = props.gitHubReleases[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { FooterContext } from '../context'
import styles from './InstallVersionTooltipContent.module.scss'
import { LatestGitHubRelease } from './LatestGitHubRelease'

/**
* Component for displaying information about the latest installation
* of Prosjektportalen 365.
*/
export const InstallVersionTooltipContent: FC = () => {
const { latestEntry, props } = useContext(FooterContext)
const dateTimeFormatOptions: Intl.DateTimeFormatOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { IFooterProps } from './types'

/**
* Component logic hook for the `Footer` component. Returns the latest entry
* from the `entries` prop (which is sorted by `InstallStartTime`).
* from the `entries` prop (which is sorted by `InstallStartTime`) and
* the installed version string.
*
* @param props Props for the `Footer` component
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare interface IPortfolioExtensionsStrings {
LatestGitHubReleaseLinkTitle: string
LatestGitHubReleaseDownloadButtonText: string
LatestGitHubReleaseIsNewerText: any
LatestGitHubReleaseIsOlderText: any
Expand Down
3 changes: 2 additions & 1 deletion SharePointFramework/PortfolioExtensions/src/loc/nb-no.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define([], function () {
LatestGitHubReleaseIsNewerText: 'En nyere versjon er tilgjengelig på GitHub',
LatestGitHubReleaseIsOlderText: 'Versjonen som er installert er nyere enn den siste release fra GitHub',
LatestGitHubReleaseIsSameText: 'Versjonen som er installert er den siste release fra GitHub',
LatestGitHubReleaseDownloadButtonText: 'Last ned siste release fra GitHub'
LatestGitHubReleaseDownloadButtonText: 'Last ned siste release fra GitHub',
LatestGitHubReleaseLinkTitle: 'Se siste release på GitHub'
}
})

0 comments on commit d2da4f1

Please sign in to comment.