diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000000..72ea87a893 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,33 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - run: npm install -g yarn + - run: yarn install + - run: yarn format:check + - run: yarn build + - run: yarn lint + - run: yarn test \ No newline at end of file diff --git a/package.json b/package.json index 01ebf86eed..cad6ef7bbb 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "snowpack build", "test": "jest", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"", "lint": "eslint ./src/**/*.ts*", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" diff --git a/src/PageHeader.tsx b/src/PageHeader.tsx index 028eedd339..fa1f2cc054 100644 --- a/src/PageHeader.tsx +++ b/src/PageHeader.tsx @@ -1,5 +1,5 @@ -import React, { useContext, useState } from 'react'; -import { useTranslation } from 'react-i18next'; +import React, { useContext, useState } from "react"; +import { useTranslation } from "react-i18next"; import { Avatar, Button, @@ -14,10 +14,10 @@ import { PageHeaderTools, PageHeaderToolsItem, PageHeaderToolsGroup, -} from '@patternfly/react-core'; -import { HelpIcon } from '@patternfly/react-icons'; -import { KeycloakContext } from './auth/KeycloakContext'; -import { Link } from 'react-router-dom'; +} from "@patternfly/react-core"; +import { HelpIcon } from "@patternfly/react-icons"; +import { KeycloakContext } from "./auth/KeycloakContext"; +import { Link } from "react-router-dom"; export const Header = () => { return ( @@ -39,7 +39,7 @@ const ManageAccountDropdownItem = () => { const { t } = useTranslation(); return ( keycloak?.account()}> - {t('Manage account')} + {t("Manage account")} ); }; @@ -49,19 +49,19 @@ const SignOutDropdownItem = () => { const { t } = useTranslation(); return ( keycloak?.logout()}> - {t('Sign out')} + {t("Sign out")} ); }; const ServerInfoDropdownItem = () => { const { t } = useTranslation(); - return {t('Server info')}; + return {t("Server info")}; }; const HelpDropdownItem = () => { const { t } = useTranslation(); - const help = t('Help'); + const help = t("Help"); return ( @@ -90,8 +90,8 @@ const headerTools = () => { @@ -104,15 +104,15 @@ const headerTools = () => {