Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ function GraphConfigCtrl(
}
$scope.queryEditorIsDirty = false;
if ($scope.isUpdate) {
$scope.updateGraphConfig($scope.newConfig.toSavePayload());
$scope.updateGraphConfig($scope.newConfig.toSavePayload($repositories.getActiveRepository()));
} else {
$scope.createGraphConfig($scope.newConfig.toSavePayload());
$scope.createGraphConfig($scope.newConfig.toSavePayload($repositories.getActiveRepository()));
Comment thread
svilenvelikov marked this conversation as resolved.
}
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2859,6 +2859,7 @@ function GraphsVisualizationsCtrl(
name: $scope.lastSavedGraphName,
data: data,
shared: $scope.shared,
repositoryId: repositoryContextService.getSelectedRepository().id,
};

if (graphToSave.id) {
Expand Down Expand Up @@ -2968,18 +2969,22 @@ function GraphsVisualizationsCtrl(

// Preserve existing query params and only set/override `saved`
const currentSearch = $location.search();
const newSearch = {...currentSearch, saved: graphToLoad.id};
$location.search('saved', graphToLoad.id);
const newSearch = {
...currentSearch,
saved: graphToLoad.id,
[REPOSITORY_ID_PARAM]: repositoryContextService.getSelectedRepository().id,
};
graph.restoreState(JSON.parse(graphToLoad.data));
if (!noHistory) {
pushHistory(newSearch, {savedGraph: graphToLoad});
}
};

$scope.copyToClipboardSavedGraph = function(savedGraph) {
// TODO: Not sure we must add the repositoryId param here.
const url = [location.protocol, '//', location.host, location.pathname, '?saved=', savedGraph.id].join('');
$scope.copyToClipboard(url);
const url = new URL(window.location.href);
url.searchParams.set('saved', savedGraph.id);
url.searchParams.set(REPOSITORY_ID_PARAM, repositoryContextService.getSelectedRepository().id);
$scope.copyToClipboard(url.toString());
};

function deleteSavedGraphHttp(savedGraph) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ export class GraphsConfig {

/**
* Converts this model to a payload JSON object needed for a save config operation.
* @param {string} repositoryId The repository identifier to which this config belongs.
* @return {{owner: (string|undefined), shared: (boolean|undefined), startIRI: (string|undefined), resourceQuery: (string|undefined), startGraphQuery: (string|undefined), expandQuery: (string|undefined), description: (string|undefined), startIRILabel: (string|undefined), startQueryIncludeInferred: (boolean|undefined), resourcePropertiesQuery: (string|undefined), predicateLabelQuery: (string|undefined), startMode: (string|undefined), hint: (string|undefined), name: (string|undefined), id: (string|undefined), startQuerySameAs: (boolean|undefined)}}
*/
toSavePayload() {
toSavePayload(repositoryId) {
return {
id: this.id,
name: this.name,
Expand All @@ -159,7 +160,8 @@ export class GraphsConfig {
resourcePropertiesQuery: this.resourcePropertiesQuery,
shared: this.shared,
description: this.description,
hint: this.hint
hint: this.hint,
repositoryId: repositoryId,
};
}

Expand Down