Commit 53df92e1 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Tree/Node] before refactoring

parent ecb9ea36
......@@ -16,6 +16,9 @@ filterWithRights (show action if user can only)
-}
------------------------------------------------------------------------
------------------------------------------------------------------------
data Status a = IsBeta a | IsProd a
data NodeAction = Documentation NodeType
| SearchBox
| Download | Upload | Refresh | Config
......@@ -71,7 +74,6 @@ glyphiconNodeAction Config = "wrench"
glyphiconNodeAction _ = ""
------------------------------------------------------------------------
------------------------------------------------------------------------
data SettingsBox =
SettingsBox { show :: Boolean
......@@ -83,14 +85,14 @@ data SettingsBox =
settingsBox :: NodeType -> SettingsBox
settingsBox NodeUser = SettingsBox {
show: true
show : true
, edit : false
, doc : Documentation NodeUser
, buttons : [ Delete ]
}
settingsBox FolderPrivate = SettingsBox {
show: true
show : true
, edit : false
, doc : Documentation FolderPrivate
, buttons : [ Add [ Corpus
......@@ -101,7 +103,7 @@ settingsBox FolderPrivate = SettingsBox {
}
settingsBox Team = SettingsBox {
show: true
show : true
, edit : true
, doc : Documentation Team
, buttons : [ Add [ Corpus
......@@ -112,7 +114,7 @@ settingsBox Team = SettingsBox {
}
settingsBox FolderShared = SettingsBox {
show: true
show : true
, edit : true
, doc : Documentation FolderShared
, buttons : [ Add [Team, FolderShared]
......@@ -121,7 +123,7 @@ settingsBox FolderShared = SettingsBox {
}
settingsBox FolderPublic = SettingsBox {
show: true
show : true
, edit : false
, doc : Documentation FolderPublic
, buttons : [ Add [ Corpus
......@@ -130,8 +132,8 @@ settingsBox FolderPublic = SettingsBox {
]
}
settingsBox Folder = SettingsBox {
show: true
settingsBox Folder =
SettingsBox { show : true
, edit : true
, doc : Documentation Folder
, buttons : [ Add [ Corpus
......@@ -142,8 +144,8 @@ settingsBox Folder = SettingsBox {
]
}
settingsBox Corpus = SettingsBox {
show: true
settingsBox Corpus =
SettingsBox { show : true
, edit : true
, doc : Documentation Corpus
, buttons : [ SearchBox
......@@ -161,8 +163,8 @@ settingsBox Corpus = SettingsBox {
]
}
settingsBox Texts = SettingsBox {
show: true
settingsBox Texts =
SettingsBox { show : true
, edit : false
, doc : Documentation Texts
, buttons : [ Refresh
......@@ -172,8 +174,8 @@ settingsBox Texts = SettingsBox {
]
}
settingsBox Graph = SettingsBox {
show: true
settingsBox Graph =
SettingsBox { show : true
, edit : false
, doc : Documentation Graph
, buttons : [ Refresh
......@@ -183,28 +185,28 @@ settingsBox Graph = SettingsBox {
]
}
settingsBox NodeList = SettingsBox {
show: true
settingsBox NodeList =
SettingsBox { show : true
, edit : false
, doc : Documentation NodeList
, buttons : [ Refresh
, Config
, Download
, Upload
, CopyFromCorpus
, Download
-- , Delete
]
}
settingsBox Dashboard = SettingsBox {
show: true
settingsBox Dashboard =
SettingsBox { show : true
, edit : false
, doc : Documentation Dashboard
, buttons : []
}
settingsBox Annuaire = SettingsBox {
show: true
settingsBox Annuaire =
SettingsBox { show : true
, edit : false
, doc : Documentation Annuaire
, buttons : [ Upload
......@@ -212,8 +214,8 @@ settingsBox Annuaire = SettingsBox {
]
}
settingsBox _ = SettingsBox {
show: false
settingsBox _ =
SettingsBox { show : false
, edit : false
, doc : Documentation NodeUser
, buttons : []
......
......@@ -395,11 +395,13 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
where
SettingsBox {edit, doc, buttons} = settingsBox nodeType
mPanelAction :: R.State (Record NodePopupS) -> Record NodePopupProps -> R.State Search -> R.Element
mPanelAction :: R.State (Record NodePopupS)
-> Record NodePopupProps
-> R.State Search
-> R.Element
mPanelAction ({action: Nothing} /\ _) _ _ = H.div {} []
mPanelAction ({action: Just action} /\ _) p search =
panelAction {
action
panelAction { action
, dispatch: p.dispatch
, id: p.id
, name: p.name
......@@ -514,7 +516,7 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
cpt {action: Documentation GT.FolderShared} _ = do
pure $ fragmentPT "Soon, you will be able to build teams folders to share your work"
cpt {action: Documentation x, nodeType} _ = do
pure $ fragmentPT $ "More information on" <> show nodeType
pure $ fragmentPT $ "More information on " <> show nodeType
cpt {action: Link _} _ = do
pure $ fragmentPT "Soon, you will be able to link the corpus with your Annuaire (and reciprocally)."
......@@ -549,8 +551,10 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
]
cpt {action: Add xs, dispatch, id, name, nodePopup: p, nodeType} _ = do
pure $ createNodeView {dispatch, id, name, nodeType, nodeTypes: xs}
cpt {action: CopyFromCorpus, dispatch, id, nodeType, session} _ = do
pure $ copyFromCorpusView {dispatch, id, nodeType, session}
cpt _ _ = do
pure $ H.div {} []
......
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