Skip to content

Commit

Permalink
Merge pull request #42 from fga-eps-mds/fix#144/ordenacao-pontos-de-p…
Browse files Browse the repository at this point in the history
…artida

Fix#144/front
  • Loading branch information
DaviMatheus authored Sep 5, 2024
2 parents c4fc494 + 8df9214 commit b937e41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/app/journey-page/[journeyId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default function JourneyPage() {
backgroundColor: '#f1f1f1',
height: '100vh',
position: 'relative',
overflow: 'hidden',
}}>
{(previousJourney) &&
<IconButton onClick={handlePrevious} sx={{
Expand Down
7 changes: 7 additions & 0 deletions src/app/starting-points/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import Popup from '@/components/ui/popup';
import { toast } from 'sonner';
import { CreateStartPointForm } from '@/components/forms/createStartPoint.form';
import { UpdateStartPointForm } from '@/components/forms/editStartPoint.form';
import { useRouter } from 'next/navigation';

const StartPointPage: React.FC = () => {
const router = useRouter();
const { data: session } = useSession();
const [listStartPoints, setListStartPoints] = useState<StartPoint[]>([]);
const [filteredStartPoints, setFilteredStartPoints] = useState<StartPoint[]>([]);
Expand Down Expand Up @@ -95,6 +97,11 @@ const StartPointPage: React.FC = () => {
const handleStartPointAction = (action: string) => {
if (action === 'editar') setEditionDialogOpen(true);
if (action === 'excluir') setExclusionDialogOpen(true);
if (action === 'gerenciar') {
router.push(`/journey/${selectedStartPoint!._id}`);

}

};

const addStartPoint = (startPoint: StartPoint) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/tables/startingpoints.table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ const StartpointTable: React.FC<StartpointTableProps> = ({
onClose={onMenuClose}
>
<MenuItem onClick={() => handleMenuItemClick('editar')}>
Editar Trilha
Editar Ponto de Partida
</MenuItem>
<MenuItem onClick={() => handleMenuItemClick('gerenciar')}>
Gerenciar Trilha
Gerenciar Ponto de Partida
</MenuItem>
<MenuItem onClick={() => handleMenuItemClick('excluir')}>
Excluir
Excluir Ponto de Partida
</MenuItem>
</Menu>
</>
Expand Down

0 comments on commit b937e41

Please sign in to comment.