Skip to content
Snippets Groups Projects
Commit 98dbdd49 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge remote-tracking branch 'origin/dev' into renovate/react-toastify-10.x

parents 50739fa6 e2a995e2
No related branches found
No related tags found
1 merge request!136fix(deps): update dependency react-toastify to v10
......@@ -16,7 +16,7 @@ stages:
build-test:
stage: build
image: node:18.17-alpine
image: node:18.20-alpine
before_script:
- apk add git
- apk add bash
......
18.17
\ No newline at end of file
18.20
\ No newline at end of file
import { useQuery } from '@tanstack/react-query'
import axios, { AxiosRequestConfig } from 'axios'
import { useQuery } from 'react-query'
import { toast } from 'react-toastify'
import { User } from './models/user.model'
const fetchWhoAmI = async () => {
const { data } = await axios.get<User | null>('/api/common/WhoAmI')
return data
try {
const { data } = await axios.get<User | null>('/api/common/WhoAmI')
return data
} catch (error) {
console.error('error whoami', error)
toast.error('Accès refusé, veuillez vous connecter')
}
}
export const useWhoAmI = () => {
......@@ -13,10 +18,7 @@ export const useWhoAmI = () => {
queryKey: ['WhoAmI'],
queryFn: fetchWhoAmI,
retry: false,
onError: error => {
console.error('error whoami', error)
toast.error('Accès refusé, veuillez vous connecter')
},
refetchOnMount: false,
})
}
......
import { ThemeProvider } from '@mui/material'
import { QueryClient, QueryClientProvider } from 'react-query'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { BrowserRouter } from 'react-router-dom'
import { ToastContainer } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
......
......@@ -66,7 +66,7 @@ export const Consents: React.FC<{ type: 'sge' | 'grdf' }> = ({ type }) => {
},
[]
)
const handleChangeRowsPerPage = useCallback(event => {
const handleChangeRowsPerPage = useCallback((event: any) => {
setRowsPerPage(event.target.value)
setPage(0)
}, [])
......
import { Button, Dialog, Pagination } from '@mui/material'
import { useQuery } from '@tanstack/react-query'
import React, { useState } from 'react'
import { useQuery } from 'react-query'
import { fetchEcogestureImages, useWhoAmI } from '../../API'
import { getAxiosXSRFHeader } from '../../axios.config'
import SingleImage from './SingleImage'
......
......@@ -229,7 +229,7 @@ const Popups: React.FC = () => {
}
setCustomPopup(prev => ({
...prev,
endDate: newDate.toISO(),
endDate: newDate.toISO() || '',
}))
}, [popupDuration])
......
import { Button } from '@mui/material'
import { useMutation } from '@tanstack/react-query'
import React from 'react'
import { useMutation } from 'react-query'
import { NavLink } from 'react-router-dom'
import { fetchLogout, useWhoAmI } from '../../API'
import logo from '../../assets/icons/ecolyo-logo.svg'
......
import React from 'react'
import ReactDOM from 'react-dom'
import './styles/index.scss'
import { createRoot } from 'react-dom/client'
import App from './App'
import reportWebVitals from './reportWebVitals'
import './styles/index.scss'
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
)
const container = document.getElementById('root')
const root = createRoot(container!)
root.render(<App />)
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
......
......@@ -8,14 +8,12 @@ export default defineConfig({
plugins: [react(), basicSsl()],
preview: {
port: 3000,
https: true,
strictPort: true,
host: true,
open: 'https://localhost/',
},
server: {
port: 3000,
https: true,
strictPort: true,
host: true,
open: 'https://localhost/', // directly opens site through nginx
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment