From ec0b9432550a2301f87a4823249dddbb6cd882a3 Mon Sep 17 00:00:00 2001 From: Vinicius Gabriel Machado <vgm18@inf.ufpr.br> Date: Tue, 27 Jul 2021 12:58:48 -0300 Subject: [PATCH] Fixed resource page when returning from curadoria with status deleted, added route for change password page and updated redirec_url for password recovery page --- src/App.js | 2 ++ src/Components/Notifications.js | 2 +- src/Components/TabPanels/UserPageTabs/PanelAtividades.js | 2 +- src/Pages/PasswordRecoveryPage.js | 2 +- src/Pages/ResourcePage.js | 3 ++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index 5f23ceaa..c06b1193 100644 --- a/src/App.js +++ b/src/App.js @@ -40,6 +40,7 @@ const TabResourseFind = React.lazy(() => import("./Pages/TabsHelp/TabResourseFin const TabNetPart = React.lazy(() => import("./Pages/TabsHelp/TabNetPart")); const TabManageAc = React.lazy(() => import("./Pages/TabsHelp/TabManageAc")); const PasswordRecoveryPage = React.lazy(() => import("./Pages/PasswordRecoveryPage.js")); +const ChangePasswordPage = React.lazy(() => import("./Pages/ChangePasswordPage.js")); const PageProfessor = React.lazy(() => import("./Pages/PageProfessor.js")); const ResourcePage = React.lazy(() => import("./Pages/ResourcePage")); const TermsPage = React.lazy(() => import("./Pages/TermsPage.js")); @@ -208,6 +209,7 @@ export default function App() { <Route path="/participando-da-rede" component={TabNetPart} /> <Route path="/gerenciando-conta" component={TabManageAc} /> <Route path="/plataforma-mec" component={TabPlataformaMEC} /> + <Route path="/recuperar-senha/alterar-senha" component={ChangePasswordPage} /> <Route path="/recuperar-senha" component={PasswordRecoveryPage} /> <Route path="/usuario-publico/:userId" component={PublicUserPage} /> <Route diff --git a/src/Components/Notifications.js b/src/Components/Notifications.js index 854eb980..d6973d15 100644 --- a/src/Components/Notifications.js +++ b/src/Components/Notifications.js @@ -204,8 +204,8 @@ export default function Notification(props) { </div> { notifications.map((notification) => + (notification.recipient !== null) && (notification.viewed === false) && - (notification.recipient_type !== "NilClass") && <ActivityListItem onMenuBar={true} avatar={notification.owner.avatar ? apiDomain + notification.owner.avatar : null} diff --git a/src/Components/TabPanels/UserPageTabs/PanelAtividades.js b/src/Components/TabPanels/UserPageTabs/PanelAtividades.js index 90b62680..ff2126a3 100644 --- a/src/Components/TabPanels/UserPageTabs/PanelAtividades.js +++ b/src/Components/TabPanels/UserPageTabs/PanelAtividades.js @@ -188,7 +188,7 @@ export default function TabPanelAtividades(props) { <List height={400} width={300}> { notifications.map((notification, id) => - (notification.recipient_type !== "NilClass") && + (notification.recipient !== null) && <ActivityListItem key={id} onMenuBar={false} diff --git a/src/Pages/PasswordRecoveryPage.js b/src/Pages/PasswordRecoveryPage.js index 4a6b2572..1ed9b8cc 100644 --- a/src/Pages/PasswordRecoveryPage.js +++ b/src/Pages/PasswordRecoveryPage.js @@ -48,7 +48,7 @@ export default function PasswordRecoveryPage (props) { const payload = { "email" : formEmail.value, - "redirect_url" : "http://localhost:4000/recuperar-senha/alterar-senha" // ### arrumar "https://plataformaintegrada.mec.gov.br/recuperar-senha/alterar-senha" + "redirect_url" : "https://plataformaintegrada.mec.gov.br/recuperar-senha/alterar-senha" //"http://localhost:4000/recuperar-senha/alterar-senha" } postRequest(url, payload, handleSuccessfulSubmit, (error) => {console.log(error)}) diff --git a/src/Pages/ResourcePage.js b/src/Pages/ResourcePage.js index e4a6c80f..37d96115 100644 --- a/src/Pages/ResourcePage.js +++ b/src/Pages/ResourcePage.js @@ -138,7 +138,8 @@ export default function LearningObjectPage(props) { setRecurso(data); }, (error) => { - handleSnackbar(7) + handleSnackbar(7); + setErro(true); } ); }; -- GitLab