Skip to content

Commit

Permalink
Merge pull request #196 from usdevs/zsheng/fix-org-and-ci
Browse files Browse the repository at this point in the history
fix: update org input for bookings
  • Loading branch information
zsh-eng authored Mar 22, 2024
2 parents 09bcf99 + 30f5e68 commit 884a63b
Show file tree
Hide file tree
Showing 27 changed files with 3,029 additions and 12,217 deletions.
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
]
},
"ignorePatterns": ["next.config.js"],
"root": true
}
29 changes: 23 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ jobs:
name: Run linters
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -34,11 +44,18 @@ jobs:
- name: Install Node.js dependencies
run: npm ci

- name: Run lint-action linters
uses: wearerequired/[email protected]
with:
eslint: true
prettier: true
- name: Super-Linter
uses: super-linter/[email protected]
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: .
TYPESCRIPT_ES_CONFIG_FILE: .eslintrc
VALIDATE_ALL_CODEBASE: false
VALIDATE_TYPESCRIPT_ES: true
VALIDATE_TSX: true
VALIDATE_TYPESCRIPT_STANDARD: true

- name: Run next linters
run: npm run linter-next

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ _static
# local env files
.env*.local

/.vscode
4 changes: 2 additions & 2 deletions components/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const Auth: React.FC = () => {
username: userCredentials.username,
}
setAuth({ token, orgIds, userInfo, userId, permissions, setupTime: new Date() })
window.location.reload()
})
.catch((error) => {
alert(error)
Expand All @@ -52,8 +53,6 @@ const Auth: React.FC = () => {
useEffect(() => {
const cleanup = async () => {
if (!isUserLoggedIn(authOrNull)) return

// @ts-ignore because we do the null check already
const { setupTime } = authOrNull
const timeSinceSetup = Date.now() - (setupTime as unknown as number)
if (timeSinceSetup >= (30 + 1) * 60 * 1000) {
Expand All @@ -74,6 +73,7 @@ const Auth: React.FC = () => {
auth_date: 0,
hash: 'none',
})
window.location.reload()
}

const loginButtonDev = <Button onClick={handleDevAuth}>Login for dev</Button>
Expand Down
1 change: 0 additions & 1 deletion components/LandingPageBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const LandingPageBanner: React.FC<LandingPageBannerProps> = ({
}

export const MobileLandingPageBanner: React.FC<LandingPageBannerProps> = ({
left,
buttonUrl,
description,
imageUrl,
Expand Down
2 changes: 1 addition & 1 deletion components/VenueMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const VenueMap: React.FC = () => {
return (
<>
{!isSsr && (
<Map width='100%' height='100%' center={DEFAULT_CENTER} zoom={17}>
<Map width='100%' height='100%' center={DEFAULT_CENTER as number[]} zoom={17}>
{(
{ TileLayer, Polygon, Polyline }: VenueMapProps,
TempIcon: typeof Icon,
Expand Down
6 changes: 1 addition & 5 deletions components/admin/orgs/OrganisationControlFormPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ import {
import { Form, Formik } from 'formik'

import { OrganisationForm } from '@/types/bookings.types'
import { SelectProps } from '@/types/form.types'

import FormCheckbox from '@/components/form/FormCheckbox'
import FormMultiSelect from '@/components/form/FormMultiSelect'
import FormSelect from '@/components/form/FormSelect'
import FormTextArea from '@/components/form/FormTextArea'
import FormTextField from '@/components/form/FormTextField'

export type SelectProps<T> = {
value: T
label: string
}

type ModalProps = {
isOpen: boolean
onClose: () => void
Expand Down
Loading

0 comments on commit 884a63b

Please sign in to comment.