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

files clean/lint

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