MSP-3074 add roles
This commit is contained in:
1 parent
5a29bfc7f6
commit
9c1b859971
36 files changed
+1063
-100
No files matched your search
@@ -0,0 +1,12 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
config?: any;
|
||||
}
|
||||
}
|
||||
|
||||
export const getConfigProperty = (property: string, defaultValue: any) => {
|
||||
if (window.config && Object.prototype.hasOwnProperty.call(window.config, property)) {
|
||||
return window.config[property];
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
export const LocalStorage = {
|
||||
set(key: string, value: any): void {
|
||||
const item = typeof value === 'string' ? value : JSON.stringify(value);
|
||||
localStorage.setItem(key, item);
|
||||
},
|
||||
get(key: string): any | null {
|
||||
const value = localStorage.getItem(key);
|
||||
try {
|
||||
return value ? JSON.parse(value) : null;
|
||||
} catch (error) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
remove(key: string): void {
|
||||
localStorage.removeItem(key);
|
||||
},
|
||||
clear(): void {
|
||||
localStorage.clear();
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user