mirror of
https://github.com/SigNoz/signoz.git
synced 2026-09-19 09:50:41 +01:00
#### Description - Registers `quick-filter` as a metaresource (list / read / update) and adds the Quick Filters panel in roles settings. - Quick filters sidebar on logs, traces, exceptions, api monitoring and meter is gated on `quick-filter:read`.. denied shows the inline callout, header stays. - Settings gear is gated on read + update.. shows disabled with the denial tooltip instead of being hidden. The old `user.role === ADMIN` check is gone, roles decide now. - Static config pages (infra) are not gated since they dont use the qf apis. - Removed the old "Edit your quick filters" announcement from the gear. #### Issues closed by this PR Part of https://github.com/SigNoz/engineering-pod/issues/5946 Closes https://github.com/SigNoz/engineering-pod/issues/6038 #### Screenshot/ recordings Showing up in permissions per role <img width="3346" height="1282" alt="image" src="https://github.com/user-attachments/assets/0a1409bd-1b16-46c2-8186-a77be7dd3083" /> https://github.com/user-attachments/assets/38f1f718-89ef-4f49-b1ac-4385ca431d04 --------- Co-authored-by: aks07 <adityasinghssj1@gmail.com>
26 lines
890 B
TypeScript
26 lines
890 B
TypeScript
import deleteLocalStorageKey from 'api/browser/localstorage/remove';
|
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
|
import ROUTES from 'constants/routes';
|
|
import history from 'lib/history';
|
|
|
|
import deleteSession from './v2/sessions/delete';
|
|
|
|
export const Logout = async (): Promise<void> => {
|
|
try {
|
|
await deleteSession();
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
|
|
deleteLocalStorageKey(LOCALSTORAGE.AUTH_TOKEN);
|
|
deleteLocalStorageKey(LOCALSTORAGE.IS_LOGGED_IN);
|
|
deleteLocalStorageKey(LOCALSTORAGE.IS_IDENTIFIED_USER);
|
|
deleteLocalStorageKey(LOCALSTORAGE.REFRESH_AUTH_TOKEN);
|
|
deleteLocalStorageKey(LOCALSTORAGE.LOGGED_IN_USER_EMAIL);
|
|
deleteLocalStorageKey(LOCALSTORAGE.LOGGED_IN_USER_NAME);
|
|
deleteLocalStorageKey(LOCALSTORAGE.CHAT_SUPPORT);
|
|
deleteLocalStorageKey(LOCALSTORAGE.USER_ID);
|
|
window.dispatchEvent(new CustomEvent('LOGOUT'));
|
|
history.push(ROUTES.LOGIN);
|
|
};
|