diff --git a/.gitignore b/.gitignore index 97168235..ad87de6f 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,5 @@ yarn-error.log* /.idea/* !/.idea/documentation.iml !/.idea/prettier.xml - -# Reintroducing to add TailwindCSS @include rule -# .vscode +.vscode diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 2a8b6007..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "recommendations": [ - "aaron-bond.better-comments", - "dbaeumer.vscode-eslint", - "dsznajder.es7-react-js-snippets", - "zignd.html-css-class-completion", - "ms-vscode.vscode-typescript-next", - "csstools.postcss", - "esbenp.prettier-vscode", - "bradlc.vscode-tailwindcss", - "wix.vscode-import-cost" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 2f1ecf38..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "css.customData": [".vscode/tailwind.json"] -} diff --git a/.vscode/tailwind.json b/.vscode/tailwind.json deleted file mode 100644 index 96a1f579..00000000 --- a/.vscode/tailwind.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "version": 1.1, - "atDirectives": [ - { - "name": "@tailwind", - "description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.", - "references": [ - { - "name": "Tailwind Documentation", - "url": "https://tailwindcss.com/docs/functions-and-directives#tailwind" - } - ] - }, - { - "name": "@apply", - "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.", - "references": [ - { - "name": "Tailwind Documentation", - "url": "https://tailwindcss.com/docs/functions-and-directives#apply" - } - ] - }, - { - "name": "@responsive", - "description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n", - "references": [ - { - "name": "Tailwind Documentation", - "url": "https://tailwindcss.com/docs/functions-and-directives#responsive" - } - ] - }, - { - "name": "@screen", - "description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n", - "references": [ - { - "name": "Tailwind Documentation", - "url": "https://tailwindcss.com/docs/functions-and-directives#screen" - } - ] - }, - { - "name": "@variants", - "description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n", - "references": [ - { - "name": "Tailwind Documentation", - "url": "https://tailwindcss.com/docs/functions-and-directives#variants" - } - ] - } - ] -} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 74ca5e85..bbd574a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ When fixing a bug it is fine to submit a pull request right away. You need the following tools to be installed. -- [NodeJS](https://nodejs.org/) installed at v18.X. +- [Node](https://nodejs.org/) installed at v16.X. - [Yarn](https://yarnpkg.com/) at v1.22.4+. > **Tip:** _Use [nvm](https://github.com/nvm-sh/nvm) or [n](https://github.com/tj/n) or diff --git a/README.md b/README.md index 88e688fa..29ad0d68 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You may also view the markdown files directly at the following links: - [Getting Started with GameCI](docs/02-getting-started) - [Github Actions](docs/03-github) - [Gitlab Pipelines](docs/05-gitlab) -- [CircleCi](docs/11-circleci) +- [CircleCi<](docs/11-circleci) - [Docker](docs/08-docker) - [Github Cloud Runner](docs/03-github-cloud-runner) - [Troubleshooting](docs/09-troubleshooting) @@ -33,13 +33,13 @@ You may also view the markdown files directly at the following links: ## Building the Docs Site -Built with [Docusaurus 2](https://docusaurus.io/). +Built with [Docusaurus 2.](https://docusaurus.io/) This project has a hard dependancy on Node16. You will need to make sure that you have the proper version of node installed to avoid errors. -- [Install NodeJS v18 on Ubuntu](https://joshtronic.com/2022/04/24/how-to-install-nodejs-18-on-ubuntu-2004-lts/) -- [Install NodeJS v18 using brew](https://apple.stackexchange.com/a/207883) +- [Install Node16 on Ubuntu](https://joshtronic.com/2021/05/09/how-to-install-nodejs-16-on-ubuntu-2004-lts/) +- [Install Node16 using brew](https://apple.stackexchange.com/a/207883) This project relies on yarn for package management. You will need to install yarn in order to build and test the documentation site. diff --git a/src/components/auth/safe-auth-check.tsx b/src/components/auth/safe-auth-check.tsx index ab52ffc3..4fa6523a 100644 --- a/src/components/auth/safe-auth-check.tsx +++ b/src/components/auth/safe-auth-check.tsx @@ -23,11 +23,7 @@ export function SafeClaimsCheck({ user, fallback, children, requiredClaims }: Cl } // Apply fix while this is not merged https://github.com/FirebaseExtended/reactfire/pull/336 -export function SafeAuthCheck({ - fallback, - children, - requiredClaims, -}: AuthCheckProps): React.JSX.Element { +export function SafeAuthCheck({ fallback, children, requiredClaims }: AuthCheckProps): JSX.Element { const { data: user } = useUser(); if (user) { diff --git a/src/components/docs/versions/builds/build-failure-details.tsx b/src/components/docs/versions/build-failure-details.tsx similarity index 100% rename from src/components/docs/versions/builds/build-failure-details.tsx rename to src/components/docs/versions/build-failure-details.tsx diff --git a/src/components/docs/versions/builds/builds.module.scss b/src/components/docs/versions/builds.module.scss similarity index 90% rename from src/components/docs/versions/builds/builds.module.scss rename to src/components/docs/versions/builds.module.scss index 9256dab7..c712aed9 100644 --- a/src/components/docs/versions/builds/builds.module.scss +++ b/src/components/docs/versions/builds.module.scss @@ -12,11 +12,4 @@ } .expandedContentRow { - height: 0; - overflow: hidden; -} - - -.tableRow { - width: 100%; } diff --git a/src/components/docs/versions/builds.tsx b/src/components/docs/versions/builds.tsx new file mode 100644 index 00000000..9ed5c5cf --- /dev/null +++ b/src/components/docs/versions/builds.tsx @@ -0,0 +1,146 @@ +import { ColumnsType } from 'antd/es/table'; +import React from 'react'; +import { useFirestore, useFirestoreCollectionData } from 'reactfire'; +import { Table, Tooltip } from 'antd'; +import Spinner from '@site/src/components/molecules/spinner'; +import DockerImageLinkOrRetryButton from '@site/src/components/docs/versions/docker-image-link-or-retry-button'; +import BuildFailureDetails from '@site/src/components/docs/versions/build-failure-details'; +// import styles from './builds.module.scss'; + +interface RepoVersionInfo { + version: string; + major: number; + minor: number; + patch: number; +} + +interface Props { + ciJobId: string; + repoVersionInfo: RepoVersionInfo; + editorVersionInfo; +} + +const mapBuildStatusToIcon = { + started: , + failed: '⚠', + published: '✅', +}; + +const Builds = ({ ciJobId, repoVersionInfo, editorVersionInfo, ...props }: Props) => { + const loading =

Fetching builds...

; + + const ciBuilds = useFirestore().collection('ciBuilds').where('relatedJobId', '==', ciJobId); + + const { status, data } = useFirestoreCollectionData<{ [key: string]: any }>(ciBuilds); + const isLoading = status === 'loading'; + + if (isLoading) { + return loading; + } + + const columns = [ + { + width: 45, + dataIndex: 'status', + key: 'status', + render: (value, record) => { + const icon = mapBuildStatusToIcon[value]; + switch (value) { + case 'published': + return icon; + case 'failed': + return {icon}; + case 'started': + return {icon}; + default: + return value; + } + }, + }, + { + width: 45, + render: (value, record) => , + key: 'docker-image-link-or-retry-button', + }, + { + title: 'Build identifier', + dataIndex: 'buildId', + key: 'buildId', + onFilter: (value, record) => record.buildId.includes(value), + defaultSortOrder: 'ascend', + sorter: (a, b) => a.buildId.localeCompare(b.buildId, 'en-GB'), + ellipsis: true, + }, + { + title: 'Image type', + dataIndex: 'imageType', + key: 'imageType', + onFilter: (value, record) => record.imageType.includes(value), + sorter: (a, b) => a.imageType.localeCompare(b.imageType, 'en-GB'), + ellipsis: true, + }, + { + title: 'OS', + dataIndex: ['buildInfo', 'baseOs'], + key: 'buildInfo.baseOs', + onFilter: (value, record) => record.buildInfo.baseOs.includes(value), + sorter: (a, b) => a.buildInfo.baseOs.localeCompare(b.buildInfo.baseOs, 'en-GB'), + ellipsis: true, + }, + { + title: 'Target platform', + dataIndex: ['buildInfo', 'targetPlatform'], + key: 'buildInfo.targetPlatform', + onFilter: (value, record) => record.buildInfo.targetPlatform.includes(value), + sorter: (a, b) => + a.buildInfo.targetPlatform.localeCompare(b.buildInfo.targetPlatform, 'en-GB'), + ellipsis: true, + }, + { + title: 'Editor version', + dataIndex: ['buildInfo', 'editorVersion'], + key: 'buildInfo.editorVersion', + onFilter: (value, record) => record.buildInfo.editorVersion.includes(value), + sorter: (a, b) => a.buildInfo.editorVersion.localeCompare(b.buildInfo.editorVersion, 'en-GB'), + ellipsis: true, + }, + { + title: 'Repo version', + dataIndex: ['buildInfo', 'repoVersion'], + key: 'buildInfo.repoVersion', + onFilter: (value, record) => record.buildInfo.repoVersion.includes(value), + sorter: (a, b) => a.buildInfo.repoVersion.localeCompare(b.buildInfo.repoVersion, 'en-GB'), + ellipsis: true, + }, + ] as ColumnsType; + + const expandable = { + rowExpandable: () => true, + // expandedRowClassName: () => styles.expandedContentRow, + expandedRowRender: (record) => ( + + ), + }; + + return ( + row.NO_ID_FIELD} + // rowClassName={() => styles.stickyRow} + expandable={expandable} + pagination={false} + /> + ); +}; + +export default Builds; diff --git a/src/components/docs/versions/builds/build-row.tsx b/src/components/docs/versions/builds/build-row.tsx deleted file mode 100644 index 999f35e1..00000000 --- a/src/components/docs/versions/builds/build-row.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React, { useState } from 'react'; -import DockerImageLinkOrRetryButton, { - type Record, -} from '@site/src/components/docs/versions/docker-image-link-or-retry-button'; -import Spinner from '@site/src/components/molecules/spinner'; -import Tooltip from '@site/src/components/molecules/tooltip/tooltip'; -import styles from './builds.module.scss'; - -const mapBuildStatusToIcon = { - started: , - failed: '⚠', - published: '✅', -}; - -type Props = { - children: React.JSX.Element | React.JSX.Element[]; - build: Record; -}; - -const CopyToClipboard = (copyString: string) => { - navigator.clipboard.writeText(copyString); -}; - -export default function BuildRow({ children, build }: Props) { - const [expanded, setExpanded] = useState(false); - const [toolbarContent, setToolbarContent] = useState('Click to copy'); - - const MapBuildStatusToElement = (status: string) => { - const icon = mapBuildStatusToIcon[status]; - - switch (status) { - case 'started': - return ; - case 'failed': - return {icon}; - case 'published': - return icon; - default: - return status; - } - }; - - return ( - <> - - - - - - - - - {expanded && ( - - - - )} - - ); -} diff --git a/src/components/docs/versions/builds/builds.tsx b/src/components/docs/versions/builds/builds.tsx deleted file mode 100644 index 64e2f9ef..00000000 --- a/src/components/docs/versions/builds/builds.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import { useFirestore, useFirestoreCollectionData } from 'reactfire'; -import BuildFailureDetails from '@site/src/components/docs/versions/builds/build-failure-details'; -import styles from './builds.module.scss'; -import BuildRow from './build-row'; -import { Record } from '../docker-image-link-or-retry-button'; - -interface RepoVersionInfo { - version: string; - major: number; - minor: number; - patch: number; -} - -interface Props { - ciJobId: string; - repoVersionInfo: RepoVersionInfo; - editorVersionInfo; -} - -const Builds = ({ ciJobId, repoVersionInfo, editorVersionInfo }: Props) => { - const loading =

Fetching builds...

; - - const ciBuilds = useFirestore().collection('ciBuilds').where('relatedJobId', '==', ciJobId); - - const { status, data } = useFirestoreCollectionData<{ [key: string]: any }>(ciBuilds); - const isLoading = status === 'loading'; - - if (isLoading) { - return loading; - } - - const expandable = { - expandedRowRender: (record) => ( - - ), - }; - - return ( -
setExpanded(!expanded)} - className="text-center select-none cursor-pointer" - > - {expanded ? '➖' : '➕'} - {MapBuildStatusToElement(build.status)} - - {/* */} - - - - - {/* */} - - - {build.imageType}{build.buildInfo.baseOs}{build.buildInfo.targetPlatform}
{children}
- - - - - - - - - {data.map((build: Record) => ( - {expandable.expandedRowRender(build)} - ))} -
StatusBuild IDImage typeOSTarget Platform
- ); -}; - -export default Builds; diff --git a/src/components/docs/versions/date-time.tsx b/src/components/docs/versions/date-time.tsx index 212cafb7..58e243a4 100644 --- a/src/components/docs/versions/date-time.tsx +++ b/src/components/docs/versions/date-time.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import Tooltip from '../../molecules/tooltip/tooltip'; interface Props { utcSeconds: number; @@ -11,8 +10,8 @@ const options: Intl.DateTimeFormatOptions = { day: 'numeric', hour: 'numeric', minute: 'numeric', + second: 'numeric', timeZoneName: 'short', - hour12: true, }; const DateTime = ({ utcSeconds }: Props) => { @@ -20,13 +19,7 @@ const DateTime = ({ utcSeconds }: Props) => { date.setUTCSeconds(utcSeconds); - return ( - - - ( ... ) - - - ); + return {`${date.toLocaleString('en-GB', options)}`}; }; export default DateTime; diff --git a/src/components/docs/versions/docker-image-link-or-retry-button.tsx b/src/components/docs/versions/docker-image-link-or-retry-button.tsx index 544747a1..bbd02291 100644 --- a/src/components/docs/versions/docker-image-link-or-retry-button.tsx +++ b/src/components/docs/versions/docker-image-link-or-retry-button.tsx @@ -1,3 +1,4 @@ +import { Tooltip } from 'antd'; import React, { useState } from 'react'; import { HiOutlineRefresh } from 'react-icons/hi'; import { SimpleAuthCheck } from '@site/src/components/auth/safe-auth-check'; @@ -5,32 +6,25 @@ import DockerImageLink from '@site/src/components/docs/versions/docker-image-lin import { useAuthenticatedEndpoint } from '@site/src/core/hooks/use-authenticated-endpoint'; import { useNotification } from '@site/src/core/hooks/use-notification'; import Spinner from '@site/src/components/molecules/spinner'; -import Tooltip from '@site/src/components/molecules/tooltip/tooltip'; - -type Record = { - buildId: string; - relatedJobId: string; - buildInfo: { - baseOs: string; - editorVersion: string; - targetPlatform: string; - repoVersion: string; - }; - dockerInfo: { - digest: string; - imageRepo: string; - imageName: string; - }; - status: string; - [key: string]: any; -}; interface Props { - record: Record; + record: { + buildId: string; + relatedJobId: string; + buildInfo: { + baseOs: string; + editorVersion: string; + targetPlatform: string; + repoVersion: string; + }; + dockerInfo: { + imageRepo: string; + imageName: string; + }; + status: string; + }; } -export { Record }; - const DockerImageLinkOrRetryButton = ({ record }: Props) => { const { buildInfo, dockerInfo, buildId, relatedJobId, status } = record; const { baseOs, editorVersion, targetPlatform, repoVersion } = buildInfo; @@ -61,7 +55,7 @@ const DockerImageLinkOrRetryButton = ({ record }: Props) => { return ( } requiredClaims={{ admin: true }}> - +