From b43ab865690a30d119483dc2da169953e23ea846 Mon Sep 17 00:00:00 2001 From: Nonononoki Date: Tue, 17 Nov 2020 20:08:26 +0100 Subject: [PATCH] Updated Spring version to 2.3.5 (2.4.0 still has some issues!) Messages now allow HTML tags Starting video chat will automatically send a message with the link to the partner Smaller and more elegant bubbles in notification.html and message.html Further improved UI --- pom.xml | 9 ++++++++- .../resources/application-test.properties | 14 +++++++------ src/main/resources/application.properties | 3 ++- src/main/resources/static/css/alovoa-dark.css | 5 +++++ .../resources/static/css/messageDetail.css | 10 +++------- .../resources/static/css/notification.css | 4 ++-- src/main/resources/static/js/messageDetail.js | 3 ++- .../resources/templates/delete-account.html | 3 ++- src/main/resources/templates/fragments.html | 4 ++-- src/main/resources/templates/messages.html | 14 ++++++------- .../resources/templates/notification.html | 2 +- src/main/resources/templates/profile.html | 20 +++++++++---------- .../java/com/nonononoki/alovoa/UserTests.java | 20 ++++++++++--------- 13 files changed, 62 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index 99bb05e0..3f03d637 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.2.RELEASE + 2.3.5.RELEASE com.example @@ -118,8 +118,14 @@ jcache + + + com.github.ulisesbocchio + jasypt-spring-boot-starter + 3.0.3 + com.github.cage cage @@ -145,6 +151,7 @@ org.springframework.boot spring-boot-maven-plugin + com.github.ulisesbocchio jasypt-maven-plugin diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 413788fa..c259e41b 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -10,9 +10,9 @@ spring.jpa.show-sql=true spring.h2.console.enabled=true spring.security.oauth2.client.registration.google.client-id=117280958387-anolbnmn0f605q9s5f08doupo20as134.apps.googleusercontent.com -spring.security.oauth2.client.registration.google.client-secret=ENC(kNrOQUnJV+Jrw5qtvhGOKcKHTbcIzAIVsdOcDrc8TL94ATJ6Go+YhEN0PlA4jecqxgh+CXyvh6GhecQ8J0+VMA==) +spring.security.oauth2.client.registration.google.client-secret=ENC(01j8FTmlNbiwzrtylgLyAypjBBSL7GlzgIPr5IJjHnXyEvFcsZrdLgCGiSnGsB7bcvYQvWOpPEcxJvIGPWHyjA==) spring.security.oauth2.client.registration.facebook.client-id=337578427405747 -spring.security.oauth2.client.registration.facebook.client-secret=ENC(2SnOka6IJrCfyUSe9jbF2Lkn6t28z4AYBojvaYWymtLYtTUw26XdkzlSCEQaWe930ZDZTaGdu8PtQBF9ri+Wi/pUhuwqrZkV4slCqluthgI=) +spring.security.oauth2.client.registration.facebook.client-secret=ENC(fZ/HiUqV53RZgAVd7VQduFmL75qXuPx0Lkg7fY38RPIJlIv+bWFetqxVo72pq/8v05KcMPjSn/TlaXoKya+LEOmz/TnRMaaPJfwMAwzCSOw=) logging.level.com.zaxxer.hikari.HikariConfig=DEBUG @@ -20,11 +20,13 @@ logging.level.com.zaxxer.hikari=TRACE app.captcha.length=3 -app.text.key=ENC(2CwoE+U5grb6vxP/zoybJzJiLi2UmN87LTN4HMsi7/LmVljiEHk+lvJIAU4BP+Dcr0ecKjh5sMlJl9eIUhb5KElO7Cj9TdDjnTBzxhNVGf0=) -app.text.salt=ENC(GYMBcwXBVs66ORX3+X+VrqYFfw4ACAUbTlRlAglRpCMSjpJI0kbinhoaeahhnmzhe9ChFG9WzDdA3EXZ9c8GYg==) +app.vapid.private=TESTKEYALOVOA + +app.text.key=ENC(tvavtxfGuwtBt01Yt/ihnrD0XGgfQaBXncr0kgK388LW1CQ/Hs4hJX7tJtHQou8eageB6+M4t2T+7yHrnkIu48Gq3mMfFY2xgAyra+M0O4w=) +app.text.salt=ENC(ORKISCl/pwaW6WDu8JFdBrpHPMk6O7f/GIbiM2kU9fpCPXIeDe1Bv9fP0jdZK1YuM/gJ/iYg1nEF6Yb5fj7/QQ==) app.admin.email=nonononoki@gmx.de -app.admin.key=ENC(wBE6tjjCnjDxAjrKrfdRTAv1eA3K8dD8/h5OSa23+rAzXMaHhDO9Pje4H9r6g4J9quAbI48rXjkp4huCNLJUpKERVp0ng5uiMkkmXTiMXbrmm2YMdgFqQPMODItwwMiBgdyX9fM0tKzCBbW2tSO0dw2LEkw3gz3Vmv1/O+A8JuuJ8Czg/icniPyrLmJL3h1hhm/KSgy0qR4PC4hyx8CNPy1D3jIQIfcIjyBinGGnIvQ=) +app.admin.key=ENC(/213aF5QvK7K2XooFxjShGFpatOY9GL+zLyd3MpeM1nr+7NeYLMEBYw4kbXWKR0d/IRATSXjAuMVnC4qJSjZhM+IjrWTgHKY/9XT4s4DnJwBaEmNtMXazLy97G96is1y4DYSt1RH++7XfOdqcinXvspbXk21ZubXCpSbaIVayY8Y0Yyz6XZ8knrLc1vigDsHy8mlNbmnhyCMu/Uy8BebAFBe7zTLgMVxXD181owbz2g=) spring.mail.host=mail.gmx.net spring.mail.port=587 spring.mail.username=nonononoki@gmx.de -spring.mail.password=ENC(WGPofkLt76CtmHjipbS8l0eZIB5TlNnQxMFeJhsD9EZgFB8YVNedrpq4X+n4ynI2R2i5caQT1FJfFstKiC6vJR+4bp9CH60a8jHZ7WFtaXQ=) +spring.mail.password=ENC(pa1liwVlIDcupsmUjUBt7oshftajvupYsUKSIwxJWrSCRDgcRS9o8XbJzPdVgv8jQ/UEHCAYCt19Lko2mjJKXiSy+Favc3i8E75p/pXuoRA=) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b70b573e..17e1e7db 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,5 @@ -spring.profiles.active=dev +#only used when not configured in run configuration, dev profile always recommended to save in IDE +spring.profiles.active=test server.port=${PORT:8443} diff --git a/src/main/resources/static/css/alovoa-dark.css b/src/main/resources/static/css/alovoa-dark.css index 920a6be4..9797446b 100644 --- a/src/main/resources/static/css/alovoa-dark.css +++ b/src/main/resources/static/css/alovoa-dark.css @@ -1,3 +1,4 @@ + body, .card, .box, .textarea, .footer, .table, .select select, select option { background-color: #2e3436; @@ -54,6 +55,10 @@ textarea::placeholder { opacity: 0.5; } +.title { + color: white; +} + @media screen and (max-width: 1024px) { .profile-bottom.dimmed { background: rgba(46, 52, 54, 0.9); diff --git a/src/main/resources/static/css/messageDetail.css b/src/main/resources/static/css/messageDetail.css index 854542eb..b178ccc6 100644 --- a/src/main/resources/static/css/messageDetail.css +++ b/src/main/resources/static/css/messageDetail.css @@ -1,6 +1,6 @@ #top { - height: 100px; border-bottom: 1px solid #dbdbdb; + padding-bottom: 16px; } #first-name { @@ -46,8 +46,8 @@ } .profile-pic { - height: 80px; - width: 80px; + height: 40px; + width: 40px; } .section { @@ -66,8 +66,4 @@ #first-name { font-size: 1.7em } - .profile-pic { - height: 40px; - width: 40px; - } } \ No newline at end of file diff --git a/src/main/resources/static/css/notification.css b/src/main/resources/static/css/notification.css index 85b3e7b8..e8c2f63c 100644 --- a/src/main/resources/static/css/notification.css +++ b/src/main/resources/static/css/notification.css @@ -1,6 +1,6 @@ .image img { - max-height: 200px; - max-width: 200px; + max-height: 100px; + max-width: 100px; } .card { diff --git a/src/main/resources/static/js/messageDetail.js b/src/main/resources/static/js/messageDetail.js index b8e18c76..9ac505d6 100644 --- a/src/main/resources/static/js/messageDetail.js +++ b/src/main/resources/static/js/messageDetail.js @@ -87,7 +87,8 @@ function startVideoChat() { if (answer) { let rand = randomString(); let url = "https://meet.jit.si/" + rand; - $("#message-send-input").val(url); + let link = `${url}`; + $("#message-send-input").val(link); sendMessage(); window.open(url); } diff --git a/src/main/resources/templates/delete-account.html b/src/main/resources/templates/delete-account.html index 9524a8f1..d5c4fbc7 100644 --- a/src/main/resources/templates/delete-account.html +++ b/src/main/resources/templates/delete-account.html @@ -26,7 +26,7 @@

- +
@@ -41,6 +41,7 @@

+
diff --git a/src/main/resources/templates/fragments.html b/src/main/resources/templates/fragments.html index 1dc740a9..82d80abc 100644 --- a/src/main/resources/templates/fragments.html +++ b/src/main/resources/templates/fragments.html @@ -239,9 +239,9 @@
+ th:utext="${message.content}" style="word-break: break-all;">
+ th:utext="${message.content}" style="word-break: break-all;"> diff --git a/src/main/resources/templates/messages.html b/src/main/resources/templates/messages.html index e183d7bc..7859508c 100644 --- a/src/main/resources/templates/messages.html +++ b/src/main/resources/templates/messages.html @@ -31,14 +31,14 @@ th:value="${convo.userIdEncoded}"> -
-
+
+
- -
diff --git a/src/main/resources/templates/notification.html b/src/main/resources/templates/notification.html index ca504d29..452f826b 100644 --- a/src/main/resources/templates/notification.html +++ b/src/main/resources/templates/notification.html @@ -29,7 +29,7 @@
+ style="margin: 0;">
diff --git a/src/main/resources/templates/profile.html b/src/main/resources/templates/profile.html index 1551ab18..7968f65c 100644 --- a/src/main/resources/templates/profile.html +++ b/src/main/resources/templates/profile.html @@ -41,12 +41,12 @@
+ + class="profile-pic " th:src="${user.profilePicture}" + th:value=1 />
@@ -72,8 +72,6 @@
- -
@@ -204,12 +202,12 @@
-
+
- +
@@ -217,12 +215,12 @@
-
+
- +
diff --git a/src/test/java/com/nonononoki/alovoa/UserTests.java b/src/test/java/com/nonononoki/alovoa/UserTests.java index 63d5d850..7cae751a 100644 --- a/src/test/java/com/nonononoki/alovoa/UserTests.java +++ b/src/test/java/com/nonononoki/alovoa/UserTests.java @@ -14,6 +14,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; @@ -31,6 +32,7 @@ @RunWith(SpringRunner.class) @SpringBootTest +@ContextConfiguration @ActiveProfiles("test") public class UserTests { @@ -59,7 +61,7 @@ public class UserTests { @Test public void test() throws Exception { - //one default admin user + // one default admin user Assert.assertEquals(userRepo.count(), 1); // register and confirm test users @@ -77,25 +79,25 @@ public void test() throws Exception { RegisterDto user3Dto = createTestUserDto(2, c3); String tokenContent3 = registerService.register(user3Dto); User user3 = registerService.registerConfirm(tokenContent3); - - //set location manually since no extra service is needed + + // set location manually since no extra service is needed Location loc1 = new Location(); loc1.setLatitude("0"); loc1.setLongitude("0"); user1.setLastLocation(loc1); - + Location loc2 = new Location(); loc2.setLatitude("0"); loc2.setLongitude("0"); loc2.setUser(user2); user2.setLastLocation(loc2); - + Location loc3 = new Location(); loc3.setLatitude("0"); loc3.setLongitude("0"); loc3.setUser(user3); user3.setLastLocation(loc3); - + userRepo.saveAndFlush(user1); userRepo.saveAndFlush(user2); userRepo.saveAndFlush(user3); @@ -113,7 +115,7 @@ public void test() throws Exception { userService.updateMaxAge(100); userService.updateMinAge(16); userService.updatePreferedGender(2, true); - userService.updateTheme(1); + userService.updateTheme(1); Mockito.when(authService.getCurrentUser()).thenReturn(user2); String img2 = Tools.imageToB64(Tools.getFileFromResources("img/profile2.png")); @@ -142,11 +144,11 @@ public void test() throws Exception { Mockito.when(authService.getCurrentUser()).thenReturn(user1); List searchDtos1 = searchService.search("0", "0", 50, 1); Assert.assertEquals(searchDtos1.size(), 2); - + Mockito.when(authService.getCurrentUser()).thenReturn(user2); List searchDtos2 = searchService.search("0", "0", 50, 1); Assert.assertEquals(searchDtos2.size(), 1); - + Mockito.when(authService.getCurrentUser()).thenReturn(user3); List searchDtos3 = searchService.search("0", "0", 50, 1); Assert.assertEquals(searchDtos3.size(), 1);