Commit 88baa433 authored by Fabien Maniere's avatar Fabien Maniere

files clean/lint

parent cd69d92a
...@@ -89,7 +89,7 @@ component = R.hooksComponent componentName cpt ...@@ -89,7 +89,7 @@ component = R.hooksComponent componentName cpt
[ bootstrapName [ bootstrapName
, bootstrapName <> "-" <> name , bootstrapName <> "-" <> name
] ]
componentLabel = props.showLabel ? props.title $ "" componentLabel = props.showLabel ? props.title $ ""
-- Behaviors -- Behaviors
let let
...@@ -107,10 +107,9 @@ component = R.hooksComponent componentName cpt ...@@ -107,10 +107,9 @@ component = R.hooksComponent componentName cpt
{ title: props.title { title: props.title
, className: contentClassName , className: contentClassName
} }
[ [ H.span { className: "font-family-theme text-small" }
H.span { className: "font-family-theme text-small" } [ [ H.text $ " " <> componentLabel <> " "
H.text $ " " <> componentLabel <> " " ]
]
] ]
] ]
] ]
......
...@@ -132,7 +132,7 @@ addNodeViewCpt = here.component "addNodeView" cpt ...@@ -132,7 +132,7 @@ addNodeViewCpt = here.component "addNodeView" cpt
] ]
else [] else []
pure $ pure $
Tools.panelWithSubmitButton Tools.panelWithSubmitButton
{ action { action
, dispatch , dispatch
...@@ -140,10 +140,10 @@ addNodeViewCpt = here.component "addNodeView" cpt ...@@ -140,10 +140,10 @@ addNodeViewCpt = here.component "addNodeView" cpt
, iconName: "plus" , iconName: "plus"
, textTitle: "Add a child node element" , textTitle: "Add a child node element"
} }
[ H.div { className: "pt-2" } [ H.div { className: "pt-2" }
(maybeChoose <> maybeEdit) (maybeChoose <> maybeEdit)
] ]
-- END Create Node -- END Create Node
showConfig :: NodeType -> R.Element showConfig :: NodeType -> R.Element
......
...@@ -58,8 +58,8 @@ actionDeleteUserCpt = here.component "actionDeleteUser" cpt ...@@ -58,8 +58,8 @@ actionDeleteUserCpt = here.component "actionDeleteUser" cpt
where where
cpt _ _ = do cpt _ _ = do
pure $ pure $
Tools.panelNoFooter { Tools.panelNoFooter
mError: Nothing { mError: Nothing
, iconName: "" , iconName: ""
, textTitle: "Delete user" , textTitle: "Delete user"
} }
......
...@@ -225,8 +225,8 @@ actionDownloadPhyloCpt = here.component "actionDownloadPhylo" cpt ...@@ -225,8 +225,8 @@ actionDownloadPhyloCpt = here.component "actionDownloadPhylo" cpt
{ action: DownloadNode { action: DownloadNode
, href: href downloadFormat' , href: href downloadFormat'
, mError: Nothing , mError: Nothing
, iconName: "download" , iconName: "download"
, textTitle: "Download the phylomemy" , textTitle: "Download the phylomemy"
} }
[ R2.select [ R2.select
{ className: "form-control" { className: "form-control"
......
...@@ -80,8 +80,8 @@ linkNodeCpt' = here.component "__clone__" cpt ...@@ -80,8 +80,8 @@ linkNodeCpt' = here.component "__clone__" cpt
_ -> mempty _ -> mempty
pure $ pure $
Tools.panel { Tools.panel
mError: Nothing { mError: Nothing
, iconName: "link" , iconName: "link"
, textTitle: "Link" , textTitle: "Link"
} }
......
...@@ -20,7 +20,6 @@ import Reactix as R ...@@ -20,7 +20,6 @@ import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.ManageTeam" here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.ManageTeam"
...@@ -92,28 +91,28 @@ teamLayoutRowsCpt = here.component "teamLayoutRows" cpt ...@@ -92,28 +91,28 @@ teamLayoutRowsCpt = here.component "teamLayoutRows" cpt
let focusOnShareTab = \_ -> tabFocusHandler Share let focusOnShareTab = \_ -> tabFocusHandler Share
pure $ pure $
Tools.panelNoFooter { Tools.panelNoFooter
mError: error' { mError: error'
, iconName: "users" , iconName: "users"
, textTitle: "Manage the team" , textTitle: "Manage the team"
} }
[ [ if null team_members' then
if null team_members' then
H.div { style: { margin: "10px" } } H.div { style: { margin: "10px" } }
[ H.p {} [ H.p {}
[ H.text "Your team is empty, you can send some invitations (" [ H.text "Your team is empty, you can send some invitations ("
, B.iconButton , B.iconButton
{ callback: focusOnShareTab { callback: focusOnShareTab
, title: "Invite a user" , title: "Invite a user"
-- , elevation: Level1 -- , elevation: Level1
, name: "user-plus" , name: "user-plus"
, showLabel: true , showLabel: true
} }
, H.text ")." , H.text ")."
] ] ]
]
else else
R.fragment R.fragment
(makeLeader team_owner_username : (map makeTeam team_members')) (makeLeader team_owner_username : (map makeTeam team_members'))
] ]
where where
......
...@@ -46,8 +46,8 @@ mergeNodeCpt = here.component "mergeNode" cpt ...@@ -46,8 +46,8 @@ mergeNodeCpt = here.component "mergeNode" cpt
} }
_ -> H.div {} [] _ -> H.div {} []
pure $ Tools.panel { pure $ Tools.panel
mError: Nothing { mError: Nothing
, iconName: "random" , iconName: "random"
, textTitle: "Merge this list of terms with an other one" , textTitle: "Merge this list of terms with an other one"
} }
......
...@@ -72,8 +72,8 @@ moveNodeCpt' = here.component "__clone__" cpt ...@@ -72,8 +72,8 @@ moveNodeCpt' = here.component "__clone__" cpt
_ -> H.div {} [] _ -> H.div {} []
pure $ pure $
Tools.panel { Tools.panel
mError: Nothing { mError: Nothing
, iconName: "arrows" , iconName: "arrows"
, textTitle: "Move this node" , textTitle: "Move this node"
} }
......
...@@ -101,8 +101,8 @@ shareNodeInnerCpt = here.component "shareNodeInner" cpt ...@@ -101,8 +101,8 @@ shareNodeInnerCpt = here.component "shareNodeInner" cpt
text' /\ text <- R2.useBox' "" text' /\ text <- R2.useBox' ""
mError' /\ mError <- R2.useBox' Nothing mError' /\ mError <- R2.useBox' Nothing
pure $ Tools.panel { pure $ Tools.panel
mError: mError' { mError: mError'
, iconName: "user-plus" , iconName: "user-plus"
, textTitle: "Invite user(s) to the team" , textTitle: "Invite user(s) to the team"
} }
...@@ -164,8 +164,8 @@ publishNodeCpt = here.component "publishNode" cpt ...@@ -164,8 +164,8 @@ publishNodeCpt = here.component "publishNode" cpt
} }
_ -> H.div {} [] _ -> H.div {} []
pure $ Tools.panel { pure $ Tools.panel
mError: Nothing { mError: Nothing
, iconName: "" , iconName: ""
, textTitle: "Publish the node" , textTitle: "Publish the node"
} }
...@@ -212,11 +212,12 @@ shareURLInnercpt :: R.Component (url :: String) ...@@ -212,11 +212,12 @@ shareURLInnercpt :: R.Component (url :: String)
shareURLInnercpt = here.component "shareURLInner" cpt shareURLInnercpt = here.component "shareURLInner" cpt
where where
cpt { url } _ = do cpt { url } _ = do
pure $ Tools.panelNoFooter { pure $ Tools.panelNoFooter
mError: Nothing { mError: Nothing
, iconName: "share-alt" , iconName: "share-alt"
, textTitle: "Share the node (URL)" , textTitle: "Share the node (URL)"
} [ H.div {} [ H.text url ] ] }
[ H.div {} [ H.text url ] ]
loadUrl :: { session :: Session, id :: NodeID, nodeType :: NodeType } -> AffRESTError String loadUrl :: { session :: Session, id :: NodeID, nodeType :: NodeType } -> AffRESTError String
loadUrl { session, id, nodeType } = get session $ GR.ShareURL id nodeType loadUrl { session, id, nodeType } = get session $ GR.ShareURL id nodeType
...@@ -326,11 +326,12 @@ uploadFileViewWithLangsCpt = here.component "uploadFileViewWithLangs" cpt ...@@ -326,11 +326,12 @@ uploadFileViewWithLangsCpt = here.component "uploadFileViewWithLangs" cpt
[ H.text "Reset" ] [ H.text "Reset" ]
, uploadButton props [] , uploadButton props []
] ]
pure $ Tools.panel { pure $ Tools.panel
mError: Nothing { mError: Nothing
, iconName: "upload" , iconName: "upload"
, textTitle: "Upload and analyze a corpus" , textTitle: "Upload and analyze a corpus"
} (bodies <> [ footer ]) }
(bodies <> [ footer ])
-- | Properties of a file upload -- | Properties of a file upload
type UploadFileProps = type UploadFileProps =
...@@ -608,8 +609,8 @@ uploadListViewCpt = here.component "uploadListView" cpt ...@@ -608,8 +609,8 @@ uploadListViewCpt = here.component "uploadListView" cpt
-- Render -- Render
pure $ pure $
Tools.panel { Tools.panel
mError: Nothing { mError: Nothing
, iconName: "upload" , iconName: "upload"
, textTitle: "Upload (and replace) a list of terms" , textTitle: "Upload (and replace) a list of terms"
} }
...@@ -950,8 +951,8 @@ uploadTermListViewCpt = here.component "uploadTermListView" cpt ...@@ -950,8 +951,8 @@ uploadTermListViewCpt = here.component "uploadTermListView" cpt
} }
] ]
pure $ Tools.panel { pure $ Tools.panel
mError: Nothing { mError: Nothing
, iconName: "upload" , iconName: "upload"
, textTitle: "Upload (and replace) a list of terms" , textTitle: "Upload (and replace) a list of terms"
} }
...@@ -1118,11 +1119,12 @@ uploadFrameCalcViewWithLangsCpt = here.component "uploadFrameCalcViewWithLangs" ...@@ -1118,11 +1119,12 @@ uploadFrameCalcViewWithLangsCpt = here.component "uploadFrameCalcViewWithLangs"
[ H.text "Upload!" ] [ H.text "Upload!" ]
] ]
pure $ Tools.panel { pure $ Tools.panel
mError: Nothing { mError: Nothing
, iconName: "upload" , iconName: "upload"
, textTitle: "Upload a calc" , textTitle: "Upload a calc"
} (bodies <> [ footer ]) }
(bodies <> [ footer ])
where where
onClick lang' selection' _ = do onClick lang' selection' _ = do
......
...@@ -119,8 +119,8 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument ...@@ -119,8 +119,8 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument
{ callback: flip T.write_ paragraphBox { callback: flip T.write_ paragraphBox
, value: paragraphs' , value: paragraphs'
} }
, H.div { className: "small alert-light" } , H.div { className: "small alert-light" }
[ H.text "Suggested: between 7 and 9 sentences per document" ] [ H.text "Suggested: between 7 and 9 sentences per document" ]
] ]
] ]
, ,
......
...@@ -41,7 +41,6 @@ import Reactix.DOM.HTML as H ...@@ -41,7 +41,6 @@ import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Box" here = R2.here "Gargantext.Components.Forest.Tree.Node.Box"
...@@ -67,7 +66,6 @@ nodePopupViewCpt = here.component "nodePopupView" cpt ...@@ -67,7 +66,6 @@ nodePopupViewCpt = here.component "nodePopupView" cpt
logNodePopup <- T.read nodePopup logNodePopup <- T.read nodePopup
R.useEffect' $ here.log2 "action:" logNodePopup R.useEffect' $ here.log2 "action:" logNodePopup
pure $ pure $
......
...@@ -33,7 +33,8 @@ fragmentPT text = H.div { style: { margin: "10px" } } [ H.text text ] ...@@ -33,7 +33,8 @@ fragmentPT text = H.div { style: { margin: "10px" } } [ H.text text ]
type PanelProps = type PanelProps =
( mError :: Maybe String ( mError :: Maybe String
, iconName :: String , iconName :: String
, textTitle :: String ) , textTitle :: String
)
-- | Last element of panel's children goes to footer, all others go to body -- | Last element of panel's children goes to footer, all others go to body
panel :: R2.Component PanelProps panel :: R2.Component PanelProps
...@@ -59,10 +60,11 @@ panelCpt = here.component "panel" cpt ...@@ -59,10 +60,11 @@ panelCpt = here.component "panel" cpt
[ R2.row [ R2.row
-- TODO add type for text or form here [ H.form {className: "form-horizontal"} bodies ] -- TODO add type for text or form here [ H.form {className: "form-horizontal"} bodies ]
[ H.h5 { className: "col text-primary font-weight-normal mb-2" } [ H.h5 { className: "col text-primary font-weight-normal mb-2" }
[ B.icon { name: iconName } [ B.icon { name: iconName }
, H.span { className: "px-1" } [ H.text textTitle ] , H.span { className: "px-1" } [ H.text textTitle ]
] ]
, R2.col 12 bodies ] , R2.col 12 bodies
]
, errorCpt , errorCpt
] ]
] ]
......
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