Files
cloudbeaver/webapp/packages/plugin-connections/src/ConnectionForm/ConnectionAuthModelCredentials/ConnectionAuthModelCredentialsForm.tsx
T
2b90eb038e CB-4561 te UI dynamic connection credentials based on the users team (#2381)
* CB-4598 npe fix

* CB-4561 refactor: connection info resource

* CB-4561 refactor: connection info resource

* CB-4561 load credentials from secret in initConnection

* CB-4561 merge devel

* CB-4561 allow initial team secrets test

* CB-4561 remove ability to use any secret in test connection

* CB-4561 feat: shared credentials management

* CB-4561 feat: connection secret authentication

* CB-4561 little fix

* CB-4561 feat: shared credentials

* CB-4561 chore: remove save credentials checkbox for shared credentials

* CB-4561 fix: send saved state for shared connection credentials

* CB-4561 feat: change shared secret authentication description

* CB-4561 fix: pr review comments

* CB-4561 fix: disable connection test for shared connections in distributed env

* CB-4561 fix: types

---------

Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2024-02-20 16:42:46 +01:00

45 lines
1.3 KiB
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import { Container, ObjectPropertyInfoForm } from '@cloudbeaver/core-blocks';
import type { ObjectPropertyInfo } from '@cloudbeaver/core-sdk';
import { isSafari } from '@cloudbeaver/core-utils';
interface Props {
credentials?: Record<string, any>;
defaultCredentials?: Record<string, any>;
properties: ReadonlyArray<ObjectPropertyInfo>;
readonly?: boolean;
disabled?: boolean;
}
export const ConnectionAuthModelCredentialsForm = observer<Props>(function ConnectionAuthModelCredentialsForm({
credentials,
defaultCredentials,
properties,
readonly,
disabled,
}) {
return (
<Container wrap gap hideEmpty>
<ObjectPropertyInfoForm
autofillToken={isSafari ? 'section-connection-authentication section-secrets' : 'new-password'}
properties={properties}
state={credentials}
defaultState={defaultCredentials}
disabled={disabled}
readOnly={readonly}
showRememberTip
hideEmptyPlaceholder
tiny
/>
</Container>
);
});