Feature :: Logout event handler addition (#2651)

* logout action initial

* updating logout action

* removing options

* removing unwanted  logs :: cleanup
This commit is contained in:
Kiran Ashok 2022-03-31 18:50:33 +05:30 committed by GitHub
parent fff9d2afe7
commit 7d0139e0df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -4,6 +4,10 @@ export const ActionTypes = [
id: 'show-alert',
options: [{ name: 'message', type: 'text', default: 'Message !' }],
},
{
name: 'Logout',
id: 'logout',
},
{
name: 'Run Query',
id: 'run-query',

View file

@ -160,6 +160,13 @@ function showModal(_ref, modal, show) {
return Promise.resolve();
}
function logoutAction(_ref) {
localStorage.clear();
_ref.props.history.push('/login');
window.location.href = '/login';
return Promise.resolve();
}
function executeAction(_ref, event, mode, customVariables) {
console.log('nopski', customVariables);
if (event) {
@ -187,6 +194,9 @@ function executeAction(_ref, event, mode, customVariables) {
const { queryId, queryName } = event;
return runQuery(_ref, queryId, queryName, true, mode);
}
case 'logout': {
return logoutAction(_ref);
}
case 'open-webpage': {
const url = resolveReferences(event.url, _ref.state.currentState, undefined, customVariables);