Commit f982c6c1 authored by Karen Konou's avatar Karen Konou

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

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