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
481dc3ac
Commit
481dc3ac
authored
Mar 15, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[COSMETICS] reading code.
parent
281327fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
22 deletions
+19
-22
AddCorpusview.purs
src/AddCorpusview.purs
+7
-4
DocView.purs
src/DocView.purs
+5
-6
Login.purs
src/Login.purs
+6
-8
Navigation.purs
src/Navigation.purs
+1
-4
No files found.
src/AddCorpusview.purs
View file @
481dc3ac
...
@@ -48,7 +48,7 @@ newtype Response = Response
...
@@ -48,7 +48,7 @@ newtype Response = Response
initialState :: State
initialState :: State
initialState =
initialState =
{
{
select_database : true
select_database
: true
, unselect_database : true
, unselect_database : true
, response : []
, response : []
}
}
...
@@ -62,7 +62,10 @@ data Action
...
@@ -62,7 +62,10 @@ data Action
| GO
| GO
performAction :: forall eff props. PerformAction (console :: CONSOLE, ajax :: AJAX,dom::DOM | eff) State props Action
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff ) State props Action
performAction NoOp _ _ = void do
performAction NoOp _ _ = void do
modifyState id
modifyState id
...
@@ -182,7 +185,7 @@ getDatabaseDetails reqBody = do
...
@@ -182,7 +185,7 @@ getDatabaseDetails reqBody = do
instance decodeJsonresponse :: DecodeJson Response where
instance decodeJsonresponse :: DecodeJson Response where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
count <- obj .? "count"
count <- obj .? "count"
name <- obj .? "name"
name
<- obj .? "name"
pure $ Response {count,name }
pure $ Response {count,name }
src/DocView.purs
View file @
481dc3ac
...
@@ -54,16 +54,15 @@ main = do
...
@@ -54,16 +54,15 @@ main = do
-- TODO: When a pagination link is clicked, reload data. Right now it doesn't make sense to reload mock data.
-- TODO: When a pagination link is clicked, reload data. Right now it doesn't make sense to reload mock data.
newtype Response = Response
newtype Response = Response
{ cid :: Int
{ cid
:: Int
, created :: String
, created
:: String
, favorite :: Boolean
, favorite
:: Boolean
, ngramCount :: Int
, ngramCount :: Int
, hyperdata :: Hyperdata
, hyperdata
:: Hyperdata
}
}
newtype Hyperdata = Hyperdata
newtype Hyperdata = Hyperdata
{
{ title :: String
title :: String
, source :: String
, source :: String
}
}
...
...
src/Login.purs
View file @
481dc3ac
...
@@ -151,18 +151,16 @@ unsafeEventValue e = (unsafeCoerce e).target.value
...
@@ -151,18 +151,16 @@ unsafeEventValue e = (unsafeCoerce e).target.value
getDeviseID :: forall eff. Eff (dom :: DOM | eff) (Maybe String)
getDeviseID :: forall eff. Eff (dom :: DOM | eff) (Maybe String)
getDeviseID = do
getDeviseID = do
w <- window
w
<- window
ls <- localStorage w
ls <- localStorage w
i <- getItem "token" ls
getItem "token" ls
pure $ i
setToken :: forall e . String -> Eff (dom :: DOM | e) Unit
setToken :: forall e . String -> Eff (dom :: DOM | e) Unit
setToken s = do
setToken s = do
w <- window
w
<- window
ls <- localStorage w
ls <- localStorage w
liftEff $ setItem "token" s ls
setItem "token" s ls
pure unit
...
@@ -172,7 +170,7 @@ newtype LoginRes = LoginRes
...
@@ -172,7 +170,7 @@ newtype LoginRes = LoginRes
newtype LoginReq = LoginReq
newtype LoginReq = LoginReq
{
username :: String
{ username :: String
, password :: String
, password :: String
}
}
...
@@ -210,7 +208,7 @@ loginReq encodeData =
...
@@ -210,7 +208,7 @@ loginReq encodeData =
instance decodeLoginRes :: DecodeJson LoginRes where
instance decodeLoginRes :: DecodeJson LoginRes where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
token <- obj .? "token"
token <- obj .? "token"
pure $ LoginRes { token}
pure $ LoginRes { token}
...
...
src/Navigation.purs
View file @
481dc3ac
...
@@ -286,7 +286,7 @@ sidebarnavSpec = simpleSpec performAction render
...
@@ -286,7 +286,7 @@ sidebarnavSpec = simpleSpec performAction render
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, _type "text"
, _type "text"
, style { height: "35px"
, style { height: "35px"
, width: "450px"
, width
: "450px"
-- , color: "white"
-- , color: "white"
-- , background : "#A1C2D8"
-- , background : "#A1C2D8"
}
}
...
@@ -355,15 +355,12 @@ dispatchAction dispatcher _ DocView = do
...
@@ -355,15 +355,12 @@ dispatchAction dispatcher _ DocView = do
_ <- dispatcher $ DocViewA $ DV.LoadData
_ <- dispatcher $ DocViewA $ DV.LoadData
pure unit
pure unit
dispatchAction dispatcher _ SearchView = do
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SearchA $ S.NoOp
_ <- dispatcher $ SearchA $ S.NoOp
pure unit
pure unit
dispatchAction dispatcher _ UserPage = do
dispatchAction dispatcher _ UserPage = do
_ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ UserPageA $ UP.NoOp
_ <- dispatcher $ UserPageA $ UP.NoOp
pure unit
pure unit
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