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: Updating the login button names for OIDC & SAML to get it from tenant config #32979

Merged
merged 4 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions app/client/src/ce/sagas/SuperUserSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
} from "@appsmith/constants/messages";
import { getCurrentUser } from "selectors/usersSelectors";
import { EMAIL_SETUP_DOC } from "constants/ThirdPartyConstants";
import { getCurrentTenant } from "@appsmith/actions/tenantActions";
import { toast } from "design-system";
import AnalyticsUtil from "@appsmith/utils/AnalyticsUtil";
import {
Expand Down Expand Up @@ -117,8 +116,6 @@ export function* SaveAdminSettingsSaga(
type: ReduxActionTypes.SAVE_ADMIN_SETTINGS_SUCCESS,
});

yield put(getCurrentTenant());

yield put({
type: ReduxActionTypes.FETCH_ADMIN_SETTINGS_SUCCESS,
payload: settings,
Expand Down
1 change: 1 addition & 0 deletions app/client/src/pages/AdminSettings/DisconnectService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function DisconnectService(props: {
<Callout kind="error">{props.warning}</Callout>
<Button
data-testid="disconnect-service-button"
isLoading={disconnectCalled}
kind="error"
onClick={() =>
warnDisconnectAuth ? callDisconnect() : setWarnDisconnectAuth(true)
Expand Down
14 changes: 12 additions & 2 deletions app/client/src/pages/UserAuth/ThirdPartyAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
import { Button } from "design-system";
import { isTenantConfig } from "@appsmith/utils/adminSettingsHelpers";
import { useSelector } from "react-redux";
import { getTenantConfig } from "@appsmith/selectors/tenantSelectors";

const ThirdPartyAuthWrapper = styled.div`
display: flex;
Expand All @@ -34,16 +37,23 @@ function SocialLoginButton(props: {
logo: string;
name: string;
url: string;
label?: string;
type: SignInType;
}) {
const tenantConfiguration = useSelector(getTenantConfig);
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
let url = props.url;
const redirectUrl = queryParams.get("redirectUrl");
if (redirectUrl != null) {
url += `?redirectUrl=${encodeURIComponent(redirectUrl)}`;
}

let buttonLabel = props.name;

if (props.name && isTenantConfig(props.name)) {
buttonLabel = tenantConfiguration[props.name];
}

return (
<StyledButton
href={url}
Expand Down Expand Up @@ -72,7 +82,7 @@ function SocialLoginButton(props: {
}
>
<div className="login-method" data-testid={`login-with-${props.name}`}>
{props.label ?? `${props.name}`}
{buttonLabel}
</div>
</StyledButton>
);
Expand Down