mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
improvement: better names in pages, folders and routes
This commit is contained in:
@@ -22,7 +22,7 @@ If a contact sent a new message in less than 2 hours interval, and there is no t
|
|||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/canove/whaticket/master/images/chat2.png" width="350"> <img src="https://raw.githubusercontent.com/canove/whaticket/master/images/chat3.png" width="350">
|
<img src="https://raw.githubusercontent.com/canove/whaticket/master/images/tickets2.png" width="350"> <img src="https://raw.githubusercontent.com/canove/whaticket/master/images/tickets3.png" width="350">
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ const MessagesList = () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
toast.error("Ticket não encontrado");
|
toast.error("Ticket não encontrado");
|
||||||
history.push("/chat");
|
history.push("/tickets");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fetchMessages();
|
fetchMessages();
|
||||||
@@ -418,7 +418,7 @@ const MessagesList = () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
history.push("/chat");
|
history.push("/tickets");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDrawerOpen = () => {
|
const handleDrawerOpen = () => {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const NewTicketModal = ({ modalOpen, onClose, contactId }) => {
|
|||||||
userId: userId,
|
userId: userId,
|
||||||
status: "open",
|
status: "open",
|
||||||
});
|
});
|
||||||
history.push(`/chat/${ticket.id}`);
|
history.push(`/tickets/${ticket.id}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(err);
|
alert(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ const NotificationsPopOver = () => {
|
|||||||
|
|
||||||
notification.onclick = function (event) {
|
notification.onclick = function (event) {
|
||||||
event.preventDefault(); //
|
event.preventDefault(); //
|
||||||
window.open(`/chat/${ticket.id}`, "_self");
|
window.open(`/tickets/${ticket.id}`, "_self");
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("visibilitychange", () => {
|
document.addEventListener("visibilitychange", () => {
|
||||||
@@ -137,7 +137,7 @@ const NotificationsPopOver = () => {
|
|||||||
}, [setIsOpen]);
|
}, [setIsOpen]);
|
||||||
|
|
||||||
const handleSelectTicket = (e, ticket) => {
|
const handleSelectTicket = (e, ticket) => {
|
||||||
history.push(`/chat/${ticket.id}`);
|
history.push(`/tickets/${ticket.id}`);
|
||||||
handleClickAway();
|
handleClickAway();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -100,11 +100,11 @@ const TicketListItem = ({ ticket }) => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(err);
|
alert(err);
|
||||||
}
|
}
|
||||||
history.push(`/chat/${ticketId}`);
|
history.push(`/tickets/${ticketId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectTicket = (e, ticket) => {
|
const handleSelectTicket = (e, ticket) => {
|
||||||
history.push(`/chat/${ticket.id}`);
|
history.push(`/tickets/${ticket.id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const TicketOptionsMenu = ({ ticket, menuOpen, handleClose, anchorEl }) => {
|
|||||||
try {
|
try {
|
||||||
await api.delete(`/tickets/${ticket.id}`);
|
await api.delete(`/tickets/${ticket.id}`);
|
||||||
toast.success("Ticket deletado com sucesso.");
|
toast.success("Ticket deletado com sucesso.");
|
||||||
history.push("/chat");
|
history.push("/tickets");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast.error("Erro ao deletar o ticket");
|
toast.error("Erro ao deletar o ticket");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ const MainListItems = () => {
|
|||||||
<div>
|
<div>
|
||||||
<ListItemLink to="/" primary="Dashboard" icon={<DashboardIcon />} />
|
<ListItemLink to="/" primary="Dashboard" icon={<DashboardIcon />} />
|
||||||
<ListItemLink
|
<ListItemLink
|
||||||
to="/whats-auth"
|
to="/connection"
|
||||||
primary={i18n.t("mainDrawer.listItems.connection")}
|
primary={i18n.t("mainDrawer.listItems.connection")}
|
||||||
icon={<SyncAltIcon />}
|
icon={<SyncAltIcon />}
|
||||||
/>
|
/>
|
||||||
<ListItemLink
|
<ListItemLink
|
||||||
to="/chat"
|
to="/tickets"
|
||||||
primary={i18n.t("mainDrawer.listItems.tickets")}
|
primary={i18n.t("mainDrawer.listItems.tickets")}
|
||||||
icon={<WhatsAppIcon />}
|
icon={<WhatsAppIcon />}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const useAuth = () => {
|
|||||||
api.defaults.headers.Authorization = `Bearer ${res.data.token}`;
|
api.defaults.headers.Authorization = `Bearer ${res.data.token}`;
|
||||||
setIsAuth(true);
|
setIsAuth(true);
|
||||||
toast.success(i18n.t("auth.toasts.success"));
|
toast.success(i18n.t("auth.toasts.success"));
|
||||||
history.push("/chat");
|
history.push("/tickets");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast.error(i18n.t("auth.toasts.fail"));
|
toast.error(i18n.t("auth.toasts.fail"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const WhatsAuth = () => {
|
|||||||
if (data.action === "authentication") {
|
if (data.action === "authentication") {
|
||||||
setQrCode("");
|
setQrCode("");
|
||||||
setSession(data.session);
|
setSession(data.session);
|
||||||
history.push("/chat");
|
history.push("/tickets");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
0
frontend/src/pages/Settings/index.js
Normal file
0
frontend/src/pages/Settings/index.js
Normal file
@@ -4,10 +4,10 @@ import { ToastContainer } from "react-toastify";
|
|||||||
|
|
||||||
import MainDrawer from "../components/_layout";
|
import MainDrawer from "../components/_layout";
|
||||||
import Dashboard from "../pages/Dashboard/";
|
import Dashboard from "../pages/Dashboard/";
|
||||||
import Chat from "../pages/Chat/";
|
import Tickets from "../pages/Tickets/";
|
||||||
import Signup from "../pages/Signup/";
|
import Signup from "../pages/Signup/";
|
||||||
import Login from "../pages/Login/";
|
import Login from "../pages/Login/";
|
||||||
import WhatsAuth from "../pages/WhatsAuth/WhatsAuth";
|
import Connection from "../pages/Connection/";
|
||||||
import Users from "../pages/Users";
|
import Users from "../pages/Users";
|
||||||
import Contacts from "../pages/Contacts/";
|
import Contacts from "../pages/Contacts/";
|
||||||
import { AuthProvider } from "../context/Auth/AuthContext";
|
import { AuthProvider } from "../context/Auth/AuthContext";
|
||||||
@@ -22,8 +22,13 @@ const Routes = () => {
|
|||||||
<Route exact path="/signup" component={Signup} />
|
<Route exact path="/signup" component={Signup} />
|
||||||
<MainDrawer>
|
<MainDrawer>
|
||||||
<Route exact path="/" component={Dashboard} isPrivate />
|
<Route exact path="/" component={Dashboard} isPrivate />
|
||||||
<Route exact path="/chat/:ticketId?" component={Chat} isPrivate />
|
<Route
|
||||||
<Route exact path="/whats-auth" component={WhatsAuth} isPrivate />
|
exact
|
||||||
|
path="/tickets/:ticketId?"
|
||||||
|
component={Tickets}
|
||||||
|
isPrivate
|
||||||
|
/>
|
||||||
|
<Route exact path="/connection" component={Connection} isPrivate />
|
||||||
<Route exact path="/contacts" component={Contacts} isPrivate />
|
<Route exact path="/contacts" component={Contacts} isPrivate />
|
||||||
<Route exact path="/users" component={Users} isPrivate />
|
<Route exact path="/users" component={Users} isPrivate />
|
||||||
</MainDrawer>
|
</MainDrawer>
|
||||||
|
|||||||
Reference in New Issue
Block a user