How to use the actions.uiActions.setUiState function in actions

To help you get started, we’ve selected a few actions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github web-pal / chronos-timetracker / app / sagas / auth.js View on Github external
const { payload } = yield take(actionTypes.LOGIN_REQUEST);
      const host = yield call(transformValidHost, payload.host);
      const protocol = host.protocol.slice(0, -1);

      yield put(authActions.addAuthDebugMessage([
        { string: 'Login request...' },
        { string: `host: ${host.hostname}` },
        { string: `protocol: ${protocol}` },
        { string: `port: ${host.port}` },
        { string: `path_prefix: ${host.pathname}` },
        { string: `username: ${payload.username}` },
        { string: 'password: ***' },
      ]));

      yield put(uiActions.setUiState('loginRequestInProcess', true));
      yield put(uiActions.setUiState('loginError', null));
      yield call(
        jira.basicAuth,
        {
          ...payload,
          host: host.hostname,
          protocol,
          port: host.port,
          path_prefix: host.pathname,
        },
      );
      // Test request for check auth
      const {
        debug,
        result,
      } = yield call(Api.jiraProfile, true);
      yield put(authActions.addAuthDebugMessage([
github web-pal / chronos-timetracker / app / renderer / sagas / auth.js View on Github external
baseUrl: href.replace(/\/$/, ''),
      });
      yield eff.put(authActions.authRequest({
        protocol,
        hostname,
        port,
        pathname,
        cookies,
      }));
    } catch (err) {
      if (err && err.message) {
        yield eff.put(uiActions.setUiState({
          authError: err.message,
        }));
      } else {
        yield eff.put(uiActions.setUiState(
          'authError',
          'Can not authenticate user. Please try again',
        ));
      }
      yield eff.call(throwError, err);
      yield eff.put(uiActions.setUiState({
        authRequestInProcess: false,
      }));
    }
  }
}
github web-pal / chronos-timetracker / app / renderer / sagas / filters.js View on Github external
},
            } : {}
        ),
        body: {
          ...data,
          jql,
        },
      },
    );
    yield eff.fork(notify, {
      title: `Save filter ${filter.name}`,
    });
    yield eff.put(actions.succeeded({
      resources: [filter],
    }));
    yield eff.put(uiActions.setUiState({
      saveFilterDialogOpen: false,
      issuesSourceId: filter.id,
      filterStatusesIsFetched: false,
    }));
    yield eff.put(resourcesActions.clearResourceList({
      resourceType: 'issues',
      list: 'recentIssues',
    }));
    yield eff.put(issuesActions.refetchIssuesRequest());
  } catch (err) {
    throwError(err);
    yield eff.put(actions.failed());
    const errObj = JSON.parse(err);
    if (errObj.body.errorMessages.length > 0) {
      yield eff.fork(notify, {
        title: 'Failed to save filter',
github web-pal / chronos-timetracker / app / renderer / sagas / initialize.js View on Github external
export function* initializeApp(): Generator<*, *, *> {
  yield eff.put(uiActions.setUiState({
    initializeInProcess: true,
  }));
  try {
    const accounts = yield eff.call(
      getElectronStorage,
      'accounts',
      [],
    );
    yield eff.put(uiActions.setUiState({
      accounts,
    }));
    const authCredentials = yield eff.call(
      getElectronStorage,
      'last_used_account',
    );
    const authDataExist = (
github web-pal / chronos-timetracker / app / sagas / auth.js View on Github external
);
      yield put(uiActions.setUiState('loginRequestInProcess', false));
      trackMixpanel('Jira login');
      incrementMixpanel('Jira login', 1);
    } catch (err) {
      if (err.debug) {
        err.debug.options.auth.password = '***';
        err.debug.request.headers.authorization = '***';
        yield put(authActions.addAuthDebugMessage([
          {
            json: err.debug,
          },
        ]));
      }
      yield put(uiActions.setUiState('loginRequestInProcess', false));
      yield put(uiActions.setUiState(
        'loginError',
        'Can not authenticate user. Please try again',
      ));
      yield call(throwError, err.result ? err.result : err);
    }
  }
}
github web-pal / chronos-timetracker / app / renderer / sagas / updater.js View on Github external
function* watchUpdateNotAvailable(): Generator<*, *, *> {
  while (true) {
    const meta = yield take(updateNotAvailableChannel);
    yield call(
      infoLog,
      'update is not availible',
      meta,
    );
    yield put(uiActions.setUiState('updateCheckRunning', false));
  }
}
github web-pal / chronos-timetracker / app / sagas / updater.js View on Github external
function* watchUpdateNotAvailable(): Generator<*, *, *> {
  while (true) {
    const meta = yield take(updateNotAvailableChannel);
    yield call(
      infoLog,
      'update is not availible',
      meta,
    );
    yield put(uiActions.setUiState('updateCheckRunning', false));
  }
}
github web-pal / chronos-timetracker / app / sagas / ui.js View on Github external
function* onSidebarChange(sidebarType) {
  if (sidebarType === 'recent') {
    const recentIssues = yield select(getResourceIds('issues', 'recentIssues'));
    if (!recentIssues.length) {
      yield put(issuesActions.fetchRecentIssuesRequest());
    }
  }
  yield put(uiActions.setUiState('sidebarFiltersIsOpen', false));
}
github web-pal / chronos-timetracker / app / renderer / sagas / updater.js View on Github external
function* watchCheckingForUpdates(): Generator<*, *, *> {
  while (true) {
    yield take(checkingForUpdatesChannel);
    yield put(uiActions.setUiState('updateCheckRunning', true));
  }
}
github web-pal / chronos-timetracker / app / sagas / updater.js View on Github external
function* watchCheckingForUpdates(): Generator<*, *, *> {
  while (true) {
    yield take(checkingForUpdatesChannel);
    yield put(uiActions.setUiState('updateCheckRunning', true));
  }
}

actions

Actions for a resourceful controller, CRUD

MIT
Latest version published 9 years ago

Package Health Score

47 / 100
Full package analysis