Skip to content

Commit

Permalink
EPMRPP-90359 || Code Review fix - 1
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazarQSO committed May 8, 2024
1 parent 9726c60 commit a5bac6e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/src/common/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export const URLS = {
apiKeys: (userId) => `${urlCommonBase}users/${userId}/api-keys`,
apiKeyById: (userId, apiKeyId) => `${urlCommonBase}users/${userId}/api-keys/${apiKeyId}`,

organizationsList: (name) => `${urlBase}organizations${getQueryParams({ name })}`,
organizationsById: (organizationId) => `${urlBase}organizations/${organizationId}`,
organizationList: (name) => `${urlBase}organizations${getQueryParams({ name })}`,
organizationById: (organizationId) => `${urlBase}organizations/${organizationId}`,

projectByName: (projectKey) => `${urlBase}project/${projectKey}`,
project: (ids = []) => `${urlBase}project?ids=${ids.join(',')}`,
Expand Down
3 changes: 0 additions & 3 deletions app/src/controllers/auth/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import {
activeProjectKeySelector,
} from 'controllers/user';
import { FETCH_PROJECT_SUCCESS, fetchProjectAction } from 'controllers/project';
import { FETCH_ORGANIZATIONS_SUCCESS, fetchOrganizationsAction } from 'controllers/organizations';
import {
fetchPluginsAction,
fetchGlobalIntegrationsAction,
Expand Down Expand Up @@ -117,9 +116,7 @@ function* loginSuccessHandler({ payload }) {
yield put(fetchUserAction());
yield all([take([FETCH_USER_SUCCESS, FETCH_USER_ERROR]), take(SET_ACTIVE_PROJECT_KEY)]);
const projectKey = yield select(activeProjectKeySelector);
yield put(fetchOrganizationsAction());
yield put(fetchProjectAction(projectKey));
yield all([take(FETCH_PROJECT_SUCCESS), take(FETCH_ORGANIZATIONS_SUCCESS)]);
yield take(FETCH_PROJECT_SUCCESS);
yield put(fetchPluginsAction());
yield put(fetchGlobalIntegrationsAction());
Expand Down
4 changes: 1 addition & 3 deletions app/src/controllers/initialData/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
authSuccessAction,
} from 'controllers/auth';
import { FETCH_PROJECT_SUCCESS, fetchProjectAction } from 'controllers/project';
import { FETCH_ORGANIZATIONS_SUCCESS, fetchOrganizationsAction } from 'controllers/organizations';
import {
fetchGlobalIntegrationsAction,
fetchPluginsAction,
Expand All @@ -43,9 +42,8 @@ function* fetchInitialData() {
const userResult = yield take([FETCH_USER_SUCCESS, FETCH_USER_ERROR]);
if (!userResult.error) {
const { payload: activeProjectKey } = yield take(SET_ACTIVE_PROJECT_KEY);
yield put(fetchOrganizationsAction());
yield put(fetchProjectAction(activeProjectKey));
yield all([take(FETCH_PROJECT_SUCCESS), take(FETCH_ORGANIZATIONS_SUCCESS)]);
yield take(FETCH_PROJECT_SUCCESS);
yield put(fetchPluginsAction());
yield put(fetchGlobalIntegrationsAction());
yield put(authSuccessAction());
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/organizations/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { fetchOrganizationsSuccessAction } from './actionCreators';

function* fetchOrganizations() {
try {
const organizations = yield call(fetch, URLS.organizationsList());
const organizations = yield call(fetch, URLS.organizationList());
yield put(fetchOrganizationsSuccessAction(organizations?.content || []));
} catch (error) {
yield put(showDefaultErrorNotification(error));
Expand Down
2 changes: 2 additions & 0 deletions app/src/routes/routesMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import { fetchAllUsersAction } from 'controllers/administrate/allUsers/actionCre
import { fetchLogPageData } from 'controllers/log';
import { fetchHistoryPageInfoAction } from 'controllers/itemsHistory';
import { fetchProjectsAction } from 'controllers/administrate/projects';
import { fetchOrganizationsAction } from 'controllers/organizations';
import { startSetViewMode } from 'controllers/administrate/projects/actionCreators';
import { SIZE_KEY } from 'controllers/pagination';
import { setSessionItem, updateStorageItem } from 'common/utils/storageUtils';
Expand Down Expand Up @@ -127,6 +128,7 @@ const routesMap = {
path: '/administrate/projects',
thunk: (dispatch) => {
dispatch(fetchProjectsAction());
dispatch(fetchOrganizationsAction());
dispatch(startSetViewMode());
},
},
Expand Down

0 comments on commit a5bac6e

Please sign in to comment.