Skip to content

Commit 89b4d1f

Browse files
dbeaver/pro#7357 use the same saved value indicator across the app (#4099)
* dbeaver/pro#7357 use the same saved value indicator across the app * dbeaver/pro#7357 check id first --------- Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
1 parent 0bd8923 commit 89b4d1f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

webapp/packages/core-blocks/src/ObjectPropertyInfo/ObjectPropertyInfoForm/RenderField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Textarea } from '../../FormControls/Textarea.js';
2929
import { Link } from '../../Link.js';
3030
import { useTranslate } from '../../localization/useTranslate.js';
3131
import { evaluate } from '../evaluate.js';
32+
import { SAVED_VALUE_INDICATOR } from '../../SAVED_VALUE_INDICATOR.js';
3233

3334
interface RenderFieldProps {
3435
property: IObjectPropertyInfo;
@@ -262,7 +263,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
262263
readOnly={readonly || disabled}
263264
autoComplete={autocomplete}
264265
className={className}
265-
canShowPassword={canShowPassword}
266+
canShowPassword={!!property.id && state[property.id] !== SAVED_VALUE_INDICATOR && canShowPassword}
266267
onFocus={onFocus}
267268
>
268269
{property.displayName}
@@ -284,7 +285,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
284285
readOnly={readonly || disabled}
285286
autoComplete={autocomplete}
286287
className={className}
287-
canShowPassword={canShowPassword}
288+
canShowPassword={value !== SAVED_VALUE_INDICATOR && canShowPassword}
288289
onFocus={onFocus}
289290
>
290291
{property.displayName}

webapp/packages/plugin-connections/src/ConnectionForm/SSL/SAVED_VALUE_INDICATOR.ts renamed to webapp/packages/core-blocks/src/SAVED_VALUE_INDICATOR.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2026 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
77
*/
8+
89
/** We use it to understand whether the value was saved on the backend side or not */
9-
export const SAVED_VALUE_INDICATOR = '********';
10+
export const SAVED_VALUE_INDICATOR = '******';

webapp/packages/core-blocks/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,4 @@ export * from './Alert.js';
262262
export * from './ObjectPropertyInfo/evaluate.js';
263263
export * from './ObjectPropertyInfo/getObjectPropertyDefaults.js';
264264
export * from './useVisible.js';
265+
export * from './SAVED_VALUE_INDICATOR.js';

webapp/packages/plugin-connections/src/ConnectionForm/SSL/SSL.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
IconOrImage,
1919
ObjectPropertyInfoForm,
2020
s,
21+
SAVED_VALUE_INDICATOR,
2122
Switch,
2223
useAdministrationSettings,
2324
useAutoLoad,
@@ -33,7 +34,6 @@ import type { NetworkHandlerConfigInput, NetworkHandlerDescriptor } from '@cloud
3334
import { type TabContainerPanelComponent, useTab } from '@cloudbeaver/core-ui';
3435
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';
3536

36-
import { SAVED_VALUE_INDICATOR } from './SAVED_VALUE_INDICATOR.js';
3737
import styles from './SSL.module.css';
3838
import type { IConnectionFormProps } from '../IConnectionFormState.js';
3939
import { ConnectionInfoNetworkHandlersResource } from '@cloudbeaver/core-connections';

0 commit comments

Comments
 (0)