Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HFRONT-1133]: upgrade date-fns and react-datepicker to the latest versions #582

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
uses: chromaui/action@latest
with:
projectToken: chpt_a6f31d991d0cce7
onlyChanged: true

- name: Install chromium
run: pnpm playwright install chromium
Expand Down
15 changes: 15 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import type { StorybookConfig } from '@storybook/react-vite';
import turbosnap from 'vite-plugin-turbosnap';
import { mergeConfig } from 'vite';

const config: StorybookConfig = {
async viteFinal(config, { configType }) {
return mergeConfig(config, {
plugins:
configType === 'PRODUCTION'
? [
turbosnap({
// This should be the base path of your storybook. In monorepos, you may only need process.cwd().
rootDir: config.root ?? process.cwd(),
}),
]
: [],
});
},
stories: [
'../src/**/*/stories.@(ts|tsx)',
'../src/**/*.stories.@(js|jsx|ts|tsx)',
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"@uiw/codemirror-theme-darcula": "^4.21.22",
"@uiw/react-codemirror": "^4.21.22",
"chakra-react-select": "^4.7.6",
"date-fns": "^2.30.0",
"date-fns": "^3.3.1",
"emotion-theming": "^10.3.0",
"ramda": "^0.28.0",
"react-datepicker": "^4.23.0",
"react-datepicker": "^6.1.0",
"rebass": "^4.0.7"
},
"devDependencies": {
Expand Down Expand Up @@ -104,7 +104,7 @@
"@types/node": "^20.11.19",
"@types/ramda": "^0.28.1",
"@types/react": "^18.2.57",
"@types/react-datepicker": "^4.19.3",
"@types/react-datepicker": "^6.0.1",
"@types/react-dom": "^18.2.19",
"@types/rebass": "^4.0.14",
"@types/rebass__forms": "^4.0.10",
Expand Down Expand Up @@ -139,6 +139,7 @@
"vite-plugin-css-injected-by-js": "^3.4.0",
"vite-plugin-dts": "^3.7.2",
"vite-plugin-svgr": "^4.2.0",
"vite-plugin-turbosnap": "^1.0.3",
"wait-on": "^7.2.0",
"yalc": "^1.0.0-pre.53"
},
Expand Down
98 changes: 59 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/components/file-system-explorer/info/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box, BoxProps, Flex } from 'rebass';

import { format } from 'date-fns';
import Value from '../../typography/value';

import Value from '../../typography/value';
import {
FileExplorerInfoStyle,
blockInfoStyles,
Expand All @@ -14,6 +13,8 @@ import { Button } from '../../button';
import formatSizeUnits from '../../../utils/getFormatSizeUnit';
import { GetIcon, IconName } from '../../icon';

const dateFormat = (date: string) =>
format(new Date(date), 'yyyy-MM-dd - HH:mm:ss');
export interface FileExplorerInfoProps extends Omit<BoxProps, 'css'> {
children?: string[];
activeFile?: ActiveFile | null;
Expand All @@ -27,9 +28,6 @@ const FileExplorerInfo = ({
disableDownload,
handleDownloadFile,
}: FileExplorerInfoProps) => {
const dateFormat = (date: string) =>
format(new Date(date), 'yyyy-MM-dd - HH:mm:ss');

return (
<Box
sx={{
Expand Down