Commit 4ed9119b authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Get List.

parent eaaa8328
...@@ -142,11 +142,11 @@ uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt ...@@ -142,11 +142,11 @@ uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt
-- START File Type View -- START File Type View
type FileTypeProps = type FileTypeProps =
( action :: Action -> Aff Unit ( action :: Action -> Aff Unit
, droppedFile :: R.State (Maybe DroppedFile) , droppedFile :: R.State (Maybe DroppedFile)
, id :: ID , id :: ID
, isDragOver :: R.State Boolean , isDragOver :: R.State Boolean
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
) )
fileTypeView :: Record FileTypeProps -> R.Element fileTypeView :: Record FileTypeProps -> R.Element
...@@ -246,9 +246,9 @@ uploadFile session nodeType id fileType {mName, contents: UploadFileContents con ...@@ -246,9 +246,9 @@ uploadFile session nodeType id fileType {mName, contents: UploadFileContents con
--p = NodeAPI GT.Corpus (Just id) $ "add/file/async/nobody" <> Q.print (toQuery q) --p = NodeAPI GT.Corpus (Just id) $ "add/file/async/nobody" <> Q.print (toQuery q)
p = GR.NodeAPI nodeType (Just id) $ GT.asyncTaskTypePath GT.Form p = GR.NodeAPI nodeType (Just id) $ GT.asyncTaskTypePath GT.Form
bodyParams = [ bodyParams = [
Tuple "_wf_data" (Just contents) Tuple "_wf_data" (Just contents)
, Tuple "_wf_filetype" (Just $ show fileType) , Tuple "_wf_filetype" (Just $ show fileType)
, Tuple "_wf_name" mName , Tuple "_wf_name" mName
] ]
uploadTermListView :: Record Props -> R.Element uploadTermListView :: Record Props -> R.Element
...@@ -273,7 +273,7 @@ uploadTermListViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadTermListView" cpt ...@@ -273,7 +273,7 @@ uploadTermListViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadTermListView" cpt
onChangeContents :: forall e. R.State (Maybe UploadFile) -> E.SyntheticEvent_ e -> Effect Unit onChangeContents :: forall e. R.State (Maybe UploadFile) -> E.SyntheticEvent_ e -> Effect Unit
onChangeContents (mFile /\ setMFile) e = do onChangeContents (mFile /\ setMFile) e = do
let mF = R2.inputFileNameWithBlob 0 e let mF = R2.inputFileNameWithBlob 0 e
E.preventDefault e E.preventDefault e
E.stopPropagation e E.stopPropagation e
case mF of case mF of
Nothing -> pure unit Nothing -> pure unit
......
...@@ -418,11 +418,13 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt ...@@ -418,11 +418,13 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
cpt {action: Upload, dispatch, id, nodeType, session} _ = do cpt {action: Upload, dispatch, id, nodeType, session} _ = do
pure $ uploadFileView {dispatch, id, nodeType, session} pure $ uploadFileView {dispatch, id, nodeType, session}
cpt {action: Download, id, nodeType: NodeList, session} _ = do cpt {action: Download, id, nodeType: NodeList, session} _ = do
let href = url session $ Routes.NodeAPI GT.Node (Just id) "" let href = url session $ Routes.NodeAPI GT.NodeList (Just id) ""
pure $ R.fragment [ pure $ R.fragment [
H.span { className: "row" } [ H.span { className: "row" }
H.a { className: "col-md-12", href, target: "_blank" } [ H.text "Download file" ] [ H.a { className: "col-md-12"
] , href
, target: "_blank" } [ H.text "Download file" ]
]
] ]
cpt {action: Download} _ = do cpt {action: Download} _ = do
pure $ fragmentPT "Soon, you will be able to dowload your file here" pure $ fragmentPT "Soon, you will be able to dowload your file here"
......
...@@ -153,7 +153,7 @@ instance showNodeType :: Show NodeType where ...@@ -153,7 +153,7 @@ instance showNodeType :: Show NodeType where
show Folder = "NodeFolder" show Folder = "NodeFolder"
show FolderPrivate = "NodeFolderPrivate" -- Node Private Worktop show FolderPrivate = "NodeFolderPrivate" -- Node Private Worktop
show FolderShared = "NodeFolderShared" -- Node Share Worktop show FolderShared = "NodeFolderShared" -- Node Share Worktop
show FolderPublic = "NodeFolderPublic" -- Node Public Worktop show FolderPublic = "NodeFolderPublic" -- Node Public Worktop
show Annuaire = "NodeAnnuaire" show Annuaire = "NodeAnnuaire"
...@@ -453,7 +453,7 @@ data AsyncTaskType = Form | Query ...@@ -453,7 +453,7 @@ data AsyncTaskType = Form | Query
derive instance genericAsyncTaskType :: Generic AsyncTaskType _ derive instance genericAsyncTaskType :: Generic AsyncTaskType _
asyncTaskTypePath :: AsyncTaskType -> String asyncTaskTypePath :: AsyncTaskType -> String
asyncTaskTypePath Form = "add/form/async/" asyncTaskTypePath Form = "add/form/async/"
asyncTaskTypePath Query = "add/query/async/" asyncTaskTypePath Query = "add/query/async/"
type AsyncTaskID = String type AsyncTaskID = String
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment