Commit 3892af4e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch '671-dev-update-deps' into 'dev'

Resolve "`./install` doesn't work on Darwin"

See merge request !508
parents 266248f8 9c06952e
Pipeline #7530 passed with stages
in 26 minutes and 34 seconds
......@@ -49,4 +49,7 @@ bundle.js
/dist/bundle.min.js*
# IDE specific
.vscode
.idea/
.vscode/
.parcel-cache/
#!/bin/bash
set -e
# To get infos
# nix-shell -p nix-info --run --extra-experimental-features nix-command "nix-info -m"
......
......@@ -21,11 +21,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
......@@ -59,11 +59,11 @@
"slimlock": "slimlock"
},
"locked": {
"lastModified": 1727269424,
"narHash": "sha256-uoVjAkKbuJSA7++kyBjxLozICDdukZ+Mjj5Z/K5qMak=",
"lastModified": 1739795788,
"narHash": "sha256-PG4lO49fvWHpQoCN3mIGflisXF+5vEf91ceV9hsWTLU=",
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"rev": "5a28abe663758634b1e5ca7053e08af62fd3be80",
"rev": "f754c2ef94cef46e5d5223c25d3f361e1f6cb509",
"type": "github"
},
"original": {
......
......@@ -20,8 +20,8 @@
};
dependencies = with pkgs; [
purs-bin.purs-0_15_16-1 # from the purescript-overlay
spago-bin.spago-0_93_37
purs-bin.purs-0_15_16-4 # from the purescript-overlay
spago-bin.spago-0_93_43
nodePackages.purs-tidy
watchexec
esbuild
......
This diff is collapsed.
This diff is collapsed.
......@@ -39,8 +39,8 @@ workspace:
# other external packages
url-validator:
git: https://github.com/bbarker/purescript-url-validator
ref: master
git: https://github.com/garganscript/purescript-url-validator
ref: spago-next
# for tests
spec-discovery:
......
......@@ -15,6 +15,7 @@ import Effect.Exception (error)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..), Variant(..))
import Gargantext.Components.CodeEditor as CE
import Gargantext.Components.Forest.Tree.Node.Action.Add (addNode, AddNodeValue(..))
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Node (HyperdataList, NodePoly(..))
import Gargantext.Components.Nodes.Corpus.Types (CorpusData, Hyperdata)
......@@ -23,7 +24,7 @@ import Gargantext.Config.REST (AffRESTError, RESTError(..))
import Gargantext.Data.Array as GDA
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(Children, NodeAPI))
import Gargantext.Sessions (Session, get, put)
import Gargantext.Sessions (Session, get, post, put)
import Gargantext.Types (AffETableResult, NodeType(..), ID)
import Gargantext.Utils ((?))
import Gargantext.Utils.Reactix as R2
......@@ -418,35 +419,9 @@ loadCorpus { nodeId, session } = do
case res of
Left err -> pure $ Left err
Right (NodePoly { parentId: corpusId } :: NodePoly {}) -> do
eCorpusNode <- get session $ corpusNodeRoute (fromMaybe 0 corpusId) ""
eDefaultListIds <-
(get session $ defaultListIdsRoute (fromMaybe 0 corpusId))
:: forall a. JSON.ReadForeign a => AffETableResult (NodePoly a)
case eCorpusNode of
Left err -> pure $ Left err
Right corpusNode -> do
case eDefaultListIds of
Left err -> pure $ Left err
Right defaultListIds -> do
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
pure $ Right { corpusId: (fromMaybe 0 corpusId), corpusNode, defaultListId }
Nothing ->
pure $ Left $ CustomError "Missing default list"
-- (NodePoly {parentId: corpusId} :: NodePoly {}) <- get session nodePolyRoute
-- corpusNode <- get session $ corpusNodeRoute corpusId ""
-- defaultListIds <- (get session $ defaultListIdsRoute corpusId)
-- :: forall a. JSON.ReadForeign a => AffTableResult (NodePoly a)
-- case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
-- Just (NodePoly { id: defaultListId }) ->
-- pure {corpusId, corpusNode, defaultListId}
-- Nothing ->
-- throwError $ error "Missing default list"
fetchCorpusNode session corpusId
where
nodePolyRoute = NodeAPI Corpus (Just nodeId) ""
corpusNodeRoute = NodeAPI Corpus <<< Just
defaultListIdsRoute = Children NodeList 0 1 Nothing <<< Just
loadCorpusWithChild :: Record LoadProps -> AffRESTError CorpusData
loadCorpusWithChild { nodeId: childId, session } = do
......@@ -456,24 +431,38 @@ loadCorpusWithChild { nodeId: childId, session } = do
Left err -> pure $ Left err
Right listNode -> do
let (NodePoly { parentId: corpusId } :: NodePoly {}) = listNode
eCorpusNode <- get session $ corpusNodeRoute (fromMaybe 0 corpusId) ""
case eCorpusNode of
fetchCorpusNode session corpusId
where
listNodeRoute = NodeAPI Node <<< Just
fetchCorpusNode session corpusId = do
eCorpusNode <- get session $ corpusNodeRoute defaultCorpusId ""
case eCorpusNode of
Left err -> pure $ Left err
Right corpusNode -> do
eDefaultListId <- fetchDefaultList session defaultCorpusId
case eDefaultListId of
Left err -> pure $ Left err
Right corpusNode -> do
eDefaultListIds <-
(get session $ defaultListIdsRoute (fromMaybe 0 corpusId))
:: forall a. JSON.ReadForeign a => AffETableResult (NodePoly a)
case eDefaultListIds of
Left err -> pure $ Left err
Right defaultListIds -> do
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
pure $ Right { corpusId: fromMaybe 0 corpusId, corpusNode, defaultListId }
Nothing ->
throwError $ error "Missing default list"
Right defaultListId ->
pure $ Right { corpusId: defaultCorpusId, corpusNode, defaultListId }
where
defaultCorpusId = fromMaybe 0 corpusId
corpusNodeRoute = NodeAPI Corpus <<< Just
listNodeRoute = NodeAPI Node <<< Just
fetchDefaultList :: Session -> ID -> AffRESTError ID
fetchDefaultList session corpusId = do
eDefaultListIds <-
(get session $ defaultListIdsRoute corpusId)
:: forall a. JSON.ReadForeign a => AffETableResult (NodePoly a)
case eDefaultListIds of
Left err -> pure $ Left err
Right defaultListIds -> do
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
pure $ Right defaultListId
Nothing ->
pure $ Left $ CustomError "Missing default list"
where
defaultListIdsRoute = Children NodeList 0 1 Nothing <<< Just
type LoadWithReloadProps =
......
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