From 67aee49a43a06026dc361e02fbf00429887f674d Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Mon, 7 Aug 2023 14:52:03 +0200 Subject: [PATCH 1/3] fix: 'mb' -> 'MiB' --- src/components/common/FeatureCard/types.ts | 1 + src/components/pages/dashboard/index/AllTabContent/cmp.tsx | 2 +- .../pages/dashboard/index/VolumesTabContent/cmp.tsx | 2 +- src/components/pages/dashboard/manage/ManageFunction/cmp.tsx | 2 +- src/components/pages/dashboard/manage/ManageVolume/cmp.tsx | 2 +- src/components/pages/dashboard/manage/VolumeList/cmp.tsx | 4 ++-- src/domain/volume.ts | 1 - 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/common/FeatureCard/types.ts b/src/components/common/FeatureCard/types.ts index 7da6c5a9..9c4012cb 100644 --- a/src/components/common/FeatureCard/types.ts +++ b/src/components/common/FeatureCard/types.ts @@ -1,4 +1,5 @@ export type FeatureCardProps = { children: React.ReactNode disabled?: boolean + disabledText?: string } diff --git a/src/components/pages/dashboard/index/AllTabContent/cmp.tsx b/src/components/pages/dashboard/index/AllTabContent/cmp.tsx index 47d592f5..fe746925 100644 --- a/src/components/pages/dashboard/index/AllTabContent/cmp.tsx +++ b/src/components/pages/dashboard/index/AllTabContent/cmp.tsx @@ -36,7 +36,7 @@ export const AllTabContent = React.memo(({ data }: AllTabContentProps) => { label: 'Size', align: 'right', sortable: true, - render: (row) => humanReadableSize(row.size, 'mb'), + render: (row) => humanReadableSize(row.size, 'MiB'), }, { label: 'Date', diff --git a/src/components/pages/dashboard/index/VolumesTabContent/cmp.tsx b/src/components/pages/dashboard/index/VolumesTabContent/cmp.tsx index e0bac414..96500599 100644 --- a/src/components/pages/dashboard/index/VolumesTabContent/cmp.tsx +++ b/src/components/pages/dashboard/index/VolumesTabContent/cmp.tsx @@ -31,7 +31,7 @@ export const VolumesTabContent = React.memo( label: 'Size', align: 'right', sortable: true, - render: (row) => humanReadableSize(row.size || 0, 'mb'), + render: (row) => humanReadableSize(row.size || 0, 'MiB'), }, { label: 'Date', diff --git a/src/components/pages/dashboard/manage/ManageFunction/cmp.tsx b/src/components/pages/dashboard/manage/ManageFunction/cmp.tsx index a0e96b42..6aaab552 100644 --- a/src/components/pages/dashboard/manage/ManageFunction/cmp.tsx +++ b/src/components/pages/dashboard/manage/ManageFunction/cmp.tsx @@ -118,7 +118,7 @@ export default function ManageFunction() {
SIZE
- {humanReadableSize(func.size, 'mb')} + {humanReadableSize(func.size, 'MiB')}
diff --git a/src/components/pages/dashboard/manage/ManageVolume/cmp.tsx b/src/components/pages/dashboard/manage/ManageVolume/cmp.tsx index c0bb0b53..685d26a9 100644 --- a/src/components/pages/dashboard/manage/ManageVolume/cmp.tsx +++ b/src/components/pages/dashboard/manage/ManageVolume/cmp.tsx @@ -100,7 +100,7 @@ export default function ManageVolume() {
SIZE
- {humanReadableSize(volume.size, 'mb')} + {humanReadableSize(volume.size, 'MiB')}
diff --git a/src/components/pages/dashboard/manage/VolumeList/cmp.tsx b/src/components/pages/dashboard/manage/VolumeList/cmp.tsx index 1b2b4c99..557fd7ed 100644 --- a/src/components/pages/dashboard/manage/VolumeList/cmp.tsx +++ b/src/components/pages/dashboard/manage/VolumeList/cmp.tsx @@ -25,7 +25,7 @@ export const VolumeList = React.memo(
PERSISTENT VOLUME
- {humanReadableSize(volume.size_mib, 'mb')} + {humanReadableSize(volume.size_mib, 'MiB')}
@@ -34,7 +34,7 @@ export const VolumeList = React.memo(
EPHEMERAL VOLUME
- {humanReadableSize(volume.size_mib, 'mb')} + {humanReadableSize(volume.size_mib, 'MiB')}
diff --git a/src/domain/volume.ts b/src/domain/volume.ts index 3d7b1850..6e8a1d10 100644 --- a/src/domain/volume.ts +++ b/src/domain/volume.ts @@ -5,7 +5,6 @@ import { EntityType, VolumeType, defaultVolumeChannel, - pricePerMiB, programStorageURL, } from '../helpers/constants' import { From b528c14ca8a58626671253e10215d2227e004d53 Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Mon, 7 Aug 2023 14:52:18 +0200 Subject: [PATCH 2/3] fix: lint error (undef return type) --- src/hooks/common/useForm.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/common/useForm.ts b/src/hooks/common/useForm.ts index 98c13a5b..473448b9 100644 --- a/src/hooks/common/useForm.ts +++ b/src/hooks/common/useForm.ts @@ -24,7 +24,9 @@ export type UseFormReturn< handleSubmit: (e: FormEvent) => Promise } -function getFirstError(errors: FieldErrors) { +function getFirstError( + errors: FieldErrors, +): [string, any] | undefined { const [firstError] = Object.entries(errors) if (!firstError) return From f4fcc9ffd3708fd825bdb888e08fbec13f726a27 Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Mon, 7 Aug 2023 15:25:19 +0200 Subject: [PATCH 3/3] feat: add an action to check if the project builds --- .github/workflows/build_check.yaml | 28 ++++++++++++++++++++++++++++ .github/workflows/publish.yaml | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build_check.yaml diff --git a/.github/workflows/build_check.yaml b/.github/workflows/build_check.yaml new file mode 100644 index 00000000..94eb409e --- /dev/null +++ b/.github/workflows/build_check.yaml @@ -0,0 +1,28 @@ +name: Build Check + +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Install and Build + env: + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} + run: | + npm config set "@fortawesome:registry" https://npm.fontawesome.com/ + npm config set "//npm.fontawesome.com/:_authToken" FONTAWESOME_NPM_AUTH_TOKEN + npm ci + npm run build diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index da3d0631..9acb5fa9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,7 +7,7 @@ on: env: IS_GH_PAGES: gh-pages - + jobs: build-and-deploy: runs-on: ubuntu-latest @@ -19,7 +19,7 @@ jobs: - name: Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: npm - name: Install and Build