diff --git a/webapp/packages/core-authentication/src/UsersResource.ts b/webapp/packages/core-authentication/src/UsersResource.ts index f38999bc2a..d881b36e92 100644 --- a/webapp/packages/core-authentication/src/UsersResource.ts +++ b/webapp/packages/core-authentication/src/UsersResource.ts @@ -59,10 +59,6 @@ export class UsersResource extends CachedMapResource { } async loadConnections(userId: string): Promise { - if (this.isNew(userId)) { - return []; - } - const { grantedConnections } = await this.graphQLService.sdk.getUserGrantedConnections({ userId }); return grantedConnections; @@ -127,18 +123,14 @@ export class UsersResource extends CachedMapResource { 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); diff --git a/webapp/packages/core-blocks/src/useFocus.ts b/webapp/packages/core-blocks/src/useFocus.ts index 758f6e1216..581f0e6fef 100644 --- a/webapp/packages/core-blocks/src/useFocus.ts +++ b/webapp/packages/core-blocks/src/useFocus.ts @@ -35,7 +35,7 @@ export function useFocus({ firstFocusable.focus(); } } - }, [focusFirstChild]); + }, [focusFirstChild, reference.current]); useEffect(() => { if (!reference.current) { @@ -67,7 +67,7 @@ export function useFocus({ element.removeEventListener('focusin', focusHandler); element.removeEventListener('focusout', blurHandler); }; - }, []); + }, [reference.current]); return [reference, focus]; } diff --git a/webapp/packages/core-connections/src/Administration/Connections/CreateConnection/DatabaseList.tsx b/webapp/packages/core-connections/src/Administration/Connections/CreateConnection/DatabaseList.tsx index 007aa964e9..ecdc5647e8 100644 --- a/webapp/packages/core-connections/src/Administration/Connections/CreateConnection/DatabaseList.tsx +++ b/webapp/packages/core-connections/src/Administration/Connections/CreateConnection/DatabaseList.tsx @@ -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)( diff --git a/webapp/packages/core-connections/src/locales/en.ts b/webapp/packages/core-connections/src/locales/en.ts index bdb6772b19..648127ab63 100644 --- a/webapp/packages/core-connections/src/locales/en.ts +++ b/webapp/packages/core-connections/src/locales/en.ts @@ -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'], ]; diff --git a/webapp/packages/core-connections/src/locales/ru.ts b/webapp/packages/core-connections/src/locales/ru.ts index 56ad55df6f..e663c6317a 100644 --- a/webapp/packages/core-connections/src/locales/ru.ts +++ b/webapp/packages/core-connections/src/locales/ru.ts @@ -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', 'Подключения к базам данных не найдены'], ]; diff --git a/webapp/packages/core-dialogs/src/CommonDialog/DialogsPortal.tsx b/webapp/packages/core-dialogs/src/CommonDialog/DialogsPortal.tsx index 0e59836c09..94044a2fc5 100644 --- a/webapp/packages/core-dialogs/src/CommonDialog/DialogsPortal.tsx +++ b/webapp/packages/core-dialogs/src/CommonDialog/DialogsPortal.tsx @@ -91,7 +91,7 @@ function NestedDialog({ // TODO: place Dialog inside CommonDialogWrapper, so we can pass aria-label return styled(styles)( <> - + implements IExecutor { 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; } diff --git a/webapp/packages/core-view/src/ActiveViewService.ts b/webapp/packages/core-view/src/ActiveViewService.ts index e1eaf05e40..4ada0d3893 100644 --- a/webapp/packages/core-view/src/ActiveViewService.ts +++ b/webapp/packages/core-view/src/ActiveViewService.ts @@ -33,5 +33,9 @@ export class ActiveViewService { this.activeView = provider; } - blur() { } + blur(provider: IActiveItemProvider) { + // if (this.activeView === provider) { + // this.activeView = null; + // } + } } diff --git a/webapp/packages/core-view/src/useActiveView.ts b/webapp/packages/core-view/src/useActiveView.ts index f2f8a610f9..fa5bcfed5a 100644 --- a/webapp/packages/core-view/src/useActiveView.ts +++ b/webapp/packages/core-view/src/useActiveView.ts @@ -20,8 +20,8 @@ export function useActiveView(provider: IActiveItemProvider): [() => void, }, [provider]); const handleBlur = useCallback(() => { - activeViewService.blur(); - }, []); + activeViewService.blur(provider); + }, [provider]); return [handleFocus, handleBlur]; } diff --git a/webapp/packages/plugin-authentication/src/locales/en.ts b/webapp/packages/plugin-authentication/src/locales/en.ts index 54598fa879..f69095eac0 100644 --- a/webapp/packages/plugin-authentication/src/locales/en.ts +++ b/webapp/packages/plugin-authentication/src/locales/en.ts @@ -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'], ];