Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5d062fb
Login Page (#998)
Jan 11, 2023
1c4daa4
Login Page. CSSex (#998)
Jan 11, 2023
1352448
Login Page. CSSex 2 (#998)
Jan 11, 2023
33be3a5
Login Page. CSSex 3 (#998)
Jan 11, 2023
928bcab
ForgotPasswordPage (#998)
Jan 12, 2023
7859c1d
ForgotPasswordPage 2 (#998)
Jan 12, 2023
5e06a01
ForgotPasswordPage 3 (#998)
Jan 12, 2023
8d7d2f5
RegistrationPage (#998)
Jan 12, 2023
5f2f726
TermsOfServicePage (#998)
Jan 12, 2023
2176b77
CSS (#998)
Jan 12, 2023
cd14eec
New stuff (#998)
Jan 12, 2023
6087dee
Tooltip test (#998)
Jan 12, 2023
3086d28
RegistrationPage (#998)
Jan 13, 2023
a92b095
RegistrationPage. Magic (#998)
Jan 13, 2023
1425be7
RegistrationPage. Magic 2 (#998)
Jan 13, 2023
d419465
RegistrationPage. Magic 3 (#998)
Jan 13, 2023
75105d8
RegistrationPage. Magic 4 (#998)
Jan 13, 2023
34921b6
RegistrationPage. PasswordGenerator (#998)
Jan 13, 2023
cb2be02
RegistrationPage. PasswordGenerator. CSS (#998)
Jan 13, 2023
2c4a3ee
RegistrationPage. PasswordGenerator. CSS 2 (#998)
Jan 13, 2023
a495f7a
LoginPage. Easy login for Dev and ProfilePage [WIP] (#998)
Jan 15, 2023
57ec50c
LoginPage. Easy login for Dev and ProfilePage (#998)
Jan 15, 2023
62ab4cb
ProfilePage, OTP [WIP] and ConfirmAccountPage (#998)
Jan 16, 2023
b77b1a5
Improvements (#998)
Jan 20, 2023
9dc9c1c
ProfilePage: Tabs and Telegram Stuff (#998)
Jan 21, 2023
8e95c75
ProfilePage: Tabs and Telegram Stuff. Fix (#998)
Jan 22, 2023
f177a83
ProfilePage: Tabs and Telegram Stuff. Fix pack (#998)
Jan 22, 2023
972a12c
ProfilePage: 2FA state [WIP] (#998)
Jan 22, 2023
025a123
ProfilePage: 2FA state (#998)
Jan 23, 2023
0c400f7
ProfilePage: 2FA state - no save button (#998)
Jan 24, 2023
332bd9d
Merge branch 'trunk' into 998-form-layout
Jan 25, 2023
cb1eec9
Actions after login (#998)
Jan 26, 2023
3d8f78c
ProfilePage: SettingsTab created, SecurityTab updated (#998)
Jan 26, 2023
5db4320
ProfilePage: Sections (#998)
Jan 28, 2023
25b3c96
ProfilePage: Sections for SettingsTab as well (#998)
Jan 28, 2023
83409c2
ProfilePage: FlexLayout (#998)
Jan 29, 2023
d0d42a1
ProfilePage: SettingsTab (#998)
Jan 30, 2023
9d85c08
ProfilePage: SettingsTab. Fix (#998)
Jan 30, 2023
5682167
ProfilePage: DangerZoneTab draft (#998)
Jan 31, 2023
f0fccac
ProfilePage: CSSex (#998)
Jan 31, 2023
677a7cb
ProfilePage: Painting Buttons (#998)
Jan 31, 2023
4b5eb0c
ProfilePage: too much red (#998)
Jan 31, 2023
c3f4adc
ConfirmAccountPage (#998)
Jan 31, 2023
e119aed
Redirect stuff (#998)
Jan 31, 2023
890cec9
More CSS Stuff (#998)
Feb 2, 2023
01fc58e
LoginPage. Validation (#998)
Feb 3, 2023
cf96c51
RegistrationPage. Validation (#998)
Feb 3, 2023
4b498a8
Notification updates (#998)
Feb 3, 2023
656dc17
Notification updates 2 (#998)
Feb 3, 2023
a1f9a39
DangerZone is done (#998)
Feb 8, 2023
810d140
ProfileTab (#998)
Feb 8, 2023
b1f1567
ProfileTab. Css stuff (#998)
Feb 8, 2023
ce5e322
ProfileTab. Email suffix (#998)
Feb 8, 2023
e1ccf63
ProfileTab. Email bug fixed (#998)
Feb 10, 2023
3577ff7
SecurityTab. Password update validation (#998)
Feb 13, 2023
3ceb975
PasswordGenerator. Notification (#998)
Feb 13, 2023
41f90a5
Code fixes (#998)
kyberorg Feb 13, 2023
9563458
Code fixes 2 (#998)
kyberorg Feb 13, 2023
eabcf0d
New confirmation token ident generation logic (#998)
kyberorg Feb 13, 2023
f37eea2
Fixes (#998)
kyberorg Feb 15, 2023
d873dda
More fixes (#998)
kyberorg Feb 15, 2023
63969a1
More fixes 2 (#998)
kyberorg Feb 15, 2023
ef4a9fb
Update profile_page.css
kyberorg Feb 15, 2023
12db48d
Percentage approach
kyberorg Feb 15, 2023
accb8c3
CSS fix (#998)
kyberorg Feb 16, 2023
159c05e
Confirm Account page (#998)
kyberorg Feb 16, 2023
0f1333c
Confirm Account page is ready (#998)
kyberorg Feb 17, 2023
06770f4
Confirm Account page is ready. Removing get() (#998)
kyberorg Feb 20, 2023
34061de
Updating channels as well (#998)
kyberorg Feb 20, 2023
ff936c0
Code style (#998)
kyberorg Feb 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="OperatorWrap">
<property name="tokens"
value="ASSIGN,DIV_ASSIGN,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,MOD_ASSIGN,
SR_ASSIGN,BSR_ASSIGN,SL_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN,BAND_ASSIGN"/>
<property name="option" value="eol"/>
</module>

<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
Expand Down
24 changes: 24 additions & 0 deletions frontend/css/axe_form_styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.axe-form-title {
align-self: center;
}

.axe-form-subtitle {
padding-left: 1rem;
}
.space-after-submit-button {
width: 100%;
}

.vertically-compact {
padding-top: 1px;
padding-bottom: 1px;
}

.axe-fields > * {
min-width: 99%;
}

.space-after-fields {
padding-left: 1rem;
max-width: 99%;
}
16 changes: 16 additions & 0 deletions frontend/css/common_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,19 @@ vaadin-drawer-toggle {
vaadin-icon[icon="vaadin:sign-in"] {
padding-left: 0 !important;
}

.green {
color: green;
}

.red {
color: red;
}

.fit-in-window {
flex-wrap: wrap;
}

.fit-in-window > * {
flex: 1 0 auto;
}
20 changes: 20 additions & 0 deletions frontend/css/danger_dialog.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
html {
--axe-warning-zone-color: rgb(231 235 239);
}

html[theme="dark"] {
--axe-warning-zone-color: rgb(55 72 95);
}

.danger-dialog {
max-width: min(501px,97%);
}

.italic-text {
font-style: italic;
}

.danger-dialog-warning-zone {
background: var(--axe-warning-zone-color);
}

3 changes: 3 additions & 0 deletions frontend/css/forgot_password_page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.result-span {
padding-left: 1rem;
}
4 changes: 4 additions & 0 deletions frontend/css/login_page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.forgot-password-section {
text-align: center;
width: 100%;
}
28 changes: 28 additions & 0 deletions frontend/css/profile_page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.profile-title {
align-self: center;
}

.toggle-with-prefix-postfix {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toggle with prefix and postfix

margin-right: 0.3rem;
margin-left: 0.3rem;
}

.tab-content {
padding-left: 0!important;
padding-right: 0!important;
}

@media (max-width: 400px) {
.fit-in-section {
width: min-content;
}
}

.telegram-details {
display: block;
max-width: min(290px, 100%);
}

.telegram-details div {
margin: 0.5rem;
}
8 changes: 8 additions & 0 deletions frontend/css/registration_page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.input {
flex-shrink: 0.3;
width: 100%;
}

.info-button {
border-radius: 100%;
}
1 change: 1 addition & 0 deletions src/main/java/pm/axe/Axe.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static class C {
public static final int ONE_SECOND_IN_MILLIS = 1000;
public static final String TIME_DATE_FORMAT = "dd/MM/yyyy HH:mm:ss z";
public static final String MINUS = "-";
public static final String PLUS = "+";
}

public static class Defaults {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/pm/axe/Endpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ public static class UI {
public static final String WELCOME_PAGE = "welcome";
public static final String REGISTRATION_FAILED_PAGE = "registrationFailed";
public static final String LOGIN_PAGE = "login";
public static final String REGISTRATION_PAGE = "register";
public static final String FORGOT_PASSWORD_PAGE = "forgot-password";
public static final String TOS_PAGE = "terms-of-service";
public static final String PROFILE_PAGE = "profile";
public static final String CONFIRM_ACCOUNT_PAGE = "confirm-account";
public static final String LOGIN_VERIFICATION_PAGE = "verify";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pm/axe/api/user/PostUserRestController.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public ResponseEntity<?> registerUser(final @RequestBody PostUserRequest request
}
} else {
log.info("{} There is no user-defined Username in Request. Generating custom Username", TAG);
OperationResult usernameGenerationResult = usernameGenerator.generate();
OperationResult usernameGenerationResult = usernameGenerator.generateRandom();
if (usernameGenerationResult.ok()) {
username = usernameGenerationResult.getStringPayload();
} else {
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/pm/axe/core/IdentGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public final class IdentGenerator {
public static final String VALID_IDENT_PATTERN = "^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){0,"
+ IDENT_MAX_LENGTH_WITHOUT_FIRST_AND_LAST_CHARS + "}[a-zA-Z0-9]$";

private static final int TOKEN_SUBSTRING_START_INDEX = 0;
private static final int TOKEN_SUBSTRING_END_INDEX = 7;

private IdentGenerator() {
throw new UnsupportedOperationException("Utility class");
}
Expand Down Expand Up @@ -68,7 +65,9 @@ public static String generateTokenIdent(final Token token) {

private static String generateAccountConfirmationIdent(final Token token) {
String prefix = token.getTokenType().getIdentPrefix();
String firstPartOfToken = token.getToken().substring(TOKEN_SUBSTRING_START_INDEX, TOKEN_SUBSTRING_END_INDEX);
return String.join("", prefix, firstPartOfToken);
String randomNumber = RandomStringUtils.randomNumeric(1);
String randomChar = RandomStringUtils.randomAlphanumeric(1);
String randomNum = RandomStringUtils.randomNumeric(1);
return String.join("", prefix, randomNumber, randomChar, randomNum);
}
}
9 changes: 9 additions & 0 deletions src/main/java/pm/axe/db/dao/AccountDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ public interface AccountDao extends CrudRepository<Account, Long> {
*/
Optional<Account> findByUserAndType(User user, AccountType accountType);

/**
* Searching for User's Account by its {@link AccountType}.
*
* @param user account's owner
* @param accountType type of account
* @return true - if found or false - if not.
*/
boolean existsByUserAndType(User user, AccountType accountType);

/**
* Lists all {@link Account}s of given {@link AccountType}.
*
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/pm/axe/db/dao/TokenDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.NonNull;
import org.springframework.scheduling.annotation.Async;
import pm.axe.db.dao.base.TimeAwareCrudDao;
import pm.axe.db.models.Account;
import pm.axe.db.models.Token;
import pm.axe.db.models.User;
import pm.axe.users.TokenType;
Expand Down Expand Up @@ -62,6 +63,17 @@ public interface TokenDao extends TimeAwareCrudDao<Token, Long> {
*/
Token findByTokenTypeAndUser(TokenType tokenType, User user);

/**
* Finds {@link TokenType#ACCOUNT_CONFIRMATION_TOKEN} by its {@link TokenType}, {@link User} and {@link Account}.
*
* @param tokenType normally {@link TokenType#ACCOUNT_CONFIRMATION_TOKEN}.
* @param user {@link Token}'s owner
* @param account {@link Account} to be confirmed
*
* @return {@link Optional} with found {@link Token} record or {@link Optional#empty()}.
*/
Optional<Token> findByTokenTypeAndUserAndConfirmationFor(TokenType tokenType, User user, Account account);

/**
* Finds all {@link Token} records owned by {@link User}.
*
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/pm/axe/db/models/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ public static Account.Builder create(final AccountType accountType) {
return new Builder(accountType);
}

/**
* This method updates fields iof current {@link Account} record with values from another.
*
* @param anotherAccount another non-null {@link Account} record to copy values from.
* @throws IllegalArgumentException when anotherAccount is NULL.
*/
public void copy(final Account anotherAccount) {
if (anotherAccount == null) throw new IllegalArgumentException("Another Account cannot be null");
this.setUser(anotherAccount.getUser());
this.setType(anotherAccount.getType());
this.setAccountName(anotherAccount.getAccountName());
this.setConfirmed(anotherAccount.isConfirmed());
this.setExtraInfo(anotherAccount.getExtraInfo());
}

private Account(final AccountType accountType, final User user) {
this.type = accountType;
this.user = user;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pm/axe/db/models/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Token extends TimeModel {
/**
* Default length of Token (code).
*/
private static final int CODE_TOKEN_LEN = 6;
public static final int CODE_TOKEN_LEN = 6;
@Column(name = "token", nullable = false, unique = true)
private String token;

Expand Down
16 changes: 16 additions & 0 deletions src/main/java/pm/axe/internal/HasTabInit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package pm.axe.internal;

import com.vaadin.flow.component.tabs.Tab;
import pm.axe.db.models.User;

/**
* This interface determines, that {@link Tab} has {@link #tabInit(User)} method.
*/
public interface HasTabInit {
/**
* Method, that should be called at initialization phase.
*
* @param user bound {@link User}. Usually stored within current session.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current AxeSession

*/
void tabInit(User user);
}
19 changes: 19 additions & 0 deletions src/main/java/pm/axe/mail/EmailConfirmationStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package pm.axe.mail;

import com.vaadin.flow.component.icon.VaadinIcon;
import lombok.Getter;

public enum EmailConfirmationStatus {
CONFIRMED(VaadinIcon.CHECK, "Email confirmed"),
PENDING(VaadinIcon.ELLIPSIS_CIRCLE, "Validation pending..."),
FAILED(VaadinIcon.FIRE, "Validation failed"),
NONE(VaadinIcon.COG, "No status defined yet");

@Getter
private final VaadinIcon icon;
@Getter private final String statusString;
EmailConfirmationStatus(final VaadinIcon icon, final String statusString) {
this.icon = icon;
this.statusString = statusString;
}
}
Loading