Skip to content

Commit

Permalink
Updated Spring version to 2.3.5 (2.4.0 still has some issues!)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nonononoki committed Nov 17, 2020
1 parent 44a8468 commit b43ab86
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 49 deletions.
9 changes: 8 additions & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<version>2.3.5.RELEASE</version>
<relativePath />
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -118,8 +118,14 @@
<artifactId>jcache</artifactId>
</dependency>


<!-- External 3rd party dependencies -->

<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>com.github.cage</groupId>
<artifactId>cage</artifactId>
Expand All @@ -145,6 +151,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- Only needed to generate encrypted values -->
<plugin>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-maven-plugin</artifactId>
Expand Down
14 changes: 8 additions & 6 deletions src/main/resources/application-test.properties
Expand Up @@ -10,21 +10,23 @@ 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
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=)
3 changes: 2 additions & 1 deletion 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}

Expand Down
5 changes: 5 additions & 0 deletions 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;
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 3 additions & 7 deletions src/main/resources/static/css/messageDetail.css
@@ -1,6 +1,6 @@
#top {
height: 100px;
border-bottom: 1px solid #dbdbdb;
padding-bottom: 16px;
}

#first-name {
Expand Down Expand Up @@ -46,8 +46,8 @@
}

.profile-pic {
height: 80px;
width: 80px;
height: 40px;
width: 40px;
}

.section {
Expand All @@ -66,8 +66,4 @@
#first-name {
font-size: 1.7em
}
.profile-pic {
height: 40px;
width: 40px;
}
}
4 changes: 2 additions & 2 deletions 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 {
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/static/js/messageDetail.js
Expand Up @@ -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 = `<a href="${url}" target="_blank">${url}</a>`;
$("#message-send-input").val(link);
sendMessage();
window.open(url);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/templates/delete-account.html
Expand Up @@ -26,7 +26,7 @@ <h3 class="title" th:text="#{delete-account.title}"></h3>
<input type="hidden" name="tokenString" th:value="${tokenString}"
required>
<div class="field">
<input name="email" th:placeholder="#{email}" class="input">
<input name="email" type="email" th:placeholder="#{email}" class="input" required>
</div>
<div style="padding-top: 32px;"></div>
<div th:replace="fragments.html::captcha"></div>
Expand All @@ -41,6 +41,7 @@ <h3 class="title" th:text="#{delete-account.title}"></h3>


</div>
<footer th:replace="fragments.html::navigation"></footer>
<footer th:replace="fragments.html::footer"></footer>

<script src="/js/lib/fontawesome.all.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/fragments.html
Expand Up @@ -239,9 +239,9 @@
<div th:each="message : ${messages}"
style="display: inline-block; width: 100%;">
<div th:if="${message.from}" class="message left"
th:text="${message.content}" style="word-break: break-all;"></div>
th:utext="${message.content}" style="word-break: break-all;"></div>
<div th:unless="${message.from}" class="message right"
th:text="${message.content}" style="word-break: break-all;"></div>
th:utext="${message.content}" style="word-break: break-all;"></div>
</div>
</div>

Expand Down
14 changes: 7 additions & 7 deletions src/main/resources/templates/messages.html
Expand Up @@ -31,14 +31,14 @@
th:value="${convo.userIdEncoded}">
</figure>
</div>
<div class="card-content" style="display:flex; justify-items: center; align-items: center;">
<div class="full-width profile-bottom"
>
<div class="card-content"
style="display: flex; justify-items: center; align-items: center;">
<div class="full-width profile-bottom">
<div style="font-size: 1.5em" th:text="${convo.userName}"></div>
<span style="font-size: 0.8em; overflow-wrap: normal;"
th:text="${convo.lastMessage}"
th:if="${convo.lastMessage != null}"></span>
<span style="font-size: 0.8em; overflow-wrap: normal;"
<span style="font-size: 0.8em; overflow-wrap: normal; background-color: initial;" class="message"
th:utext="${convo.lastMessage}"
th:if="${convo.lastMessage != null}"></span> <span
style="font-size: 0.8em; overflow-wrap: normal;"
th:unless="${convo.lastMessage != null}"
th:text="#{message.match}"></span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/notification.html
Expand Up @@ -29,7 +29,7 @@
<figure class="image" >
<img th:src="${notification.userFromDto.profilePicture}"
class="profile-pic"
style="max-height: 200px; max-width: 200px; margin: 0;">
style="margin: 0;">
</figure>
</div>
<div class="card-content">
Expand Down
20 changes: 9 additions & 11 deletions src/main/resources/templates/profile.html
Expand Up @@ -41,12 +41,12 @@
<div class="center-parent">
<img id="profilePicture" class="profile-pic"
src="/img/profile.jpg" style="cursor: pointer;" height=400
width="400" th:unless="${user.profilePicture}" th:value=0 /> <img
id="profilePicture" style="cursor: pointer;" height=400
width="400" th:unless="${user.profilePicture}" th:value=0 />
<img id="profilePicture" style="cursor: pointer;" height=400
width="400" th:if="${user.profilePicture}"
class="profile-pic " th:src="${user.profilePicture}" th:value=1 /> <input
id="profilePictureUpload" type="file" accept="image/*"
style="display: none">
class="profile-pic " th:src="${user.profilePicture}"
th:value=1 /> <input id="profilePictureUpload" type="file"
accept="image/*" style="display: none">
</div>
</div>
<div th:each="img : ${user.images}" class="swiper-slide">
Expand All @@ -72,8 +72,6 @@
<div class="swiper-button-prev"></div>
</div>



</div>


Expand Down Expand Up @@ -204,25 +202,25 @@
<div class="box">
<div class="field">
<label class="label" th:text="#{profile.userdata.request}"></label>
<div class="field">
<div class="field" style="display:flex">
<input class="input" type="password" th:placeholder="#{password}"
id="userdata-password" th:if="${user.password}"> <input
name="password" th:unless="${user.password}" value="" hidden>
<div style="padding-top: 4px;"></div>
<button class="button" id="userdata-submit" th:text="#{submit}"></button>
<button class="button" id="userdata-submit" th:text="#{submit}" style="margin-left: 4px;"></button>
</div>
</div>
</div>

<div class="box">
<div class="field">
<label class="label" th:text="#{profile.account.delete}"></label>
<div class="field">
<div class="field" style="display:flex">
<input class="input" type="password" th:placeholder="#{password}"
id="delete-acc-password" th:if="${user.password}"> <input
name="password" th:unless="${user.password}" value="" hidden>
<div style="padding-top: 4px;"></div>
<button class="button" id="delete-acc-submit" th:text="#{submit}"></button>
<button class="button" id="delete-acc-submit" th:text="#{submit}" style="margin-left: 4px;"></button>
</div>
</div>
</div>
Expand Down
20 changes: 11 additions & 9 deletions src/test/java/com/nonononoki/alovoa/UserTests.java
Expand Up @@ -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;

Expand All @@ -31,6 +32,7 @@

@RunWith(SpringRunner.class)
@SpringBootTest
@ContextConfiguration
@ActiveProfiles("test")
public class UserTests {

Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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"));
Expand Down Expand Up @@ -142,11 +144,11 @@ public void test() throws Exception {
Mockito.when(authService.getCurrentUser()).thenReturn(user1);
List<UserDto> searchDtos1 = searchService.search("0", "0", 50, 1);
Assert.assertEquals(searchDtos1.size(), 2);

Mockito.when(authService.getCurrentUser()).thenReturn(user2);
List<UserDto> searchDtos2 = searchService.search("0", "0", 50, 1);
Assert.assertEquals(searchDtos2.size(), 1);

Mockito.when(authService.getCurrentUser()).thenReturn(user3);
List<UserDto> searchDtos3 = searchService.search("0", "0", 50, 1);
Assert.assertEquals(searchDtos3.size(), 1);
Expand Down

0 comments on commit b43ab86

Please sign in to comment.