Skip to content

Commit

Permalink
Merge pull request #74 from fga-eps-mds/fix/movements-blank-page
Browse files Browse the repository at this point in the history
fix: movements blank page after register
  • Loading branch information
lucasgbezerra authored Jul 10, 2023
2 parents 6a9d4e5 + 43902b9 commit cf6e175
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/components/movement-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ export default function MovementForm({
materiais.includes(equipment.id) ? 'rgba(244, 147, 32, 0.2)' : 'white'
}
>
<Td>{equipment.type.name}</Td>
<Td>{equipment.brand.name}</Td>
<Td>{equipment.model}</Td>
<Td>{equipment.tippingNumber}</Td>
<Td>{equipment.serialNumber}</Td>
<Td>{equipment?.type?.name}</Td>
<Td>{equipment?.brand?.name}</Td>
<Td>{equipment?.model}</Td>
<Td>{equipment?.tippingNumber}</Td>
<Td>{equipment?.serialNumber}</Td>
<Td>
<Checkbox
onChange={toggleMaterial(equipment.id)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/movements-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function MovementsModal({
}
>
<Td textAlign="center">{equipment?.tippingNumber}</Td>
<Td textAlign="center">{equipment?.type.name}</Td>
<Td textAlign="center">{equipment?.type?.name}</Td>
<Td textAlign="center">{equipment?.brand?.name}</Td>
<Td textAlign="center">{equipment?.model}</Td>
<Td textAlign="center">{equipment?.serialNumber}</Td>
Expand Down Expand Up @@ -247,7 +247,7 @@ export function MovementsModal({
}
equipments={selectedMoviment.equipments}
date={selectedMoviment.date}
destination={selectedMoviment.destination.name}
destination={selectedMoviment?.destination?.name}
/>
}
fileName={`termo_de_${
Expand Down
2 changes: 1 addition & 1 deletion src/components/movements-pdf/MovementsPdfDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export function MovementsPDF({
{equipment?.tippingNumber}
</Text>
<Text style={{ ...styles.rowData, minWidth: 60, maxWidth: 80 }}>
{equipment?.type.name}
{equipment?.type?.name}
</Text>
<Text style={{ ...styles.rowData, maxWidth: 40 }}>
{equipment?.brand?.name}
Expand Down
1 change: 0 additions & 1 deletion src/components/side-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const SideBar = memo(() => {
{ name: 'Controle de Equipamento', link: '/equipments' },
{ name: 'Controle Ordem Serviço', link: '/order-services' },
{ name: 'Movimentações', link: '/movements' },
{ name: 'Relatórios', link: '/reports' },
];
const optionUser = [
{ name: 'Controle de Cadastro', link: '/equipments-fields' },
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reports/Reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function ReportsTable() {

const formattedWorkstations = (data: Workstation[]): ISelectOption[] => {
return data?.map((item: Workstation) => {
return { label: item.name, value: item.name };
return { label: item?.name, value: item?.name };
});
};

Expand Down

0 comments on commit cf6e175

Please sign in to comment.