mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Merge remote-tracking branch 'origin/devel' into devel
This commit is contained in:
@@ -59,10 +59,6 @@ export class UsersResource extends CachedMapResource<string, AdminUserInfo> {
|
||||
}
|
||||
|
||||
async loadConnections(userId: string): Promise<AdminConnectionGrantInfo[]> {
|
||||
if (this.isNew(userId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const { grantedConnections } = await this.graphQLService.sdk.getUserGrantedConnections({ userId });
|
||||
|
||||
return grantedConnections;
|
||||
@@ -127,18 +123,14 @@ export class UsersResource extends CachedMapResource<string, AdminUserInfo> {
|
||||
if (this.isActiveUser(key.list[i])) {
|
||||
throw new Error('You can\'t delete current logged user');
|
||||
}
|
||||
if (!this.isNew(key.list[i])) {
|
||||
await this.graphQLService.sdk.deleteUser({ userId: key.list[i] });
|
||||
}
|
||||
await this.graphQLService.sdk.deleteUser({ userId: key.list[i] });
|
||||
this.data.delete(key.list[i]);
|
||||
}
|
||||
} else {
|
||||
if (this.isActiveUser(key)) {
|
||||
throw new Error('You can\'t delete current logged user');
|
||||
}
|
||||
if (!this.isNew(key)) {
|
||||
await this.graphQLService.sdk.deleteUser({ userId: key });
|
||||
}
|
||||
await this.graphQLService.sdk.deleteUser({ userId: key });
|
||||
this.data.delete(key);
|
||||
}
|
||||
this.markUpdated(key);
|
||||
|
||||
@@ -35,7 +35,7 @@ export function useFocus<T extends HTMLElement>({
|
||||
firstFocusable.focus();
|
||||
}
|
||||
}
|
||||
}, [focusFirstChild]);
|
||||
}, [focusFirstChild, reference.current]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!reference.current) {
|
||||
@@ -67,7 +67,7 @@ export function useFocus<T extends HTMLElement>({
|
||||
element.removeEventListener('focusin', focusHandler);
|
||||
element.removeEventListener('focusout', blurHandler);
|
||||
};
|
||||
}, []);
|
||||
}, [reference.current]);
|
||||
|
||||
return [reference, focus];
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ export const DatabaseList = observer(function DatabaseList({
|
||||
}
|
||||
}, [onSearch]);
|
||||
|
||||
const placeholderMessage = isSearched ? 'ui_no_matches_placeholder' : 'connections_administration_search_database_tip';
|
||||
const placeholderMessage = isSearched ? 'connections_not_found' : 'connections_administration_search_database_tip';
|
||||
|
||||
return styled(styles)(
|
||||
<SubmittingForm className={className} onSubmit={onSearch}>
|
||||
|
||||
@@ -26,4 +26,5 @@ export default [
|
||||
['connections_connection_create_fail', 'Failed to create connection'],
|
||||
['connections_connection_save_fail', 'Failed to save connection'],
|
||||
['connections_driver_search_placeholder', 'Type driver name...'],
|
||||
['connections_not_found', 'No database connections were found'],
|
||||
];
|
||||
|
||||
@@ -15,7 +15,7 @@ export default [
|
||||
['connections_connection_edit_search_hosts', 'Названия хостов'],
|
||||
['connections_connection_address', 'Адрес'],
|
||||
['connections_connection_name', 'Название'],
|
||||
['connections_connection_description', 'Описапние'],
|
||||
['connections_connection_description', 'Описание'],
|
||||
['connections_connection_driver', 'Драйвер'],
|
||||
['connections_connection_host', 'Хост'],
|
||||
['connections_connection_port', 'Порт'],
|
||||
@@ -25,4 +25,5 @@ export default [
|
||||
['connections_connection_create_fail', 'Не удалось создать подключение'],
|
||||
['connections_connection_save_fail', 'Не удалось сохранить подключение'],
|
||||
['connections_driver_search_placeholder', 'Введите название драйвера...'],
|
||||
['connections_not_found', 'Подключения к базам данных не найдены'],
|
||||
];
|
||||
|
||||
@@ -91,7 +91,7 @@ function NestedDialog({
|
||||
// TODO: place Dialog inside CommonDialogWrapper, so we can pass aria-label
|
||||
return styled(styles)(
|
||||
<>
|
||||
<DialogBackdrop {...dialogState} onClick={backdropClickHandler}>
|
||||
<DialogBackdrop {...dialogState} onMouseDown={backdropClickHandler}>
|
||||
<Dialog {...dialogState} hideOnClickOutside={false}>
|
||||
<DialogComponent
|
||||
payload={dialog.payload}
|
||||
|
||||
@@ -25,16 +25,18 @@ export class Executor<T> implements IExecutor<T> {
|
||||
|
||||
const context = new ExecutionContext(data);
|
||||
|
||||
for (const handler of this.handlers) {
|
||||
const result = await handler(context, data);
|
||||
try {
|
||||
for (const handler of this.handlers) {
|
||||
const result = await handler(context, data);
|
||||
|
||||
if (result === false) {
|
||||
return context;
|
||||
if (result === false) {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
for (const handler of this.postHandlers) {
|
||||
await handler(context, data);
|
||||
}
|
||||
}
|
||||
|
||||
for (const handler of this.postHandlers) {
|
||||
await handler(context, data);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -33,5 +33,9 @@ export class ActiveViewService {
|
||||
this.activeView = provider;
|
||||
}
|
||||
|
||||
blur() { }
|
||||
blur<T>(provider: IActiveItemProvider<T>) {
|
||||
// if (this.activeView === provider) {
|
||||
// this.activeView = null;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ export function useActiveView<T>(provider: IActiveItemProvider<T>): [() => void,
|
||||
}, [provider]);
|
||||
|
||||
const handleBlur = useCallback(() => {
|
||||
activeViewService.blur();
|
||||
}, []);
|
||||
activeViewService.blur(provider);
|
||||
}, [provider]);
|
||||
|
||||
return [handleFocus, handleBlur];
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ export default [
|
||||
['authentication_user_role_not_set', 'At least one role must be selected'],
|
||||
['authentication_user_password_not_set', 'Password is required'],
|
||||
['authentication_user_passwords_not_match', "Passwords don't match"],
|
||||
['authentication_user_login_already_exists', 'A user with this name already exists'],
|
||||
['authentication_user_login_already_exists', 'The user with this name already exists'],
|
||||
['authentication_user_login_cant_be_used', 'Sorry, that name cannot be used'],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user