Skip to content

Commit

Permalink
CB-5767 Easy-config - server configuration fields respond to Enter ke…
Browse files Browse the repository at this point in the history
…y press (#2980)

* CB-5767 makes config wizzard go next item when confirming serverConfig form

* CB-5767 removes extra handleEnter for button click enter

---------

Co-authored-by: Evgenia Bezborodova <[email protected]>
  • Loading branch information
sergeyteleshev and EvgeniaBzzz authored Oct 9, 2024
1 parent 2698e71 commit a4c3624
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"label": "Build CE",
"type": "shell",
"windows": {
"command": "./build-sqlite.bat"
"command": "./build.bat"
},
"osx": {
"command": "./build-sqlite.sh"
"command": "./build.sh"
},
"options": {
"cwd": "${workspaceFolder}/deploy"
Expand Down
7 changes: 0 additions & 7 deletions webapp/packages/core-blocks/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ export const Button = observer<ButtonProps>(function Button({
['click'],
);

function handleEnter(event: React.KeyboardEvent<HTMLElement>) {
if (event.key === 'Enter') {
event.currentTarget.click();
}
}

loading = state.loading || loading;

if (loading) {
Expand All @@ -89,7 +83,6 @@ export const Button = observer<ButtonProps>(function Button({
<Button
role="button"
tabIndex={0}
onKeyDown={handleEnter}
{...rest}
type={type}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { observer } from 'mobx-react-lite';

import { type AdministrationItemContentComponent } from '@cloudbeaver/core-administration';
import { type AdministrationItemContentComponent, ConfigurationWizardService } from '@cloudbeaver/core-administration';
import {
ColoredContainer,
ConfirmationDialog,
Expand Down Expand Up @@ -51,6 +51,7 @@ export const ServerConfigurationPage: AdministrationItemContentComponent = obser
const commonDialogService = useService(CommonDialogService);
const notificationService = useService(NotificationService);
const serverConfigurationFormStateManager = useService(ServerConfigurationFormStateManager);
const configurationWizardService = useService(ConfigurationWizardService);

const formState = serverConfigurationFormStateManager.formState!;
const part = getServerConfigurationFormPart(formState);
Expand All @@ -71,6 +72,11 @@ export const ServerConfigurationPage: AdministrationItemContentComponent = obser
const changed = part.isChanged;

async function save() {
if (configurationWizard) {
configurationWizardService.next();
return;
}

if (changed) {
const result = await commonDialogService.open(ConfirmationDialog, {
title: 'administration_server_configuration_save_confirmation_title',
Expand Down

0 comments on commit a4c3624

Please sign in to comment.