@robosystems/core 0.13.5 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -369,7 +369,7 @@ export function getGraphExampleKind(graph, preferredKind) {
|
|
|
369
369
|
}
|
|
370
370
|
/** Merge an app's branding with the example set for the given graph. */
|
|
371
371
|
export function buildGraphAwareConsoleConfig(graph, branding) {
|
|
372
|
-
var _a, _b, _c;
|
|
372
|
+
var _a, _b, _c, _d;
|
|
373
373
|
const kind = getGraphExampleKind(graph, branding.preferredKind);
|
|
374
374
|
const set = EXAMPLE_SETS[kind];
|
|
375
375
|
const isRepository = (_a = graph === null || graph === void 0 ? void 0 : graph.isRepository) !== null && _a !== void 0 ? _a : false;
|
|
@@ -404,8 +404,10 @@ export function buildGraphAwareConsoleConfig(graph, branding) {
|
|
|
404
404
|
noSelectionError: (_c = branding.noSelectionError) !== null && _c !== void 0 ? _c : 'No graph selected. Please select a graph first.',
|
|
405
405
|
// Semantic memory is per-user-graph; shared repositories reject it.
|
|
406
406
|
enableRecall: !isRepository,
|
|
407
|
-
// Writes need a user graph
|
|
408
|
-
|
|
407
|
+
// Writes need a user graph and a role above viewer, which is read-only.
|
|
408
|
+
// The API checks the write role either way; this keeps a viewer from
|
|
409
|
+
// being offered /do only to be refused.
|
|
410
|
+
enableAuthor: !isRepository && ((_d = graph === null || graph === void 0 ? void 0 : graph.role) === null || _d === void 0 ? void 0 : _d.toLowerCase()) !== 'viewer',
|
|
409
411
|
};
|
|
410
412
|
}
|
|
411
413
|
/**
|
|
@@ -422,6 +424,7 @@ export function useGraphAwareConsoleConfig(branding) {
|
|
|
422
424
|
currentGraph === null || currentGraph === void 0 ? void 0 : currentGraph.repositoryType,
|
|
423
425
|
currentGraph === null || currentGraph === void 0 ? void 0 : currentGraph.schemaExtensions,
|
|
424
426
|
currentGraph === null || currentGraph === void 0 ? void 0 : currentGraph.graphName,
|
|
427
|
+
currentGraph === null || currentGraph === void 0 ? void 0 : currentGraph.role,
|
|
425
428
|
branding,
|
|
426
429
|
]);
|
|
427
430
|
}
|
|
@@ -78,12 +78,12 @@ export function createGraphProvider(Context) {
|
|
|
78
78
|
// Only treat as a user graph if found and NOT a repository
|
|
79
79
|
const isUserGraph = graph ? !graph.isRepository : false;
|
|
80
80
|
setBaseState((prev) => (Object.assign(Object.assign({}, prev), { currentGraphId: graphId })));
|
|
81
|
-
// Only call
|
|
81
|
+
// Only call setSelectedGraph for user graphs, not repositories
|
|
82
82
|
// Repositories can be accessed but not "selected" in the backend
|
|
83
83
|
// If graph is not found in local state, skip the API call (likely a repository)
|
|
84
84
|
if (isUserGraph) {
|
|
85
|
-
unwrapSdk(await SDK.
|
|
86
|
-
|
|
85
|
+
unwrapSdk(await SDK.setSelectedGraph({
|
|
86
|
+
body: { graph_id: graphId },
|
|
87
87
|
}));
|
|
88
88
|
}
|
|
89
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robosystems/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"tailwind-merge": "^3"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@robosystems/client": ">=
|
|
30
|
+
"@robosystems/client": ">=2.7 <3",
|
|
31
31
|
"flowbite-react": "^0.12.5",
|
|
32
32
|
"next": ">=15 <17",
|
|
33
33
|
"react": ">=18 <20",
|