From 3eea45646d6ae291d3505f2f6f51e612eeb47534 Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Mon, 12 Oct 2020 16:27:44 +0300 Subject: [PATCH 1/5] fix(core-dialog): dialog backdrop onClick => onMouseDown - --- webapp/packages/core-dialogs/src/CommonDialog/DialogsPortal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)( <> - + Date: Mon, 12 Oct 2020 17:02:51 +0300 Subject: [PATCH 2/5] fix(core-blocks): useFocus handling ref change --- webapp/packages/core-blocks/src/useFocus.ts | 4 ++-- webapp/packages/core-view/src/ActiveViewService.ts | 6 +++++- webapp/packages/core-view/src/useActiveView.ts | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) 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-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]; } From 475bae879456a155eab53350416a82e0d2fe7d60 Mon Sep 17 00:00:00 2001 From: Wroud Date: Mon, 12 Oct 2020 17:11:03 +0300 Subject: [PATCH 3/5] fix(core-executor): CB-402 ensure post handlers execution --- webapp/packages/core-executor/src/Executor.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/webapp/packages/core-executor/src/Executor.ts b/webapp/packages/core-executor/src/Executor.ts index 48d7f1adff..b3c797dac2 100644 --- a/webapp/packages/core-executor/src/Executor.ts +++ b/webapp/packages/core-executor/src/Executor.ts @@ -25,16 +25,18 @@ export class Executor 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; } From 1867ae03ebe64bdc8f8da9c91370493c23d0b1f3 Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Mon, 12 Oct 2020 19:58:59 +0300 Subject: [PATCH 4/5] fix(core-connections): small localization fixes --- .../Connections/CreateConnection/DatabaseList.tsx | 2 +- webapp/packages/core-connections/src/locales/en.ts | 1 + webapp/packages/core-connections/src/locales/ru.ts | 3 ++- webapp/packages/plugin-authentication/src/locales/en.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) 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/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'], ]; From bc26167bcfb8ec5c7d7332f32c1a79f7be5e4d37 Mon Sep 17 00:00:00 2001 From: Wroud Date: Mon, 12 Oct 2020 20:05:29 +0300 Subject: [PATCH 5/5] fix(core-authentication): CB-412 user deletion --- .../core-authentication/src/UsersResource.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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);