Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cherry picking release blocker around GAC #33047

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 13 additions & 6 deletions app/client/src/ee/sagas/SuperUserSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ import {
RestryRestartServerPoll,
SendTestEmail,
} from "ce/sagas/SuperUserSagas";
import type { ReduxAction } from "@appsmith/constants/ReduxActionConstants";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import type { User } from "constants/userConstants";
import { takeLatest, all } from "redux-saga/effects";
import { takeLatest, all, select } from "redux-saga/effects";
import { getCurrentUser } from "selectors/usersSelectors";
import type { FeatureFlags } from "@appsmith/entities/FeatureFlag";
import { selectFeatureFlags } from "@appsmith/selectors/featureFlagsSelectors";
import { isGACEnabled } from "@appsmith/utils/planHelpers";
import { getShowAdminSettings } from "@appsmith/utils/BusinessFeatures/adminSettingsHelpers";

export function* InitSuperUserSaga(action: ReduxAction<User>) {
const user = action.payload;
if (user.isSuperUser) {
export function* InitSuperUserSaga() {
const user: User = yield select(getCurrentUser);
const featureFlags: FeatureFlags = yield select(selectFeatureFlags);
const isFeatureEnabled = isGACEnabled(featureFlags);

if (getShowAdminSettings(isFeatureEnabled, user)) {
yield all([
takeLatest(ReduxActionTypes.FETCH_ADMIN_SETTINGS, FetchAdminSettingsSaga),
takeLatest(
Expand All @@ -34,7 +41,7 @@ export function* InitSuperUserSaga(action: ReduxAction<User>) {

export default function* SuperUserSagas() {
yield takeLatest(
ReduxActionTypes.FETCH_USER_DETAILS_SUCCESS,
ReduxActionTypes.END_CONSOLIDATED_PAGE_LOAD,
InitSuperUserSaga,
);
}