Fix UI :- fix the Password field showing in SSO login (#7811)

* Fix the Password field showing in SSO login

* changes as per comments
This commit is contained in:
Ashish Gupta 2022-09-30 18:07:29 +05:30 committed by GitHub
parent 986ce4a8b8
commit c4d67f489e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ import { AxiosError } from 'axios';
import classNames from 'classnames';
import { isUndefined } from 'lodash';
import { EditorContentRef } from 'Models';
import React, { useRef, useState } from 'react';
import React, { useMemo, useRef, useState } from 'react';
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
import { generateRandomPwd } from '../../axiosAPIs/auth-API';
import { getBotsPagePath, getUsersPagePath } from '../../constants/constants';
@ -36,6 +36,7 @@ import {
validEmailRegEx,
} from '../../constants/regex.constants';
import { PageLayoutType } from '../../enums/layout.enum';
import { AuthTypes } from '../../enums/signin.enum';
import { CreatePasswordGenerator } from '../../enums/user.enum';
import {
CreatePasswordType,
@ -109,6 +110,11 @@ const CreateUser = ({
{} as SSOClientConfig
);
const isAuthProviderBasic = useMemo(
() => authConfig?.provider === AuthTypes.BASIC,
[authConfig]
);
const slashedBreadcrumbList = [
{
name: forceBot ? 'Bots' : 'Users',
@ -775,6 +781,8 @@ const CreateUser = ({
<RichTextEditor initialValue={description} ref={markdownRef} />
</Form.Item>
{isAuthProviderBasic && (
<>
<Radio.Group
name="passwordGenerator"
value={passwordGenerator}
@ -861,7 +869,9 @@ const CreateUser = ({
</div>
<div className="w-8 h-7 flex-center">
<CopyToClipboardButton copyText={generatedPassword} />
<CopyToClipboardButton
copyText={generatedPassword}
/>
</div>
</div>
}
@ -871,6 +881,8 @@ const CreateUser = ({
</Form.Item>
</div>
)}
</>
)}
{!forceBot && (
<>