From 75fa24315496bb0030ab8d085bab50fde475646f Mon Sep 17 00:00:00 2001 From: uchitsa Date: Wed, 7 Aug 2024 20:19:38 +0300 Subject: [PATCH 01/43] update signup account model for empty names --- .../typoreporter/web/model/SignupAccountModel.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java index b475a10b..32f0a224 100644 --- a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java +++ b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java @@ -4,13 +4,8 @@ import io.hexlet.typoreporter.domain.account.constraint.AccountUsername; import io.hexlet.typoreporter.service.dto.FieldMatchConsiderCase; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; +import lombok.*; @Getter @Setter @@ -38,11 +33,9 @@ public class SignupAccountModel { @ToString.Exclude private String confirmPassword; - @NotBlank @Size(min = 1, max = 50) private String firstName; - @NotBlank @Size(min = 1, max = 50) private String lastName; } From 1b7fdf5e5b2f1b0ba42d82d8ab5df43a6b3fa75b Mon Sep 17 00:00:00 2001 From: FC-LinuxMachine Date: Thu, 15 Aug 2024 01:17:56 +0700 Subject: [PATCH 02/43] #254 fixes bug & add test for it --- .../controller/WorkspaceSettingsController.java | 9 ++++++++- .../web/WorkspaceSettingsControllerIT.java | 12 ++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java index 1802aadb..038d20b4 100644 --- a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java +++ b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java @@ -10,6 +10,7 @@ import io.hexlet.typoreporter.service.WorkspaceSettingsService; import io.hexlet.typoreporter.service.dto.typo.TypoInfo; import io.hexlet.typoreporter.service.dto.workspace.AllowedUrlDTO; +import io.hexlet.typoreporter.service.dto.workspace.WorkspaceInfo; import jakarta.servlet.http.HttpServletRequest; import jakarta.transaction.Transactional; import jakarta.validation.Valid; @@ -167,7 +168,9 @@ public String deleteAllowedUrl(Model model, @GetMapping("/integration") @PreAuthorize(IS_USER_RELATED_TO_WKS) public String getWorkspaceIntegrationPage(Model model, @PathVariable Long wksId, HttpServletRequest req) { - if (!workspaceService.existsWorkspaceById(wksId)) { + var wksOptional = workspaceService.getWorkspaceInfoById(wksId); + + if (wksOptional.isEmpty()) { //TODO send to error page log.error("Workspace with id {} not found", wksId); return "redirect:/workspaces"; @@ -175,6 +178,10 @@ public String getWorkspaceIntegrationPage(Model model, @PathVariable Long wksId, addTokenAndUrlToModel(model, wksId, req); + WorkspaceInfo wksInfo = wksOptional.get(); + model.addAttribute("wksInfo", wksInfo); + model.addAttribute("wksName", wksInfo.name()); + getStatisticDataToModel(model, wksId); getLastTypoDataToModel(model, wksId); diff --git a/src/test/java/io/hexlet/typoreporter/web/WorkspaceSettingsControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/WorkspaceSettingsControllerIT.java index 61de04be..5a84838c 100644 --- a/src/test/java/io/hexlet/typoreporter/web/WorkspaceSettingsControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/WorkspaceSettingsControllerIT.java @@ -83,18 +83,25 @@ static void datasourceProperties(DynamicPropertyRegistry registry) { @ParameterizedTest @MethodSource("io.hexlet.typoreporter.test.factory.EntitiesFactory#getWorkspacesAndUsersRelated") void getWorkspaceIntegrationPageIsSuccessful(final Long wksId, final String email) throws Exception { - final var apiAccessToken = workspaceSettingsRepository.getWorkspaceSettingsByWorkspaceId(wksId) + final var workspaces = workspaceSettingsRepository.getWorkspaceSettingsByWorkspaceId(wksId); + final var apiAccessToken = workspaces .map(s -> s.getId() + ":" + s.getApiAccessToken()) .map(String::getBytes) .map(Base64.getEncoder()::encodeToString) .orElse(null); + final var wksName = workspaces + .map(m -> m.getWorkspace().getName()) + .orElse(null); + MockHttpServletResponse response = mockMvc.perform(get("/workspace/{wksId}/integration", wksId.toString()) .with(user(email))) - .andExpect(model().attributeExists("wksBasicToken")) + .andExpect(model().attributeExists("wksBasicToken", "wksName")) .andReturn().getResponse(); assertThat(response.getContentAsString()).contains(apiAccessToken); + assertThat(response.getContentAsString()).contains(wksName); + } @ParameterizedTest @@ -213,4 +220,5 @@ void delAllowedUrlFromWorkspace() throws Exception { WORKSPACE_101_ID); assertThat(deletedAllowedUrlOptional).isEmpty(); } + } From 259a1b8960fe7724e6bb94f596b6d010ade9c122 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Thu, 15 Aug 2024 19:25:30 +0300 Subject: [PATCH 03/43] add test for signup account with empty names --- .../typoreporter/web/SignupControllerIT.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index d0b5ce1b..7fdd80ea 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -53,6 +53,7 @@ static void datasourceProperties(DynamicPropertyRegistry registry) { private static final String EMAIL_UPPER_CASE = "EMAIL_ADDRESS@GOOGLE.COM"; private static final String EMAIL_LOWER_CASE = EMAIL_UPPER_CASE.toLowerCase(); + private static final String EMPTY_NAME = ""; private final SignupAccountModel model = new SignupAccountModel( "model_upper_case", @@ -93,6 +94,22 @@ void createAccountWithIgnoreEmailCase() throws Exception { assertThat(accountRepository.count()).isEqualTo(1L); } + @Test + void createAccountWithEmptyNames() throws Exception { + model.setFirstName(EMPTY_NAME); + model.setLastName(EMPTY_NAME); + mockMvc.perform(post("/signup") + .param("username", model.getUsername()) + .param("email", model.getEmail()) + .param("password", model.getPassword()) + .param("confirmPassword", model.getConfirmPassword()) + .param("firstName", model.getFirstName()) + .param("lastName", model.getLastName()) + .with(csrf())) + .andReturn(); + assertThat(accountRepository.count()).isEqualTo(1L); + } + @Test void createAccountWithWrongEmailDomain() throws Exception { String userName = "testUser"; @@ -140,4 +157,5 @@ void signupInAccountWithBadEmail() throws Exception { var body = response.getResponse().getContentAsString(); assertThat(body).contains(String.format("The email "%s" is not valid", ACCOUNT_INCORRECT_EMAIL)); } + } From 0c12ef6c0fd51f4fb5dc581375fcf69b4bfd1885 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Thu, 15 Aug 2024 19:27:52 +0300 Subject: [PATCH 04/43] empty row --- src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index 7fdd80ea..15969006 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -157,5 +157,4 @@ void signupInAccountWithBadEmail() throws Exception { var body = response.getResponse().getContentAsString(); assertThat(body).contains(String.format("The email "%s" is not valid", ACCOUNT_INCORRECT_EMAIL)); } - } From 68b2c3c2732161688322ed660da18b143ab0d102 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Fri, 16 Aug 2024 14:21:14 +0300 Subject: [PATCH 05/43] fix createAccountWithEmptyNames test --- .../java/io/hexlet/typoreporter/web/SignupControllerIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index 15969006..ca70acc0 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -107,7 +107,7 @@ void createAccountWithEmptyNames() throws Exception { .param("lastName", model.getLastName()) .with(csrf())) .andReturn(); - assertThat(accountRepository.count()).isEqualTo(1L); + assertThat(accountRepository.findAccountByEmail(model.getEmail())).isNotEmpty(); } @Test From 5ed862f2fe2d2fd7cdd46e1d53a6f91a12ddcb3c Mon Sep 17 00:00:00 2001 From: uchitsa Date: Fri, 16 Aug 2024 14:22:17 +0300 Subject: [PATCH 06/43] fix lombok imports --- .../hexlet/typoreporter/web/model/SignupAccountModel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java index 32f0a224..daa29773 100644 --- a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java +++ b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java @@ -5,7 +5,11 @@ import io.hexlet.typoreporter.service.dto.FieldMatchConsiderCase; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.Size; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; @Getter @Setter From 4382def94daf4664416457fb8376e89aa0068933 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Fri, 16 Aug 2024 14:23:23 +0300 Subject: [PATCH 07/43] fix min size to 0 for names --- .../io/hexlet/typoreporter/web/model/SignupAccountModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java index daa29773..f91f1736 100644 --- a/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java +++ b/src/main/java/io/hexlet/typoreporter/web/model/SignupAccountModel.java @@ -37,9 +37,9 @@ public class SignupAccountModel { @ToString.Exclude private String confirmPassword; - @Size(min = 1, max = 50) + @Size(max = 50) private String firstName; - @Size(min = 1, max = 50) + @Size(max = 50) private String lastName; } From 194b85ee6ccfc74504c1ec1698f63f687ceefd81 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Sat, 17 Aug 2024 02:29:11 +0300 Subject: [PATCH 08/43] fix min size to 0 for names --- .../java/io/hexlet/typoreporter/domain/account/Account.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/domain/account/Account.java b/src/main/java/io/hexlet/typoreporter/domain/account/Account.java index 66b9ecc9..007757a0 100644 --- a/src/main/java/io/hexlet/typoreporter/domain/account/Account.java +++ b/src/main/java/io/hexlet/typoreporter/domain/account/Account.java @@ -73,12 +73,10 @@ public class Account extends AbstractAuditingEntity implements Identifiable Date: Sat, 17 Aug 2024 02:43:32 +0300 Subject: [PATCH 09/43] update createAccountWithEmptyNames test --- .../typoreporter/web/SignupControllerIT.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index ca70acc0..f41cec35 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -95,19 +95,20 @@ void createAccountWithIgnoreEmailCase() throws Exception { } @Test - void createAccountWithEmptyNames() throws Exception { - model.setFirstName(EMPTY_NAME); - model.setLastName(EMPTY_NAME); + void createAccountWithEmptyNames() throws Exception { + String email = "testEmptyNames@test.ru"; + String firstName = EMPTY_NAME; + String lastName = EMPTY_NAME; mockMvc.perform(post("/signup") .param("username", model.getUsername()) - .param("email", model.getEmail()) + .param("email", email) .param("password", model.getPassword()) .param("confirmPassword", model.getConfirmPassword()) - .param("firstName", model.getFirstName()) - .param("lastName", model.getLastName()) + .param("firstName", firstName) + .param("lastName", lastName) .with(csrf())) .andReturn(); - assertThat(accountRepository.findAccountByEmail(model.getEmail())).isNotEmpty(); + assertThat(accountRepository.findAccountByEmail(email)).isNotEmpty(); } @Test From 166ff718a327a5cdb1819b965631aa011996125e Mon Sep 17 00:00:00 2001 From: uchitsa Date: Sat, 17 Aug 2024 03:02:01 +0300 Subject: [PATCH 10/43] update createAccountWithEmptyNames test --- .../java/io/hexlet/typoreporter/web/SignupControllerIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index f41cec35..0880071b 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -95,12 +95,13 @@ void createAccountWithIgnoreEmailCase() throws Exception { } @Test - void createAccountWithEmptyNames() throws Exception { + void createAccountWithEmptyNames() throws Exception { + String userName = "testEmptyNamesUser"; String email = "testEmptyNames@test.ru"; String firstName = EMPTY_NAME; String lastName = EMPTY_NAME; mockMvc.perform(post("/signup") - .param("username", model.getUsername()) + .param("username", userName) .param("email", email) .param("password", model.getPassword()) .param("confirmPassword", model.getConfirmPassword()) From 8816f2ec5ea91b2b823d015a4a847d3759de3572 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Mon, 19 Aug 2024 01:25:07 +0300 Subject: [PATCH 11/43] Update SignupControllerIT.java --- .../typoreporter/web/SignupControllerIT.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index 0880071b..633576b6 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -96,20 +96,18 @@ void createAccountWithIgnoreEmailCase() throws Exception { @Test void createAccountWithEmptyNames() throws Exception { - String userName = "testEmptyNamesUser"; - String email = "testEmptyNames@test.ru"; - String firstName = EMPTY_NAME; - String lastName = EMPTY_NAME; + String emptyNamesUser = "testEmptyNamesUser"; + String emptyNamesEmail = "testEmptyNames@test.ru"; mockMvc.perform(post("/signup") - .param("username", userName) - .param("email", email) + .param("username", emptyNamesUser) + .param("email", emptyNamesEmail) .param("password", model.getPassword()) .param("confirmPassword", model.getConfirmPassword()) - .param("firstName", firstName) - .param("lastName", lastName) + .param("firstName", EMPTY_NAME) + .param("lastName", EMPTY_NAME) .with(csrf())) .andReturn(); - assertThat(accountRepository.findAccountByEmail(email)).isNotEmpty(); + assertThat(accountRepository.findAccountByEmail(emptyNamesEmail)).isNotEmpty(); } @Test From 185c9824e9f48112ff8ad7c6fb968bd2e4089811 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Mon, 19 Aug 2024 01:36:42 +0300 Subject: [PATCH 12/43] Update UpdateProfile.java --- .../typoreporter/service/dto/account/UpdateProfile.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java b/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java index 9f16a1fc..2715e2db 100644 --- a/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java +++ b/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java @@ -20,11 +20,9 @@ public class UpdateProfile { message = "The email \"${validatedValue}\" is not valid") private String email; - @NotBlank - @Size(min = 1, max = 50) + @Size(max = 50) private String firstName; - @NotBlank - @Size(min = 1, max = 50) + @Size(max = 50) private String lastName; } From 4099d624af378a89e3402ca7f7c7de98008826d2 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Mon, 19 Aug 2024 01:45:04 +0300 Subject: [PATCH 13/43] Update SignupControllerIT.java --- .../java/io/hexlet/typoreporter/web/SignupControllerIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index 633576b6..b55aed42 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -98,11 +98,12 @@ void createAccountWithIgnoreEmailCase() throws Exception { void createAccountWithEmptyNames() throws Exception { String emptyNamesUser = "testEmptyNamesUser"; String emptyNamesEmail = "testEmptyNames@test.ru"; + String emptyNamesPassword = "P@$$w0rd"; mockMvc.perform(post("/signup") .param("username", emptyNamesUser) .param("email", emptyNamesEmail) - .param("password", model.getPassword()) - .param("confirmPassword", model.getConfirmPassword()) + .param("password", emptyNamesPassword) + .param("confirmPassword", emptyNamesPassword) .param("firstName", EMPTY_NAME) .param("lastName", EMPTY_NAME) .with(csrf())) From 133ac700528fb48a302d15f5a3c63bc065f01325 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Mon, 19 Aug 2024 01:52:20 +0300 Subject: [PATCH 14/43] Update SignupControllerIT.java --- .../java/io/hexlet/typoreporter/web/SignupControllerIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index b55aed42..eaf0e396 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -97,7 +97,7 @@ void createAccountWithIgnoreEmailCase() throws Exception { @Test void createAccountWithEmptyNames() throws Exception { String emptyNamesUser = "testEmptyNamesUser"; - String emptyNamesEmail = "testEmptyNames@test.ru"; + String emptyNamesEmail = "testemptynames@test.ru"; String emptyNamesPassword = "P@$$w0rd"; mockMvc.perform(post("/signup") .param("username", emptyNamesUser) From 0185d3a77a8ccb67a3f2eba4720558ffd47b25ed Mon Sep 17 00:00:00 2001 From: uchitsa Date: Mon, 19 Aug 2024 01:59:59 +0300 Subject: [PATCH 15/43] Update UpdateProfile.java --- .../hexlet/typoreporter/service/dto/account/UpdateProfile.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java b/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java index 2715e2db..262fdb4b 100644 --- a/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java +++ b/src/main/java/io/hexlet/typoreporter/service/dto/account/UpdateProfile.java @@ -2,7 +2,6 @@ import io.hexlet.typoreporter.domain.account.constraint.AccountUsername; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Getter; import lombok.Setter; From bb057c9674c4a76051d415a708431c735e2ab42c Mon Sep 17 00:00:00 2001 From: FC-LinuxMachine Date: Sun, 25 Aug 2024 19:20:02 +0700 Subject: [PATCH 16/43] #254 updated getWorkSpaceIntegrationPage for use Optional --- .../controller/WorkspaceSettingsController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java index 038d20b4..6c4ec971 100644 --- a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java +++ b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java @@ -168,9 +168,9 @@ public String deleteAllowedUrl(Model model, @GetMapping("/integration") @PreAuthorize(IS_USER_RELATED_TO_WKS) public String getWorkspaceIntegrationPage(Model model, @PathVariable Long wksId, HttpServletRequest req) { - var wksOptional = workspaceService.getWorkspaceInfoById(wksId); + var wksOptional = workspaceService.getWorkspaceInfoById(wksId).orElse(null); - if (wksOptional.isEmpty()) { + if (wksOptional == null) { //TODO send to error page log.error("Workspace with id {} not found", wksId); return "redirect:/workspaces"; @@ -178,9 +178,8 @@ public String getWorkspaceIntegrationPage(Model model, @PathVariable Long wksId, addTokenAndUrlToModel(model, wksId, req); - WorkspaceInfo wksInfo = wksOptional.get(); - model.addAttribute("wksInfo", wksInfo); - model.addAttribute("wksName", wksInfo.name()); + model.addAttribute("wksInfo", wksOptional); + model.addAttribute("wksName", wksOptional.name()); getStatisticDataToModel(model, wksId); getLastTypoDataToModel(model, wksId); From 36300e2402b8edef66dc969548afd3950e3038f5 Mon Sep 17 00:00:00 2001 From: FC-LinuxMachine Date: Sun, 25 Aug 2024 20:21:18 +0700 Subject: [PATCH 17/43] #254 fix checkstyle --- .../typoreporter/controller/WorkspaceSettingsController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java index 6c4ec971..b7b95b0a 100644 --- a/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java +++ b/src/main/java/io/hexlet/typoreporter/controller/WorkspaceSettingsController.java @@ -10,7 +10,6 @@ import io.hexlet.typoreporter.service.WorkspaceSettingsService; import io.hexlet.typoreporter.service.dto.typo.TypoInfo; import io.hexlet.typoreporter.service.dto.workspace.AllowedUrlDTO; -import io.hexlet.typoreporter.service.dto.workspace.WorkspaceInfo; import jakarta.servlet.http.HttpServletRequest; import jakarta.transaction.Transactional; import jakarta.validation.Valid; From 3c0dc7d5d228467bec8a0578206da52c2b615f48 Mon Sep 17 00:00:00 2001 From: Grad566 <3008denis@gmail.com> Date: Mon, 26 Aug 2024 13:27:27 +0300 Subject: [PATCH 18/43] [#247] Rm element with the question from error report --- src/widget/index.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/widget/index.js b/src/widget/index.js index 83c6db5d..36b977ca 100644 --- a/src/widget/index.js +++ b/src/widget/index.js @@ -158,10 +158,6 @@ const generateModal = (state) => { const divSecondLabel = document.createElement('div'); divSecondLabel.classList.add('hexlet-correction-modal_ReportTypo-label'); - const strong = document.createElement('strong'); - strong.id = 'hexlet-correction-modal_question'; - strong.textContent = 'Отправить сообщение об ошибке редактору сайта?'; - divSecondLabel.append(strong); const divButtons = document.createElement('div'); divButtons.style.textAlign = 'right'; From a7e8a1fad0083da008bb802864dfc426254463f9 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Wed, 28 Aug 2024 00:53:47 +0300 Subject: [PATCH 19/43] #286 update SignupControllerIT.java --- .../typoreporter/web/SignupControllerIT.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java index 03462f04..39f61c38 100644 --- a/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java +++ b/src/test/java/io/hexlet/typoreporter/web/SignupControllerIT.java @@ -55,7 +55,6 @@ static void datasourceProperties(DynamicPropertyRegistry registry) { private static final String EMAIL_UPPER_CASE = "EMAIL_ADDRESS@GOOGLE.COM"; private static final String EMAIL_LOWER_CASE = EMAIL_UPPER_CASE.toLowerCase(); - private static final String EMPTY_NAME = ""; private final SignupAccountModel model = new SignupAccountModel( "model_upper_case", @@ -106,19 +105,20 @@ void createAccountWithIgnoreEmailCase() throws Exception { @Test void createAccountWithEmptyNames() throws Exception { - String emptyNamesUser = "testEmptyNamesUser"; - String emptyNamesEmail = "testemptynames@test.ru"; - String emptyNamesPassword = "P@$$w0rd"; + String username = "testEmptyNamesUser"; + String email = "testemptynames@test.ru"; + String password = "P@$$w0rd"; + String emptyName = ""; mockMvc.perform(post("/signup") - .param("username", emptyNamesUser) - .param("email", emptyNamesEmail) - .param("password", emptyNamesPassword) - .param("confirmPassword", emptyNamesPassword) - .param("firstName", EMPTY_NAME) - .param("lastName", EMPTY_NAME) + .param("username", username) + .param("email", email) + .param("password", password) + .param("confirmPassword", password) + .param("firstName", emptyName) + .param("lastName", emptyName) .with(csrf())) .andReturn(); - assertThat(accountRepository.findAccountByEmail(emptyNamesEmail)).isNotEmpty(); + assertThat(accountRepository.findAccountByEmail(email)).isNotEmpty(); } @Test From 49fdff22c1e3b7a632921751f6540bca3c16a9b6 Mon Sep 17 00:00:00 2001 From: uchitsa Date: Thu, 29 Aug 2024 02:01:41 +0300 Subject: [PATCH 20/43] #301 remove first name input --- src/main/resources/templates/account/signup.html | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/resources/templates/account/signup.html b/src/main/resources/templates/account/signup.html index 328c8fd2..d49b3440 100644 --- a/src/main/resources/templates/account/signup.html +++ b/src/main/resources/templates/account/signup.html @@ -29,17 +29,6 @@ -
- - -
-

-
-
-
Date: Thu, 29 Aug 2024 02:03:14 +0300 Subject: [PATCH 21/43] #301 remove last name input --- src/main/resources/templates/account/signup.html | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/resources/templates/account/signup.html b/src/main/resources/templates/account/signup.html index d49b3440..4af1f6e7 100644 --- a/src/main/resources/templates/account/signup.html +++ b/src/main/resources/templates/account/signup.html @@ -29,17 +29,6 @@
-
- - -
-

-
-
-
From ff6fd21c85fa45843af52cf5a404b4a6669a6982 Mon Sep 17 00:00:00 2001 From: shamshaev Date: Sun, 22 Sep 2024 18:28:15 +0300 Subject: [PATCH 22/43] Improve UX without workspace --- src/main/resources/messages_en.properties | 6 ++++++ src/main/resources/messages_ru.properties | 6 ++++++ src/main/resources/templates/workspaces.html | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/main/resources/messages_en.properties b/src/main/resources/messages_en.properties index d55eae14..1f808f83 100644 --- a/src/main/resources/messages_en.properties +++ b/src/main/resources/messages_en.properties @@ -51,6 +51,12 @@ navbar.signup=Sign Up navbar.create-workspace=Create Workspace navbar.account-info=Account Info +text.hero-header=Everything you need in +text.hero-highlight=one place +text.hero-description=Create your workspace to manage everything regarding typos: add sites (URLs) from which reports can be sent to the workspace, see and manage received typo statistics, add users to the workspace and more +btn.get-started=Get started +btn.learn-more=Learn more + acc-info.card-title.general=General acc-info.card-title.workspaces=Workspaces diff --git a/src/main/resources/messages_ru.properties b/src/main/resources/messages_ru.properties index 8d05ca07..07be78b1 100644 --- a/src/main/resources/messages_ru.properties +++ b/src/main/resources/messages_ru.properties @@ -57,6 +57,12 @@ navbar.signup=Регистрация navbar.account-info=Информация об аккаунте navbar.create-workspace=Создать Пространство +text.hero-header=Все что вам нужно в +text.hero-highlight=одном месте +text.hero-description=Создайте свое рабочее пространство, чтобы управлять всем связанным с опечатками: добавлять сайты (URLs) с которых отчеты могут отправляться в пространство, видеть и управлять статистикой полученных опечаток, добавлять пользователей в рабочее пространство и многое другое +btn.get-started=Начать +btn.learn-more=Узнать больше + acc-info.wks.url=URL пространства acc-info.wks.name=Имя пространства acc-info.wks.role=Роль diff --git a/src/main/resources/templates/workspaces.html b/src/main/resources/templates/workspaces.html index d3ef9aad..4db3c3b0 100644 --- a/src/main/resources/templates/workspaces.html +++ b/src/main/resources/templates/workspaces.html @@ -4,6 +4,23 @@
+
+
+
+

+ [[#{text.hero-header}]] + +

+
+
+

+
+
+ + +
+
+
From 7304bc34a5816431693933cf0c08238a3780823e Mon Sep 17 00:00:00 2001 From: shamshaev Date: Mon, 23 Sep 2024 21:50:59 +0300 Subject: [PATCH 23/43] Remove button Learn more --- src/main/resources/messages_en.properties | 1 - src/main/resources/messages_ru.properties | 1 - src/main/resources/templates/workspaces.html | 1 - 3 files changed, 3 deletions(-) diff --git a/src/main/resources/messages_en.properties b/src/main/resources/messages_en.properties index 1f808f83..74e75d3f 100644 --- a/src/main/resources/messages_en.properties +++ b/src/main/resources/messages_en.properties @@ -55,7 +55,6 @@ text.hero-header=Everything you need in text.hero-highlight=one place text.hero-description=Create your workspace to manage everything regarding typos: add sites (URLs) from which reports can be sent to the workspace, see and manage received typo statistics, add users to the workspace and more btn.get-started=Get started -btn.learn-more=Learn more acc-info.card-title.general=General acc-info.card-title.workspaces=Workspaces diff --git a/src/main/resources/messages_ru.properties b/src/main/resources/messages_ru.properties index 07be78b1..53ddacf2 100644 --- a/src/main/resources/messages_ru.properties +++ b/src/main/resources/messages_ru.properties @@ -61,7 +61,6 @@ text.hero-header=Все что вам нужно в text.hero-highlight=одном месте text.hero-description=Создайте свое рабочее пространство, чтобы управлять всем связанным с опечатками: добавлять сайты (URLs) с которых отчеты могут отправляться в пространство, видеть и управлять статистикой полученных опечаток, добавлять пользователей в рабочее пространство и многое другое btn.get-started=Начать -btn.learn-more=Узнать больше acc-info.wks.url=URL пространства acc-info.wks.name=Имя пространства diff --git a/src/main/resources/templates/workspaces.html b/src/main/resources/templates/workspaces.html index 4db3c3b0..f8acd44b 100644 --- a/src/main/resources/templates/workspaces.html +++ b/src/main/resources/templates/workspaces.html @@ -17,7 +17,6 @@

-
From 389dd17dd0e9a1c57f9336157f87b7c92b2f9609 Mon Sep 17 00:00:00 2001 From: shamshaev Date: Tue, 24 Sep 2024 19:01:11 +0300 Subject: [PATCH 24/43] Fix issue #191 long url breaks layout --- src/main/resources/templates/workspace/wks-typos.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/workspace/wks-typos.html b/src/main/resources/templates/workspace/wks-typos.html index 3761826c..f73f20fd 100644 --- a/src/main/resources/templates/workspace/wks-typos.html +++ b/src/main/resources/templates/workspace/wks-typos.html @@ -148,7 +148,7 @@ th:aria-controls="|collapseTypoRowId_*{id}|" th:classappend="|table-*{typoStatus.getStyle}|" th:data-bs-target="|#collapseTypoRowId_*{id}|"> - + From a96d27f2374d202be69df40cb3df6e17c2d7ee15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veronika=20Patakyov=C3=A1?= Date: Fri, 27 Sep 2024 16:32:28 +0200 Subject: [PATCH 25/43] Removed link from user email in navbar and added new classes to keep the styling --- src/main/resources/templates/fragments/panels.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/panels.html b/src/main/resources/templates/fragments/panels.html index 2c79c194..5866262f 100644 --- a/src/main/resources/templates/fragments/panels.html +++ b/src/main/resources/templates/fragments/panels.html @@ -31,7 +31,7 @@
+
diff --git a/src/main/resources/templates/account/pass-update.html b/src/main/resources/templates/account/pass-update.html index 00009fd4..bc08e7bf 100644 --- a/src/main/resources/templates/account/pass-update.html +++ b/src/main/resources/templates/account/pass-update.html @@ -1,41 +1,42 @@ - - -
-
-
- -
- - -
-
-
- - -
-
-
- - -
-
-
-
-
- - - + + +
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+
+
+ + +
+
-
-
+ +
diff --git a/src/main/resources/templates/account/prof-update.html b/src/main/resources/templates/account/prof-update.html index d9d3332e..28f631e2 100644 --- a/src/main/resources/templates/account/prof-update.html +++ b/src/main/resources/templates/account/prof-update.html @@ -1,45 +1,46 @@ - - -
-
-
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
- - -
+ + +
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + +
+
-
-
+ +
diff --git a/src/main/resources/templates/account/signup.html b/src/main/resources/templates/account/signup.html index 4af1f6e7..124feed4 100644 --- a/src/main/resources/templates/account/signup.html +++ b/src/main/resources/templates/account/signup.html @@ -1,56 +1,56 @@ - - -
-
-
-
-
- - -
-

+ + +
+
+
+ +
+ + +
+

+
-
-
- - -
-

+
+ + +
+

+
-
-
- - -
-

+
+ + +
+

+
-
-
- - -
-

+
+ + +
+

+
-
- - + + +
-
-
- +
+
diff --git a/src/main/resources/templates/create-workspace.html b/src/main/resources/templates/create-workspace.html index 88c0a31f..8da3ff0b 100644 --- a/src/main/resources/templates/create-workspace.html +++ b/src/main/resources/templates/create-workspace.html @@ -1,39 +1,40 @@ - - -
-
-
-
-
- - -
-
-
- - -
-
-
- - -
-
- -
+ + +
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ +
+
-
-
+ +
diff --git a/src/main/resources/templates/error-general.html b/src/main/resources/templates/error-general.html index e8b7e77e..b98ba45a 100644 --- a/src/main/resources/templates/error-general.html +++ b/src/main/resources/templates/error-general.html @@ -6,4 +6,5 @@
+
diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index 20ea9a34..52a0a127 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -1,91 +1,67 @@ -