Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
139
Issues
139
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
08fc56a2
Commit
08fc56a2
authored
Jun 22, 2022
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP] forgot password route
parent
af97f328
Pipeline
#2934
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
7 deletions
+30
-7
Router.purs
src/Gargantext/Components/Router.purs
+19
-1
Router.purs
src/Gargantext/Router.purs
+2
-1
Routes.purs
src/Gargantext/Routes.purs
+9
-5
No files found.
src/Gargantext/Components/Router.purs
View file @
08fc56a2
...
...
@@ -5,7 +5,8 @@ import Gargantext.Prelude
import Data.Array (filter, length)
import Data.Array as A
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..))
import Data.Map as M
import Data.Maybe (Maybe(..), fromMaybe)
import Data.UUID (UUID)
import Data.UUID as UUID
import Effect (Effect)
...
...
@@ -316,6 +317,7 @@ renderRouteCpt = R.memo' $ here.component "renderRoute" cpt where
GR.Team s n -> team (sessionNodeProps s n) []
GR.NodeTexts s n -> texts (sessionNodeProps s n) []
GR.UserPage s n -> user (sessionNodeProps s n) []
GR.ForgotPassword p -> forgotPassword {boxes, params: p} []
]
--------------------------------------------------------------
...
...
@@ -690,3 +692,19 @@ contactCpt = here.component "contact" cpt where
} `Record.merge` sessionProps
pure $ authed authedProps []
--------------------------------------------------------------
type ForgotPasswordProps = ( params :: (M.Map String String) | Props)
forgotPassword :: R2.Component ForgotPasswordProps
forgotPassword = R.createElement forgotPasswordCpt
forgotPasswordCpt :: R.Component ForgotPasswordProps
forgotPasswordCpt = here.component "forgotPassword" cpt where
cpt { params } _ = do
pure $
H.div {} [
H.p {} [ H.text ("server: " <> fromMaybe "" (M.lookup "server" params))]
, H.p {} [ H.text ("uuid: " <> fromMaybe "" (M.lookup "uuid" params))]
]
\ No newline at end of file
src/Gargantext/Router.purs
View file @
08fc56a2
...
...
@@ -6,11 +6,12 @@ import Data.Foldable (oneOf)
import Data.Int (floor)
import Gargantext.Routes (AppRoute(..))
import Gargantext.Types (SessionId(..))
import Routing.Match (Match, lit, num, str)
import Routing.Match (Match, lit, num,
params,
str)
router :: Match AppRoute
router = oneOf
[ Login <$ route "login"
, ForgotPassword <$> (route "forgotPassword" *> params)
, Folder <$> (route "folder" *> sid) <*> int
, FolderPrivate <$> (route "folderPrivate" *> sid) <*> int
, FolderPublic <$> (route "folderPublic" *> sid) <*> int
...
...
src/Gargantext/Routes.purs
View file @
08fc56a2
...
...
@@ -4,6 +4,7 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.UUID (UUID)
import Data.Map as M
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit, ListId, DocId, NgramsGetOpts, NgramsGetTableAllOpts, NodeType, Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
import Gargantext.Types as GT
...
...
@@ -32,6 +33,7 @@ data AppRoute
| Team SessionId Int
| NodeTexts SessionId Int
| UserPage SessionId Int
| ForgotPassword (M.Map String String)
derive instance Eq AppRoute
...
...
@@ -63,6 +65,7 @@ data SessionRoute
instance Show AppRoute where
show Home = "Home"
show Login = "Login"
show (ForgotPassword u) = "ForgotPassword" <> show u
show (Folder s i) = "Folder" <> show i <> " (" <> show s <> ")"
show (FolderPrivate s i) = "FolderPrivate" <> show i <> " (" <> show s <> ")"
show (FolderPublic s i) = "FolderPublic" <> show i <> " (" <> show s <> ")"
...
...
@@ -90,11 +93,12 @@ instance Show AppRoute where
appPath :: AppRoute -> String
appPath Home = ""
appPath Login = "login"
appPath (Folder s i) = "folder/" <> show s <> "/" <> show i
appPath (FolderPrivate s i) = "folderPrivate/" <> show s <> "/" <> show i
appPath (FolderPublic s i) = "folderPublic/" <> show s <> "/" <> show i
appPath (FolderShared s i) = "folderShared/" <> show s <> "/" <> show i
appPath (Team s i) = "team/" <> show s <> "/" <> show i
appPath (ForgotPassword u) = "forgotPassword/" <> show u
appPath (Folder s i) = "folder/" <> show s <> "/" <> show i
appPath (FolderPrivate s i) = "folderPrivate/" <> show s <> "/" <> show i
appPath (FolderPublic s i) = "folderPublic/" <> show s <> "/" <> show i
appPath (FolderShared s i) = "folderShared/" <> show s <> "/" <> show i
appPath (Team s i) = "team/" <> show s <> "/" <> show i
appPath (CorpusDocument s c l i) = "corpus/" <> show s <> "/" <> show c <> "/list/" <> show l <> "/document/" <> show i
appPath (Corpus s i) = "corpus/" <> show s <> "/" <> show i
appPath (CorpusCode s i) = "corpusCode/" <> show s <> "/" <> show i
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment