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
......@@ -36,7 +39,7 @@ instance eqNodeAction :: Eq NodeAction where
eq Delete Delete = true
eq Share Share = true
eq (Link x) (Link y) = true && (x == y)
eq (Add x) (Add y) = true && (x == y)
eq (Add x) (Add y) = true && (x == y)
eq CopyFromCorpus CopyFromCorpus = true
eq Config Config = true
eq _ _ = false
......@@ -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,91 +132,91 @@ settingsBox FolderPublic = SettingsBox {
]
}
settingsBox Folder = SettingsBox {
show: true
, edit : true
, doc : Documentation Folder
, buttons : [ Add [ Corpus
, Folder
, Annuaire
]
, Delete
]
}
settingsBox Folder =
SettingsBox { show : true
, edit : true
, doc : Documentation Folder
, buttons : [ Add [ Corpus
, Folder
, Annuaire
]
, Delete
]
}
settingsBox Corpus = SettingsBox {
show: true
, edit : true
, doc : Documentation Corpus
, buttons : [ SearchBox
, Add [ NodeList
, Graph
, Dashboard
]
, Upload
, Download
--, Share
--, Move
--, Clone
, Link Annuaire
, Delete
]
}
settingsBox Corpus =
SettingsBox { show : true
, edit : true
, doc : Documentation Corpus
, buttons : [ SearchBox
, Add [ NodeList
, Graph
, Dashboard
]
, Upload
, Download
--, Share
--, Move
--, Clone
, Link Annuaire
, Delete
]
}
settingsBox Texts = SettingsBox {
show: true
, edit : false
, doc : Documentation Texts
, buttons : [ Refresh
, Upload
, Download
-- , Delete
]
}
settingsBox Texts =
SettingsBox { show : true
, edit : false
, doc : Documentation Texts
, buttons : [ Refresh
, Upload
, Download
-- , Delete
]
}
settingsBox Graph = SettingsBox {
show: true
, edit : false
, doc : Documentation Graph
, buttons : [ Refresh
, Config
, Download -- TODO as GEXF or JSON
, Delete
]
}
settingsBox Graph =
SettingsBox { show : true
, edit : false
, doc : Documentation Graph
, buttons : [ Refresh
, Config
, Download -- TODO as GEXF or JSON
, Delete
]
}
settingsBox NodeList = SettingsBox {
show: true
, edit : false
, doc : Documentation NodeList
, buttons : [ Refresh
, Config
, Upload
, CopyFromCorpus
, Download
-- , Delete
]
}
settingsBox NodeList =
SettingsBox { show : true
, edit : false
, doc : Documentation NodeList
, buttons : [ Refresh
, Config
, Download
, Upload
, CopyFromCorpus
-- , Delete
]
}
settingsBox Dashboard = SettingsBox {
show: true
, edit : false
, doc : Documentation Dashboard
, buttons : []
}
settingsBox Dashboard =
SettingsBox { show : true
, edit : false
, doc : Documentation Dashboard
, buttons : []
}
settingsBox Annuaire = SettingsBox {
show: true
, edit : false
, doc : Documentation Annuaire
, buttons : [ Upload
, Delete
]
}
settingsBox Annuaire =
SettingsBox { show : true
, edit : false
, doc : Documentation Annuaire
, buttons : [ Upload
, Delete
]
}
settingsBox _ = SettingsBox {
show: false
, edit : false
, doc : Documentation NodeUser
, buttons : []
}
settingsBox _ =
SettingsBox { show : false
, edit : false
, doc : Documentation NodeUser
, buttons : []
}
......@@ -395,19 +395,21 @@ 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
, dispatch: p.dispatch
, id: p.id
, name: p.name
, nodePopup: Just NodePopup
, nodeType: p.nodeType
, search
, session: p.session
}
panelAction { action
, dispatch: p.dispatch
, id: p.id
, name: p.name
, nodePopup: Just NodePopup
, nodeType: p.nodeType
, search
, session: p.session
}
searchIsTexIframe {nodeType} search@(search' /\ _) =
if isIsTex search'.datafield then
......@@ -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