Skip to content
Snippets Groups Projects
Commit 5a9b9fb7 authored by brunoravera's avatar brunoravera
Browse files

fix routes

parent 0def283c
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ const run = (stage) => { ...@@ -25,7 +25,7 @@ const run = (stage) => {
break break
case 'prod': case 'prod':
convertFile('.env.staging', 'public/env.staging.js') convertFile('.env.staging', 'public/env.staging.js')
convertFile('.env.production', `public/env.${process.env.CIRCLE_SHA1}.js`) convertFile('.env.production', `public/env.production.js`)
break break
default: default:
console.error('unknown stage', stage) console.error('unknown stage', stage)
......
...@@ -11,6 +11,7 @@ export const Topbar: React.FC = () => { ...@@ -11,6 +11,7 @@ export const Topbar: React.FC = () => {
const handleOnBack = () => { const handleOnBack = () => {
if (pathname === '/') { if (pathname === '/') {
// @ts-ignore -- TODO
navigate(routes.home()) navigate(routes.home())
} else { } else {
back() back()
...@@ -39,6 +40,7 @@ export const Topbar: React.FC = () => { ...@@ -39,6 +40,7 @@ export const Topbar: React.FC = () => {
<Box /> <Box />
)} )}
{/* @ts-ignore -- TODO */}
<Link to={routes.patterns()}> <Link to={routes.patterns()}>
<Badge textAlign="right" color="gray.600" variant="-2u"> <Badge textAlign="right" color="gray.600" variant="-2u">
Patrones Patrones
......
...@@ -63,6 +63,7 @@ export const Patterns: React.FC = () => { ...@@ -63,6 +63,7 @@ export const Patterns: React.FC = () => {
data.map((pattern, index) => ( data.map((pattern, index) => (
<Tr key={`pattern-${pattern.name}-${index}`}> <Tr key={`pattern-${pattern.name}-${index}`}>
<Td> <Td>
{/* @ts-ignore -- TODO */}
<Link to={routes.pattern({ id: pattern.id })}> <Link to={routes.pattern({ id: pattern.id })}>
{pattern.name} {pattern.name}
</Link> </Link>
...@@ -110,6 +111,7 @@ const ActionsRow: React.FC<ActionsRowProps> = ({ pattern }) => { ...@@ -110,6 +111,7 @@ const ActionsRow: React.FC<ActionsRowProps> = ({ pattern }) => {
return ( return (
<> <>
<HStack spacing="0"> <HStack spacing="0">
{/* @ts-ignore -- TODO */}
<Link to={routes.pattern({ id: pattern.id })}> <Link to={routes.pattern({ id: pattern.id })}>
<Tooltip <Tooltip
hasArrow hasArrow
......
...@@ -50,6 +50,7 @@ export const RemovePatternButton: React.FC<RemovePatternButtonProps> = ({ ...@@ -50,6 +50,7 @@ export const RemovePatternButton: React.FC<RemovePatternButtonProps> = ({
}) })
queryClient.invalidateQueries(GetPatternsQuery.getKey({})) queryClient.invalidateQueries(GetPatternsQuery.getKey({}))
if (pathname.startsWith('/patterns/')) { if (pathname.startsWith('/patterns/')) {
// @ts-ignore -- TODO
navigate(routes.patterns()) navigate(routes.patterns())
} }
}, },
......
...@@ -35,7 +35,7 @@ import { ...@@ -35,7 +35,7 @@ import {
} from 'src/pages/patterns/add-pattern/use-add-formalizations' } from 'src/pages/patterns/add-pattern/use-add-formalizations'
import { FaPaperclip, FaTrash } from 'react-icons/fa' import { FaPaperclip, FaTrash } from 'react-icons/fa'
import prettyBytes from 'pretty-bytes' import prettyBytes from 'pretty-bytes'
import { CreateAnimationMutation } from '../query-builder' import { CreateAnimationMutation, GetAnimationsQuery } from '../query-builder'
const FORM_ID = 'add-animation-form' const FORM_ID = 'add-animation-form'
...@@ -50,7 +50,13 @@ export const AddAnimationModal: React.FC<AddAnimationModalProps> = ({ ...@@ -50,7 +50,13 @@ export const AddAnimationModal: React.FC<AddAnimationModalProps> = ({
...props ...props
}) => { }) => {
const queryClient = useQueryClient() const queryClient = useQueryClient()
const createAnimationMutation = CreateAnimationMutation.useMutation() const createAnimationMutation = CreateAnimationMutation.useMutation({
onSuccess: () => {
queryClient.invalidateQueries(
GetAnimationsQuery.getKey({ patternId: pattern.id })
)
},
})
const [animationFile, setAnimationFile] = React.useState<FileWithName>(null) const [animationFile, setAnimationFile] = React.useState<FileWithName>(null)
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
useDisclosure, useDisclosure,
Button, Button,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import { FaEye, FaPlay, FaTrash } from 'react-icons/fa' import { FaEye, FaTrash } from 'react-icons/fa'
import { Animation, Pattern } from 'src/models' import { Animation, Pattern } from 'src/models'
import { GetPatternQuery } from '../patterns/query-builder' import { GetPatternQuery } from '../patterns/query-builder'
......
...@@ -73,6 +73,7 @@ export const Implementations: React.FC<ImplementationsProps> = ({ ...@@ -73,6 +73,7 @@ export const Implementations: React.FC<ImplementationsProps> = ({
} }
const onViewReports = (id: Implementation['id']) => { const onViewReports = (id: Implementation['id']) => {
// @ts-ignore -- TODO
navigate(routes.reports({ implementationId: id })) navigate(routes.reports({ implementationId: id }))
} }
......
...@@ -189,6 +189,7 @@ export function useRunTestsButton({ ...@@ -189,6 +189,7 @@ export function useRunTestsButton({
const step2Mutation = RunTestsStep2Mutation.useMutation({ const step2Mutation = RunTestsStep2Mutation.useMutation({
onSuccess: (report) => { onSuccess: (report) => {
// @ts-ignore -- TODO
navigate(routes.report({ id: report.id })) navigate(routes.report({ id: report.id }))
}, },
}) })
......
...@@ -58,6 +58,7 @@ export const Reports = () => { ...@@ -58,6 +58,7 @@ export const Reports = () => {
<Tr key={`report-${report.name}-${index}`}> <Tr key={`report-${report.name}-${index}`}>
<Td>{DateUtils.formatLocalDateTime(report.createdDate)}</Td> <Td>{DateUtils.formatLocalDateTime(report.createdDate)}</Td>
<Td> <Td>
{/* @ts-ignore -- TODO */}
<Link to={routes.report({ id: report.id })}> <Link to={routes.report({ id: report.id })}>
{report.name} {report.name}
</Link> </Link>
...@@ -81,6 +82,7 @@ type ActionsRowProps = { ...@@ -81,6 +82,7 @@ type ActionsRowProps = {
const ActionsRow: React.FC<ActionsRowProps> = ({ report }) => { const ActionsRow: React.FC<ActionsRowProps> = ({ report }) => {
return ( return (
<HStack justifyContent="flex-end"> <HStack justifyContent="flex-end">
{/* @ts-ignore -- TODO */}
<Link to={routes.report({ id: report.id })}> <Link to={routes.report({ id: report.id })}>
<Tooltip shouldWrapChildren hasArrow label={<Text>Ver detalles</Text>}> <Tooltip shouldWrapChildren hasArrow label={<Text>Ver detalles</Text>}>
<IconButton <IconButton
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment