Commit f982c6c1 authored by Karen Konou's avatar Karen Konou

Merge branch 'dev' into 310-dev-frontend-lang

parents 89f75591 d4128a3f
...@@ -1029,6 +1029,10 @@ select.form-control { ...@@ -1029,6 +1029,10 @@ select.form-control {
top: 6px; top: 6px;
} }
.jitsi-iframe {
height: 40em;
}
.range { .range {
width: 400px; width: 400px;
/* some space for the right knob */ /* some space for the right knob */
......
This diff is collapsed.
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.4.9.9.4", "version": "0.0.5",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
......
...@@ -19,7 +19,7 @@ import Data.Map as Map ...@@ -19,7 +19,7 @@ import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe, isNothing, maybe) import Data.Maybe (Maybe(..), fromMaybe, isNothing, maybe)
import Data.Monoid.Additive (Additive(..)) import Data.Monoid.Additive (Additive(..))
import Data.Ord.Down (Down(..)) import Data.Ord.Down (Down(..))
import Data.Sequence (Seq, length) as Seq import Data.Sequence as Seq
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
...@@ -38,7 +38,7 @@ import Gargantext.Hooks.Loader (useLoaderBox) ...@@ -38,7 +38,7 @@ import Gargantext.Hooks.Loader (useLoaderBox)
import Gargantext.Routes (SessionRoute(..)) as R import Gargantext.Routes (SessionRoute(..)) as R
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize, termLists, termSizes) import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize, termLists, termSizes)
import Gargantext.Utils (queryMatchesLabel, toggleSet, sortWith) import Gargantext.Utils (queryExactMatchesLabel, queryMatchesLabel, toggleSet, sortWith)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Seq as Seq import Gargantext.Utils.Seq as Seq
...@@ -92,14 +92,15 @@ setTermListSetA ngramsTable ns new_list = ...@@ -92,14 +92,15 @@ setTermListSetA ngramsTable ns new_list =
type PreConversionRows = Seq.Seq NgramsElement type PreConversionRows = Seq.Seq NgramsElement
type TableContainerProps = type TableContainerProps =
( dispatch :: Dispatch ( dispatch :: Dispatch
, ngramsChildren :: Map NgramsTerm Boolean , ngramsChildren :: Map NgramsTerm Boolean
, ngramsParent :: Maybe NgramsTerm , ngramsParent :: Maybe NgramsTerm
, ngramsSelection :: Set NgramsTerm , ngramsSelection :: Set NgramsTerm
, ngramsTable :: NgramsTable , ngramsTable :: NgramsTable
, path :: T.Box PageParams , queryExactMatches :: Boolean
, tabNgramType :: CTabNgramType , path :: T.Box PageParams
, syncResetButton :: Array R.Element , tabNgramType :: CTabNgramType
, syncResetButton :: Array R.Element
) )
tableContainer :: Record TableContainerProps -> Record TT.TableContainerProps -> R.Element tableContainer :: Record TableContainerProps -> Record TT.TableContainerProps -> R.Element
...@@ -111,6 +112,7 @@ tableContainerCpt { dispatch ...@@ -111,6 +112,7 @@ tableContainerCpt { dispatch
, ngramsSelection , ngramsSelection
, ngramsTable: ngramsTableCache , ngramsTable: ngramsTableCache
, path , path
, queryExactMatches
, tabNgramType , tabNgramType
, syncResetButton , syncResetButton
} = here.component "tableContainer" cpt } = here.component "tableContainer" cpt
...@@ -125,7 +127,7 @@ tableContainerCpt { dispatch ...@@ -125,7 +127,7 @@ tableContainerCpt { dispatch
[ [
R2.row [ H.div {className: "col-md-2", style: {marginTop: "6px"}} R2.row [ H.div {className: "col-md-2", style: {marginTop: "6px"}}
[ H.div {} syncResetButton [ H.div {} syncResetButton
, if A.null props.tableBody && searchQuery /= "" then , if (not queryExactMatches || A.null props.tableBody) && searchQuery /= "" then
-- , if (not $ Set.member (normNgram tabNgramType searchQuery) ngramsSelection) && searchQuery /= "" then -- , if (not $ Set.member (normNgram tabNgramType searchQuery) ngramsSelection) && searchQuery /= "" then
H.li { className: "list-group-item" } [ H.li { className: "list-group-item" } [
H.button { className: "btn btn-primary" H.button { className: "btn btn-primary"
...@@ -336,6 +338,10 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where ...@@ -336,6 +338,10 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
then Just (fromMaybe ng (nre ^. _NgramsRepoElement <<< _root)) then Just (fromMaybe ng (nre ^. _NgramsRepoElement <<< _root))
else Nothing else Nothing
rootsWithMatches = Set.fromFoldable (Seq.mapMaybe rootOfMatch nres) rootsWithMatches = Set.fromFoldable (Seq.mapMaybe rootOfMatch nres)
exactMatches :: Boolean
exactMatches = not $ Seq.null $ Seq.filter fltr nres
where
fltr (Tuple ng _) = queryExactMatchesLabel searchQuery (ngramsTermText ng)
rowsFilter :: NgramsElement -> Maybe NgramsElement rowsFilter :: NgramsElement -> Maybe NgramsElement
rowsFilter ngramsElement = rowsFilter ngramsElement =
if displayRow { ngramsElement if displayRow { ngramsElement
...@@ -411,6 +417,7 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where ...@@ -411,6 +417,7 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
, ngramsSelection , ngramsSelection
, ngramsTable , ngramsTable
, path , path
, queryExactMatches: exactMatches
, syncResetButton: [ syncResetButton ] , syncResetButton: [ syncResetButton ]
, tabNgramType } , tabNgramType }
, params , params
......
...@@ -155,7 +155,7 @@ documentLayoutWithKeyCpt = here.component "documentLayoutWithKey" cpt ...@@ -155,7 +155,7 @@ documentLayoutWithKeyCpt = here.component "documentLayoutWithKey" cpt
------------------------------------------------------------------------ ------------------------------------------------------------------------
loadDocument :: Session -> Int -> AffRESTError NodeDocument loadDocument :: Session -> Int -> AffRESTError NodeDocument
loadDocument session nodeId = get session $ NodeAPI Node (Just nodeId) "" loadDocument session nodeId = get session $ NodeAPI Context (Just nodeId) ""
loadData :: DocPath -> AffRESTError LoadedData loadData :: DocPath -> AffRESTError LoadedData
loadData { listIds, nodeId, session, tabType } = do loadData { listIds, nodeId, session, tabType } = do
......
...@@ -137,10 +137,13 @@ nodeFrameVisioCpt = here.component "nodeFrameVisio" cpt ...@@ -137,10 +137,13 @@ nodeFrameVisioCpt = here.component "nodeFrameVisio" cpt
case toMaybe (R.readRef ref) of case toMaybe (R.readRef ref) of
Nothing -> pure unit Nothing -> pure unit
Just r -> do Just r -> do
api <- JM.jitsiMeetAPI (WURL.host url) { parentNode: r, roomName: frame_id } api <- JM.jitsiMeetAPI (WURL.host url) { parentNode: r
, roomName: frame_id
, width: "100%"
, height: "100%" }
here.log2 "[nodeFrameVisio] api" api here.log2 "[nodeFrameVisio] api" api
pure $ H.div { ref } [ H.text $ WURL.host url ] pure $ H.div { ref, className: "jitsi-iframe" } [ ]
type LoadProps = ( nodeId :: Int type LoadProps = ( nodeId :: Int
, session :: Session ) , session :: Session )
......
...@@ -37,13 +37,13 @@ columnName :: ColumnName -> String ...@@ -37,13 +37,13 @@ columnName :: ColumnName -> String
columnName (ColumnName c) = c columnName (ColumnName c) = c
type Props = type Props =
( syncResetButton :: Array R.Element ( syncResetButton :: Array R.Element
, colNames :: Array ColumnName , colNames :: Array ColumnName
, container :: Record TableContainerProps -> R.Element , container :: Record TableContainerProps -> R.Element
, params :: T.Box Params , params :: T.Box Params
, rows :: Rows , rows :: Rows
, totalRecords :: Int , totalRecords :: Int
, wrapColElts :: ColumnName -> Array R.Element -> Array R.Element , wrapColElts :: ColumnName -> Array R.Element -> Array R.Element
-- ^ Use `const identity` as a default behavior. -- ^ Use `const identity` as a default behavior.
) )
type TableContainerProps = type TableContainerProps =
......
...@@ -143,6 +143,7 @@ data NodeType = Annuaire ...@@ -143,6 +143,7 @@ data NodeType = Annuaire
| Graph | Graph
| Individu | Individu
| Node | Node
| Context
| NodeContact | NodeContact
| NodeList | NodeList
| NodeUser | NodeUser
...@@ -191,6 +192,7 @@ instance Show NodeType where ...@@ -191,6 +192,7 @@ instance Show NodeType where
show Individu = "NodeIndividu" show Individu = "NodeIndividu"
show Node = "Node" show Node = "Node"
show Nodes = "Nodes" show Nodes = "Nodes"
show Context = "Context"
show Tree = "NodeTree" show Tree = "NodeTree"
show Team = "NodeTeam" show Team = "NodeTeam"
show NodeList = "NodeList" show NodeList = "NodeList"
...@@ -217,6 +219,7 @@ instance Read NodeType where ...@@ -217,6 +219,7 @@ instance Read NodeType where
read "Individu" = Just Individu read "Individu" = Just Individu
read "Node" = Just Node read "Node" = Just Node
read "Nodes" = Just Nodes read "Nodes" = Just Nodes
read "Context" = Just Context
read "NodeCorpus" = Just Corpus read "NodeCorpus" = Just Corpus
read "NodeContact" = Just NodeContact read "NodeContact" = Just NodeContact
read "Tree" = Just Tree read "Tree" = Just Tree
...@@ -252,6 +255,7 @@ translateFR = case _ of ...@@ -252,6 +255,7 @@ translateFR = case _ of
Graph -> "Graphe" Graph -> "Graphe"
Individu -> "Individu" Individu -> "Individu"
Node -> "Nœud" Node -> "Nœud"
Context -> "ConTexte"
NodeContact -> "Contact" NodeContact -> "Contact"
NodeList -> "Liste" NodeList -> "Liste"
NodeUser -> "Utilisateur" NodeUser -> "Utilisateur"
...@@ -282,6 +286,7 @@ translateEN = case _ of ...@@ -282,6 +286,7 @@ translateEN = case _ of
Graph -> "Graph" Graph -> "Graph"
Individu -> "Person" Individu -> "Person"
Node -> "Node" Node -> "Node"
Context -> "Context"
NodeContact -> "Contact" NodeContact -> "Contact"
NodeList -> "List" NodeList -> "List"
NodeUser -> "User" NodeUser -> "User"
...@@ -397,6 +402,7 @@ nodeTypePath Phylo = "phylo" ...@@ -397,6 +402,7 @@ nodeTypePath Phylo = "phylo"
nodeTypePath Individu = "individu" nodeTypePath Individu = "individu"
nodeTypePath Node = "node" nodeTypePath Node = "node"
nodeTypePath Nodes = "nodes" nodeTypePath Nodes = "nodes"
nodeTypePath Context = "context"
nodeTypePath NodeUser = "user" nodeTypePath NodeUser = "user"
nodeTypePath NodeContact = "contact" nodeTypePath NodeContact = "contact"
nodeTypePath Tree = "tree" nodeTypePath Tree = "tree"
......
...@@ -70,10 +70,14 @@ zeroPad pad num = zeros <> (show num) ...@@ -70,10 +70,14 @@ zeroPad pad num = zeros <> (show num)
zeros' 0 = "" zeros' 0 = ""
zeros' n = "0" <> (zeros' (n - 1)) zeros' n = "0" <> (zeros' (n - 1))
queryNormalize :: String -> String
queryNormalize = S.toLower
queryMatchesLabel :: String -> String -> Boolean queryMatchesLabel :: String -> String -> Boolean
queryMatchesLabel q l = S.contains (S.Pattern $ normalize q) (normalize l) queryMatchesLabel q l = S.contains (S.Pattern $ queryNormalize q) (queryNormalize l)
where
normalize = S.toLower queryExactMatchesLabel :: String -> String -> Boolean
queryExactMatchesLabel q l = queryNormalize q == queryNormalize l
mapLeft :: forall l m r. (l -> m) -> Either l r -> Either m r mapLeft :: forall l m r. (l -> m) -> Either l r -> Either m r
......
...@@ -9,7 +9,9 @@ foreign import data JitsiMeet :: Type ...@@ -9,7 +9,9 @@ foreign import data JitsiMeet :: Type
type Jitsi = type Jitsi =
{ parentNode :: DOM.Element { parentNode :: DOM.Element
, roomName :: String } , roomName :: String
, width :: String
, height :: String }
foreign import _api :: JitsiMeet foreign import _api :: JitsiMeet
foreign import _jitsiMeetAPI :: EffectFn2 String Jitsi JitsiMeet foreign import _jitsiMeetAPI :: EffectFn2 String Jitsi JitsiMeet
......
...@@ -183,3 +183,7 @@ select.form-control ...@@ -183,3 +183,7 @@ select.form-control
height: $spinner-size height: $spinner-size
left: $spinner-left-offset left: $spinner-left-offset
top: $spinner-top-offset top: $spinner-top-offset
.jitsi-iframe
height: 40em
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