aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/storage.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/storage.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/storage.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/helpers/storage.ts b/server/sonar-web/src/main/js/helpers/storage.ts
index fc54899c8b4..37533dbdfaa 100644
--- a/server/sonar-web/src/main/js/helpers/storage.ts
+++ b/server/sonar-web/src/main/js/helpers/storage.ts
@@ -28,6 +28,8 @@ const PROJECTS_SORT = 'sonarqube.projects.sort';
const PROJECT_ACTIVITY_GRAPH = 'sonarqube.project_activity.graph';
const PROJECT_ACTIVITY_GRAPH_CUSTOM = 'sonarqube.project_activity.graph.custom';
+const WORKSPACE = 'sonarqube-workspace';
+
function save(key: string, value?: string): void {
try {
if (value) {
@@ -41,6 +43,14 @@ function save(key: string, value?: string): void {
}
}
+export function saveWorkspace(dump: string): void {
+ window.localStorage.setItem(WORKSPACE, dump);
+}
+
+export function getWorkspace(): string | null {
+ return window.localStorage.getItem(WORKSPACE);
+}
+
export function saveFavorite(): void {
save(PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE);
}