Skip to content

Commit

Permalink
Add Logo to LoginView, add Logo to Project, change input Field labels…
Browse files Browse the repository at this point in the history
…, refactor Login code
  • Loading branch information
anywaywayany committed Nov 26, 2023
1 parent eef5461 commit d88622c
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 19 deletions.
153 changes: 153 additions & 0 deletions frontend/themes/samic/components/logo_samic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[part="brand"] {
background: transparent;
background-image: url("logo_samic.svg");
background-size: auto 50%;
background-repeat: no-repeat;
background-position: center;
}

32 changes: 13 additions & 19 deletions src/main/java/com/samic/samic/views/login/LoginView.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,37 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver {
private final AuthenticatedUser authenticatedUser;

private final LoginOverlay loginOverlay = new LoginOverlay();
private static final String USERNAME_LABEL = "Username";
private static final String PASSWORD_LABEL = "Password";
private static final boolean HAS_FORGOT_PASSWORD = false;

public LoginView(AuthenticatedUser authenticatedUser) {
this.authenticatedUser = authenticatedUser;
initUI();

// Mulit Language Support


}

private void initUI() {
LoginI18n i18n = LoginI18n.createDefault();
i18n.setHeader(new LoginI18n.Header());
i18n.getHeader().setTitle("SOME");
i18n.getHeader().setDescription("Inventory Control");
i18n.getForm().setUsername(USERNAME_LABEL);
i18n.getForm().setPassword(PASSWORD_LABEL);


Anchor register = new Anchor("register", "Create an Account");
register.setWidthFull();
loginOverlay.setI18n(i18n);
loginOverlay.getCustomFormArea().add(register);
loginOverlay.getFooter().add(register);
// end::snippet[]
add(loginOverlay);
loginOverlay.setForgotPasswordButtonVisible(HAS_FORGOT_PASSWORD);
loginOverlay.setOpened(true);
add(loginOverlay);
// Prevent the example from stealing focus when browsing the
// documentation
loginOverlay.getElement().setAttribute("no-autofocus", "");

// Login does not work without this one
loginOverlay.setAction(
RouteUtil.getRoutePath(VaadinService.getCurrent().getContext(), getClass()));
}

/*
i18n.getHeader().setDescription("No Demo User Credentials");
i18n.setAdditionalInformation(null);
i18n.getForm().setForgotPassword("Forgot Password");
setI18n(i18n);
setForgotPasswordButtonVisible(true);
setOpened(true);
*/

@Override
public void beforeEnter(BeforeEnterEvent event) {
Expand Down
Loading

0 comments on commit d88622c

Please sign in to comment.