Skip to content

Commit

Permalink
Correções de erros no build do frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
rtenorioh authored Jun 7, 2022
1 parent 7e33206 commit b0f4cc6
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 58 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState, useEffect } from "react";
import React, { useState, useEffect } from "react";
import Routes from "./routes";
import "react-toastify/dist/ReactToastify.css";

Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/LocationPreview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
import toastError from "../../errors/toastError";

import Typography from "@material-ui/core/Typography";
import Grid from "@material-ui/core/Grid";

import { Button, Divider, } from "@material-ui/core";

Expand All @@ -24,7 +23,7 @@ const LocationPreview = ({ image, link, description }) => {
}}>
<div>
<div style={{ float: "left" }}>
<img src={image} onClick={handleLocation} style={{ width: "100px" }} />
<img src={image} alt="" onClick={handleLocation} style={{ width: "100px" }} />
</div>
{ description && (
<div style={{ display: "flex", flexWrap: "wrap" }}>
Expand Down
105 changes: 61 additions & 44 deletions frontend/src/components/TicketListItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { i18n } from "../../translate/i18n";
import DoneIcon from '@material-ui/icons/Done';
import VisibilityIcon from '@material-ui/icons/Visibility';
import ReplayIcon from '@material-ui/icons/Replay';
import StopIcon from '@material-ui/icons/Stop';
import api from "../../services/api";
import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
import MarkdownWrapper from "../MarkdownWrapper";
import { Tooltip } from "@material-ui/core";
import { AuthContext } from "../../context/Auth/AuthContext";
Expand Down Expand Up @@ -175,7 +175,6 @@ const TicketListItem = ({ ticket }) => {
try {
await api.put(`/tickets/${id}`, {
status: "pending",
userId: user?.id,
});
} catch (err) {
setLoading(false);
Expand All @@ -185,7 +184,7 @@ const TicketListItem = ({ ticket }) => {
setLoading(false);
}
history.push(`/tickets/${id}`);
};
};

const handleClosedTicket = async id => {
setLoading(true);
Expand All @@ -201,10 +200,10 @@ const TicketListItem = ({ ticket }) => {
if (isMounted.current) {
setLoading(false);
}
history.push(`/tickets/${id}`);
};
// history.push(`/tickets/${id}`);
};



const handleSelectTicket = id => {
history.push(`/tickets/${id}`);
};
Expand Down Expand Up @@ -294,51 +293,69 @@ const TicketListItem = ({ ticket }) => {
}
/>
{ticket.status === "pending" && (
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleAcepptTicket(ticket.id)} >
<DoneIcon />
</IconButton>
<Tooltip title={i18n.t("Aceitar")}>
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleAcepptTicket(ticket.id)} >
<DoneIcon />
</IconButton>
</Tooltip>
)}
{ticket.status === "pending" && (
<Tooltip title={i18n.t("Espiar")}>
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleViewTicket(ticket.id)} >
<VisibilityIcon />
</IconButton>
</Tooltip>
)}
{ticket.status === "pending" && (
<Tooltip title={i18n.t("Encerrar")}>
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleClosedTicket(ticket.id)} >
<ClearOutlinedIcon />
</IconButton>
</Tooltip>
)}
{ticket.status === "pending" && (
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleViewTicket(ticket.id)} >
<VisibilityIcon />
</IconButton>
)}
{ticket.status === "open" && (
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleViewTicket(ticket.id)} >
<ReplayIcon />
</IconButton>
<Tooltip title={i18n.t("Reabrir")}>
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleViewTicket(ticket.id)} >
<ReplayIcon />
</IconButton>
</Tooltip>
)}
{ticket.status === "open" && (
<Tooltip title={i18n.t("Encerrar")}>
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleClosedTicket(ticket.id)} >
<ClearOutlinedIcon />
</IconButton>
</Tooltip>
)}
{ticket.status === "open" && (
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleClosedTicket(ticket.id)} >
<StopIcon />
</IconButton>
)}
{ticket.status === "closed" && (
<IconButton
className={classes.bottomButton}
color="primary"
onClick={e => handleReopenTicket(ticket.id)} >
<ReplayIcon />
</IconButton>
)}
className={classes.bottomButton}
color="primary"
onClick={e => handleReopenTicket(ticket.id)} >
<ReplayIcon />
</IconButton>
)}
{ticket.status === "closed" && (
<IconButton
className={classes.bottomButton}
color="primary" >
</IconButton>
)}
className={classes.bottomButton}
color="primary" >
</IconButton>
)}
</ListItem>
<Divider variant="inset" component="li" />
</React.Fragment>
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/TicketsManager/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useRef, useState } from "react";
import React, { useContext, useEffect, useState } from "react";

import { makeStyles } from "@material-ui/core/styles";
import Paper from "@material-ui/core/Paper";
Expand Down Expand Up @@ -106,7 +106,6 @@ const TicketsManager = () => {
const [tabOpen, setTabOpen] = useState("open");
const [newTicketModalOpen, setNewTicketModalOpen] = useState(false);
const [showAllTickets, setShowAllTickets] = useState(false);
const searchInputRef = useRef();
const { user } = useContext(AuthContext);

const [openCount, setOpenCount] = useState(0);
Expand Down Expand Up @@ -138,10 +137,6 @@ const TicketsManager = () => {
setTab(newValue);
};

const handleChangeTabOpen = (e, newValue) => {
setTabOpen(newValue);
};

const applyPanelStyle = (status) => {
if (tabOpen !== status) {
return { width: 0, height: 0 };
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/TransferTicketModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const TransferTicketModal = ({ modalOpen, onClose, ticketid }) => {
{i18n.t("transferTicketModal.title")}
</DialogTitle>
<DialogContent dividers>
{/* <Autocomplete
<Autocomplete
style={{ width: 300, marginBottom: 20 }}
getOptionLabel={option => `${option.name}`}
onChange={(e, newValue) => {
Expand Down Expand Up @@ -164,7 +164,7 @@ const TransferTicketModal = ({ modalOpen, onClose, ticketid }) => {
}}
/>
)}
/> */}
/>
<FormControl variant="outlined" className={classes.maxWidth}>
<InputLabel>{i18n.t("transferTicketModal.fieldQueueLabel")}</InputLabel>
<Select
Expand Down
1 change: 0 additions & 1 deletion frontend/src/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { AuthContext } from "../context/Auth/AuthContext";
import BackdropLoading from "../components/BackdropLoading";
import { i18n } from "../translate/i18n";

import openSocket from "socket.io-client";
import api from "../services/api";
import toastError from "../errors/toastError";

Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Paper from "@material-ui/core/Paper";
import Typography from "@material-ui/core/Typography";
import Container from "@material-ui/core/Container";
import Select from "@material-ui/core/Select";
import TextField from "@material-ui/core/TextField";
import { toast } from "react-toastify";

import Tooltip from "@material-ui/core/Tooltip";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Signup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Link
} from '@material-ui/core';

import { LockOutlined, Visibility, VisibilityOff } from '@material-ui/icons';
import { Visibility, VisibilityOff } from '@material-ui/icons';

import { makeStyles } from "@material-ui/core/styles";

Expand Down

0 comments on commit b0f4cc6

Please sign in to comment.