mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-3287 update database auth dialog, use isHidden (#1572)
This commit is contained in:
@@ -92,6 +92,7 @@ export class ConnectionAuthService extends Dependency {
|
||||
const result = await this.commonDialogService.open(DatabaseAuthDialog, {
|
||||
connection: key,
|
||||
networkHandlers,
|
||||
resetCredentials,
|
||||
});
|
||||
|
||||
if (resetCredentials && isConnectedInitially && result === DialogueStateResult.Rejected) {
|
||||
|
||||
@@ -196,7 +196,16 @@ export class ConnectionMenuBootstrap extends Bootstrap {
|
||||
}
|
||||
|
||||
if (action === ACTION_CONNECTION_CHANGE_CREDENTIALS) {
|
||||
return this.serverConfigResource.distributed && connection.credentialsSaved === true;
|
||||
return this.serverConfigResource.distributed;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
isHidden: (context, action) => {
|
||||
const connection = context.tryGet(DATA_CONTEXT_CONNECTION);
|
||||
|
||||
if (action === ACTION_CONNECTION_CHANGE_CREDENTIALS) {
|
||||
return !connection?.credentialsSaved;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -45,6 +45,7 @@ const styles = css`
|
||||
interface Payload {
|
||||
connection: IConnectionInfoParams;
|
||||
networkHandlers: string[];
|
||||
resetCredentials?: boolean;
|
||||
}
|
||||
|
||||
export const DatabaseAuthDialog: DialogComponent<Payload> = observer(function DatabaseAuthDialog({
|
||||
@@ -62,8 +63,8 @@ export const DatabaseAuthDialog: DialogComponent<Payload> = observer(function Da
|
||||
|
||||
let authModelId: string | null = null;
|
||||
|
||||
if (connection.connectionInfo?.authNeeded) {
|
||||
authModelId = connection.connectionInfo.authModel || driver?.defaultAuthModel || null;
|
||||
if (connection.connectionInfo?.authNeeded || payload.resetCredentials) {
|
||||
authModelId = connection.connectionInfo?.authModel || driver?.defaultAuthModel || null;
|
||||
}
|
||||
|
||||
return styled(useStyles(styles))(
|
||||
|
||||
Reference in New Issue
Block a user