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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
46d284c6
Commit
46d284c6
authored
Apr 16, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gitlab.iscpif.fr:20022/gargantext/purescript-gargantext
parents
b209285d
8208ee08
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
5 deletions
+46
-5
Login.purs
src/Login.purs
+40
-2
Navigation.purs
src/Navigation.purs
+6
-3
No files found.
src/Login.purs
View file @
46d284c6
...
@@ -34,6 +34,7 @@ newtype State = State
...
@@ -34,6 +34,7 @@ newtype State = State
, password :: String
, password :: String
, response :: LoginRes
, response :: LoginRes
, errorMessage :: String
, errorMessage :: String
, loginC :: Boolean
}
}
...
@@ -43,6 +44,7 @@ initialState = State
...
@@ -43,6 +44,7 @@ initialState = State
, password : ""
, password : ""
, response : LoginRes {token : ""}
, response : LoginRes {token : ""}
, errorMessage : ""
, errorMessage : ""
, loginC : false
}
}
data Action
data Action
...
@@ -71,7 +73,7 @@ performAction (SetPassword pwd) _ _ = void do
...
@@ -71,7 +73,7 @@ performAction (SetPassword pwd) _ _ = void do
performAction Login _ (State state) = void do
performAction Login _ (State state) = void do
lift $ setHash "/search"
lift $ setHash "/search"
modifyState
id
modifyState
\(State state) -> State $ state {loginC = true}
-- res <- lift $ loginReq $ LoginReq { username : state.username, password : state.password }
-- res <- lift $ loginReq $ LoginReq { username : state.username, password : state.password }
-- case res of
-- case res of
-- Left e -> do
-- Left e -> do
...
@@ -148,6 +150,42 @@ renderSpec = simpleSpec performAction render
...
@@ -148,6 +150,42 @@ renderSpec = simpleSpec performAction render
]
]
-- div [ className "modal fade myModal"
-- , role "dialog"
-- , _data {show : true}
-- ][ div [ className "modal-dialog"
-- , role "document"
-- ] [ div [ className "modal-content"]
-- [ div [ className "modal-header"]
-- [ h5 [ className "modal-title"
-- ]
-- [ text "CorpusView"
-- ]
-- , button [ _type "button"
-- , className "close"
-- , _data { dismiss : "modal"}
-- ] [ span [ aria {hidden : true}]
-- [ text "X"]
-- ]
-- ]
-- , div [ className "modal-body"]
-- [ ul [ className "list-group"] ( map fn1 state.response ) ]
-- , div [className "modal-footer"]
-- [ button [ _type "button"
-- , className "btn btn-secondary"
-- , _data {dismiss : "modal"}
-- ] [ text "GO"]
-- ]
-- ]
-- ]
-- ]
-- ]
unsafeEventValue :: forall event. event -> String
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
unsafeEventValue e = (unsafeCoerce e).target.value
...
...
src/Navigation.purs
View file @
46d284c6
...
@@ -2,7 +2,6 @@ module Navigation where
...
@@ -2,7 +2,6 @@ module Navigation where
import DOM
import DOM
import Gargantext.Data.Lang
import Gargantext.Data.Lang
import Prelude hiding (div)
import AddCorpusview as AC
import AddCorpusview as AC
import AnnotationDocumentView as D
import AnnotationDocumentView as D
...
@@ -22,6 +21,7 @@ import Login as LN
...
@@ -22,6 +21,7 @@ import Login as LN
import NTree as NT
import NTree as NT
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..))
import PageRouter (Routes(..))
import Prelude hiding (div)
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul)
import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
...
@@ -29,7 +29,7 @@ import React.DOM.Props as RP
...
@@ -29,7 +29,7 @@ import React.DOM.Props as RP
import Routing.Hash.Aff (setHash)
import Routing.Hash.Aff (setHash)
import SearchForm as S
import SearchForm as S
import Tabview as TV
import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState)
import Thermite (PerformAction, Render, Spec, _render, cotransform, default
PerformAction, default
Render, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import UserPage as UP
import UserPage as UP
...
@@ -255,10 +255,13 @@ layout0 layout =
...
@@ -255,10 +255,13 @@ layout0 layout =
, layoutFooter
, layoutFooter
]
]
where
where
outerLayout1 = simpleSpec defaultPerformAction defaultRender
outerLayout :: Spec (E eff) AppState props Action
outerLayout :: Spec (E eff) AppState props Action
outerLayout =
outerLayout =
cont $ fold
cont $ fold
[ ls as
[ withState \st ->
if ((\(LN.State s) -> s.loginC) st.loginState == true) then ls as
else outerLayout1
, rs bs ]
, rs bs ]
ls = over _render \render d p s c ->
ls = over _render \render d p s c ->
[div [className "col-md-3"] (render d p s c)]
[div [className "col-md-3"] (render d p s c)]
...
...
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