aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/storage.ts
diff options
context:
space:
mode:
authorPascal Mugnier <pascal.mugnier@sonarsource.com>2018-03-07 14:26:27 +0100
committerPascal Mugnier <pascal.mugnier@sonarsource.com>2018-03-07 14:26:27 +0100
commitd39405a06b3ec3af82ec70ff71170a578ffbe284 (patch)
treef3cff10b6b42236f7089b241c4c528231d7af718 /server/sonar-web/src/main/js/helpers/storage.ts
parentbfbc7ac7338abda5703fa1fcab9b8a06bf020cc1 (diff)
downloadsonarqube-d39405a06b3ec3af82ec70ff71170a578ffbe284.tar.gz
sonarqube-d39405a06b3ec3af82ec70ff71170a578ffbe284.zip
SONAR-10397 Test for buckets
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);
}