Skip to content

Commit

Permalink
Merge branch 'devel' into CB-5707-change-font-size-in-dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-anton-t authored Oct 10, 2024
2 parents 5d57f71 + 1a51928 commit f78b098
Show file tree
Hide file tree
Showing 37 changed files with 83 additions and 129 deletions.
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ currently being supported with security updates.
| ------- | --------- |
| 22.x | yes |
| 23.x | yes |
| 24.x | yes |

## Reporting a Vulnerability

Please report (suspected) security vulnerabilities to [email protected].
You will receive a response from us within 48 hours.
If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.
Please report (suspected) security vulnerabilities to [email protected].
You will receive a response from us within 48 hours.
If the issue is confirmed, we will release a patch as soon as possible, depending on complexity, but historically, within a few days.
24 changes: 2 additions & 22 deletions config/GlobalConfiguration/.dbeaver/data-sources.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
{
"folders": {},
"connections": {
"postgresql-template-1": {
"provider": "postgresql",
"driver": "postgres-jdbc",
"name": "PostgreSQL (Template)",
"save-password": false,
"show-system-objects": false,
"read-only": true,
"template": true,
"configuration": {
"host": "localhost",
"port": "5432",
"database": "postgres",
"url": "jdbc:postgresql://localhost:5432/postgres",
"type": "dev",
"provider-properties": {
"@dbeaver-show-non-default-db@": "false"
}
}
}
}
"folders": {},
"connections": {}
}
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/src/FormControls/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const Filter = observer<ControlledProps | ObjectsProps<any, any>>(functio
autoComplete="off"
className={s(styles, { inputField: true })}
placeholder={placeholder}
disabled={disabled}
readOnly={disabled}
name={name}
value={value}
onChange={handleChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@
align-items: center;
justify-content: center;
}

.input[disabled] + .iconContainer {
cursor: auto;
opacity: 0.8;
}
.input:not(:only-child) {
padding-right: 32px !important;
Expand Down
7 changes: 7 additions & 0 deletions webapp/packages/core-blocks/src/InfoItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@
align-items: center;
flex: 0 0 auto;
}

.iconOrImage {
width: 24px;
height: 24px;
margin-right: 16px;

&.compact {
width: 18px;
height: 18px;
margin-right: 8px;
}
}
5 changes: 3 additions & 2 deletions webapp/packages/core-blocks/src/InfoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ import { useS } from './useS.js';
export interface IInfoItem {
info: TLocalizationToken;
icon?: string;
compact?: boolean;
}

interface Props extends IInfoItem {
className?: string;
}

export const InfoItem = observer<Props>(function InfoItem({ info, icon = '/icons/info_icon.svg', className }) {
export const InfoItem = observer<Props>(function InfoItem({ info, compact, icon = '/icons/info_icon.svg', className }) {
const styles = useS(style);

const translate = useTranslate();
return (
<div className={s(styles, { infoItem: true }, className)}>
<IconOrImage className={s(styles, { iconOrImage: true })} icon={icon} />
<IconOrImage className={s(styles, { iconOrImage: true, compact })} icon={icon} />
{translate(info)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
placeholder={passwordSavedMessage}
name={property.id!}
value={value}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
className={className}
>
{property.displayName ?? ''}
Expand All @@ -243,8 +242,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
autoHide={autoHide}
description={property.hint}
placeholder={passwordSavedMessage}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`}
className={className}
canShowPassword={canShowPassword}
Expand All @@ -266,8 +264,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
defaultValue={defaultValue}
description={property.hint}
placeholder={passwordSavedMessage}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`}
className={className}
canShowPassword={canShowPassword}
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ export default [

['core_connections_settings_disable', 'Отключить'],
['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'],
['connections_templates_deprecated_message', 'Шаблоны подключений больше не поддерживаются и будут удалены в будущих релизах'],
];
8 changes: 3 additions & 5 deletions webapp/packages/core-connections/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export default [
['connections_connection_authentication_save_credentials_for_session', '当前会话不再询问'],
['connections_connection_authentication_save_credentials_for_session_tooltip', '注销后将移除凭证'],
['connections_connection_edit_save_credentials_shared', '为所有访问用户保存凭证'],
[
'connections_connection_edit_save_credentials_shared_tooltip',
'凭证将用于为所有访问用户自动连接数据库',
],
['connections_connection_edit_save_credentials_shared_tooltip', '凭证将用于为所有访问用户自动连接数据库'],
['connections_connection_share_credentials', '分享凭证至团队'],
['connections_connection_share_credentials_tooltip', '凭证将用于为所有团队用户自动连接数据库'],
['connections_connection_credentials_provisioning', '认证凭据'],
Expand All @@ -52,7 +49,7 @@ export default [
['connections_connection_edit_search_hosts', '主机名称'],
['connections_connection_address', '地址'],
['connections_connection_folder', '文件夹'],
['connections_connection_folder_validation', "文件夹名称不得包含以下符号 / : \" \\ ' <> | ? * 且不能以点开头"],
['connections_connection_folder_validation', '文件夹名称不得包含以下符号 / : " \\ \' <> | ? * 且不能以点开头'],
['connections_connection_name', '连接名称'],
['connections_connection_access_admin_info', '管理员可以查看除其他用户的私有连接之外的所有连接。'],
['connections_connection_description', '描述'],
Expand Down Expand Up @@ -95,4 +92,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
2 changes: 1 addition & 1 deletion webapp/packages/core-theming/src/styles/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $mdc-checkbox-icon-size: 16px;
@extend .mdc-checkbox__native-control;

&:disabled {
opacity: 0;
opacity: 0 !important;
}
}
.theme-checkbox__background {
Expand Down
15 changes: 4 additions & 11 deletions webapp/packages/core-theming/src/styles/_form-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,19 @@
@include mdc-theme-prop(border-color, primary, false);
}

&:not([data-select='true'])[readonly] {
&:not([data-select='true'])[readonly],
&:not([data-select='true'])[disabled] {
@include mdc-theme-prop(color, input-color-readonly, false);
@include mdc-theme-prop(border-color, input-border-readonly, false);
@include mdc-theme-prop(background-color, input-background-readonly, false);
opacity: 1;
cursor: text;
pointer-events: all;
&:-internal-autofill-selected,
&:-internal-autofill-previewed {
box-shadow: 0 0 0 50px $input-background-readonly inset;
}
}
&[disabled] {
@include mdc-theme-prop(color, input-color-disabled, false);
@include mdc-theme-prop(border-color, input-border-disabled, false);
@include mdc-theme-prop(background-color, input-background-disabled, false);
opacity: 1;
&:-internal-autofill-selected,
&:-internal-autofill-previewed {
box-shadow: 0 0 0 50px $input-background-disabled inset;
}
}
&[data-embedded='true'] {
&[disabled],
&:not([data-select='true'])[readonly] {
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-theming/src/styles/_theme-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $input-color-readonly: darken($input-color, 5%);
$input-border: #585958;
$input-border-disabled: darken($input-border, 10%);
$input-border-readonly: darken($input-border, 5%);
$input-background: $mdc-theme-secondary;
$input-background-disabled: $input-background;
$input-background-readonly: $input-background;
$input-background: $mdc-theme-surface;
$input-background-disabled: #3e3e3e;
$input-background-readonly: #3e3e3e;

$mdc-theme-text-colors: (
dark: (
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-theming/src/styles/main/color.pure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* you may not use this file except in compliance with the License.
*/

:disabled, [aria-disabled="true"] {
:disabled,
[aria-disabled='true'] {
pointer-events: none;
cursor: default;
opacity: 0.5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export const TeamOptions: TabContainerPanelComponent<ITeamFormProps> = observer(
return (
<Container overflow>
<Group small gap>
<InputField name="teamId" state={state.config} readOnly={state.readonly || edit} disabled={state.disabled} required tiny fill>
<InputField name="teamId" state={state.config} readOnly={state.readonly || edit || state.disabled} required tiny fill>
{translate('administration_teams_team_id')}
</InputField>
<InputField name="teamName" state={state.config} readOnly={state.readonly} disabled={state.disabled} tiny fill>
<InputField name="teamName" state={state.config} readOnly={state.readonly || state.disabled} tiny fill>
{translate('administration_teams_team_name')}
</InputField>
<Textarea name="description" state={state.config} readOnly={state.readonly} disabled={state.disabled} tiny fill>
<Textarea name="description" state={state.config} readOnly={state.readonly || state.disabled} tiny fill>
{translate('administration_teams_team_description')}
</Textarea>
</Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const UserFormInfoCredentials = observer<Props>(function UserFormInfoCred
return (
<Container gap vertical>
<GroupTitle keepSize>{translate('authentication_user_credentials')}</GroupTitle>
<InputField type="text" name="userId" state={tabState.state} readOnly={editing} disabled={disabled} keepSize tiny required>
<InputField type="text" name="userId" state={tabState.state} readOnly={editing || disabled} keepSize tiny required>
{translate('authentication_user_name')}
</InputField>
{local && (
Expand All @@ -67,7 +67,7 @@ export const UserFormInfoCredentials = observer<Props>(function UserFormInfoCred
autoComplete="new-password"
placeholder={editing ? PASSWORD_PLACEHOLDER : ''}
canShowPassword={tabState.state['password'] !== ''}
disabled={disabled}
readOnly={disabled}
required={!editing}
keepSize
tiny
Expand All @@ -79,7 +79,7 @@ export const UserFormInfoCredentials = observer<Props>(function UserFormInfoCred
type="password"
name="passwordRepeat"
placeholder={editing ? PASSWORD_PLACEHOLDER : ''}
disabled={disabled}
readOnly={disabled}
required={!editing}
canShowPassword
keepSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const AuthProviderForm = observer<Props>(function AuthProviderForm({ prov
type={parameter.encryption === 'none' ? 'text' : 'password'}
name={parameter.id}
state={credentials.credentials}
disabled={authenticate}
readOnly={authenticate}
canShowPassword={false}
autoComplete={`section-authentication section-${provider.id} ${configuration?.id ?? ''} ${parameter.id}`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
CommonDialogWrapper,
ErrorMessage,
Form,
InfoItem,
s,
useAdministrationSettings,
useErrorDetails,
Expand All @@ -38,7 +39,12 @@ export const ConnectionDialog: DialogComponent<null, null> = observer(function C
const dialog = useConnectionDialog(rejectDialog);
const errorDetails = useErrorDetails(dialog.connectException);

const subTitle = dialog.step === ConnectionStep.Connection ? dialog.template?.name : undefined;
const subTitle =
dialog.step === ConnectionStep.Connection ? (
dialog.template?.name
) : (
<InfoItem info={translate('connections_templates_deprecated_message')} compact />
);

return (
<CommonDialogWrapper size="large" fixedSize={dialog.step === ConnectionStep.ConnectionTemplateSelect}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
ExceptionMessageStyles,
Group,
GroupItem,
GroupSubTitle,
GroupTitle,
InfoItem,
Loader,
s,
SContext,
Expand All @@ -25,13 +25,11 @@ import {
useS,
useTranslate,
} from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';

import ConnectionsAdministrationStyle from './ConnectionsAdministration.module.css';
import { ConnectionsTable } from './ConnectionsTable/ConnectionsTable.js';
import { useConnectionsTable } from './ConnectionsTable/useConnectionsTable.js';
import { CreateConnection } from './CreateConnection/CreateConnection.js';
import { CreateConnectionService } from './CreateConnectionService.js';

const registry: StyleRegistry = [
[
Expand All @@ -50,26 +48,16 @@ export const ConnectionsAdministration = observer<AdministrationItemContentProps
}) {
const style = useS(ConnectionsAdministrationStyle);
const translate = useTranslate();
const service = useService(CreateConnectionService);

const state = useConnectionsTable();

return (
<ColoredContainer vertical wrap parent gap>
<Group keepSize dense>
<GroupSubTitle>{translate('templates_administration_info_message')}</GroupSubTitle>
<InfoItem info={translate('connections_templates_deprecated_message')} />
</Group>
<Group box keepSize>
<ToolsPanel rounded>
<ToolsAction
title={translate('connections_administration_tools_add_tooltip')}
icon="add"
viewBox="0 0 24 24"
disabled={!!sub || state.loading}
onClick={service.create}
>
{translate('ui_add')}
</ToolsAction>
<ToolsAction
title={translate('connections_administration_tools_refresh_tooltip')}
icon="refresh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ConnectionsAdministrationService extends Bootstrap {
canDeActivate: this.canDeActivateCreate.bind(this),
},
],
isHidden: () => this.serverConfigResource.distributed,
isHidden: () => this.serverConfigResource.distributed || !this.connectionInfoResource.values.some(connection => connection.template),
getContentComponent: () => ConnectionsAdministration,
getDrawerComponent: () => ConnectionsDrawerItem,
onDeActivate: this.refreshUserConnections.bind(this),
Expand All @@ -78,6 +78,10 @@ export class ConnectionsAdministrationService extends Bootstrap {
this.connectionDetailsPlaceholder.add(SSH, 2);
}

override async load(): Promise<void> {
await this.connectionInfoResource.load();
}

private async refreshUserConnections(configuration: boolean, outside: boolean, outsideAdminPage: boolean): Promise<void> {
// TODO: we have to track users' leaving the page
if (outside) {
Expand Down
Loading

0 comments on commit f78b098

Please sign in to comment.