Skip to content

Commit

Permalink
Merge pull request #456 from DevSeg/team_collaboration_branch
Browse files Browse the repository at this point in the history
Team collaboration branch commit for New UI
  • Loading branch information
sundayAdu authored Jun 21, 2023
2 parents dde610c + 3f6dedb commit cfda0e5
Show file tree
Hide file tree
Showing 354 changed files with 10,552,439 additions and 1,109 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
:host {
max-width: calc(var(--lumo-size-m) * 10);
background: #e8f0fe;
}

[part="form"] {
padding: var(--lumo-space-l);
}

[part="form-title"] {
margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));
display: none;
}

#forgotPasswordButton {
margin: var(--lumo-space-s) auto;
}

[part="error-message"] {
background-color: var(--lumo-error-color-10pct);
padding: var(--lumo-space-m);
border-radius: var(--lumo-border-radius);
margin-top: var(--lumo-space-m);
margin-bottom: var(--lumo-space-s);
color: var(--lumo-error-text-color);
}

:host(:not([dir="rtl"])) [part="error-message"] {
padding-left: var(--lumo-size-m);
}

:host([dir="rtl"]) [part="error-message"] {
padding-right: var(--lumo-size-m);
}

[part="error-message"]::before {
content: var(--lumo-icons-error);
font-family: lumo-icons;
font-size: var(--lumo-icon-size-m);
position: absolute;
width: var(--lumo-size-m);
height: 1em;
line-height: 1;
text-align: center;
}

:host(:not([dir="rtl"])) [part="error-message"]::before {
/* Visual centering */
margin-left: calc(var(--lumo-size-m) * -0.95);
}

:host([dir="rtl"]) [part="error-message"]::before {
/* Visual centering */
margin-right: calc(var(--lumo-size-m) * -0.95);
}

[part="error-message-title"] {
margin: 0 0 0.25em;
color: inherit;
}

[part="error-message-description"] {
font-size: var(--lumo-font-size-s);
line-height: var(--lumo-line-height-s);
margin: 0;
opacity: 0.9;
}

[part="footer"] {
font-size: var(--lumo-font-size-xs);
line-height: var(--lumo-line-height-s);
color: var(--lumo-secondary-text-color);
}
45 changes: 33 additions & 12 deletions apmis-flow/frontend/themes/apmis-theme/main-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ header {
color: white !important;
}

.loginView {
background-image: url("images/loginBackground.png");
background-repeat: no-repeat;
background-size: cover;
}


.loginContainer {
display: flex;
Expand Down Expand Up @@ -264,16 +260,11 @@ header {
}

#label-vaadin-text-field-0, #label-vaadin-password-field-3 {
color: white;

}

#input-vaadin-text-field-6, #input-vaadin-password-field-7 {
-_lumo-text-field-overflow-mask-image: () !important;
-webkit-mask-image: var(- -_lumo-text-field-overflow-mask-image);
border-radius: 5px;
margin-left: -5px;
border: 1px solid white !important;
color: white;

}

label {
Expand Down Expand Up @@ -467,8 +458,38 @@ vcf-nav-item::part(item) {
border-inline-start: 2px solid transparent;
}

.login-screen {
background-image: url("images/loginBackground.png");
background-repeat: no-repeat;
background-size: cover;
}

.language-switcher vaadin-button{
color: white;
}

vcf-nav-item[active]::part(item) {
border-inline-start-color: var(--lumo-primary-color);
color: white !important;
background: #F08F3E !important;
}


.apmis-login-logo{
height: 20vh;
}

#vaadinLoginUsername label, #vaadinLoginPassword label{
color: white !important;
font-family: Lato;
font-size: large;
}

vaadin-text-field#vaadinLoginUsername .vaadin-field-container vaadin-input-container{
background: yellow;
}

vaadin-vertical-layout.campaignDataFilterParent{
margin-top : 5px !important;
margin-bottom : 0px !important;
}
1 change: 1 addition & 0 deletions apmis-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
"@vaadin/vaadin-virtual-list": "$@vaadin/vaadin-virtual-list",
"@vaadin/vertical-layout": "$@vaadin/vertical-layout",
"@vaadin/virtual-list": "$@vaadin/virtual-list",
"@flowingcode/font-awesome-iron-iconset": "$@flowingcode/font-awesome-iron-iconset",
"@polymer/polymer": "$@polymer/polymer",
"@vaadin-component-factory/vcf-anchor-nav": "$@vaadin-component-factory/vcf-anchor-nav",
"@vaadin-component-factory/vcf-nav": "$@vaadin-component-factory/vcf-nav",
Expand Down
6 changes: 6 additions & 0 deletions apmis-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@
<artifactId>javax.security.enterprise</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>


</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.html.Image;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.login.LoginForm;
import com.vaadin.flow.component.login.LoginI18n;
Expand All @@ -25,88 +26,69 @@
//@CssImport("./styles/shared-styles.css")
public class LoginView extends FlexLayout {

/**
/**
*
*/
private static final long serialVersionUID = -597195523867494116L;

private transient ResourceBundle resourceBundle = ResourceBundle.getBundle("MockDataWords", UI.getCurrent().getLocale() == Locale.US ? Locale.ROOT : UI.getCurrent().getLocale());

private AccessControl accessControl;

public LoginView() {
accessControl = AccessControlFactory.getInstance().createAccessControl();
buildUI();
}

private void buildUI() {
setSizeFull();
setClassName("login-screen");

// login form, centered in the available part of the screen
LoginForm loginForm = new LoginForm();
loginForm.setI18n(createLoginI18n());
loginForm.addLoginListener(this::login);
loginForm.addForgotPasswordListener(
event -> Notification.show(resourceBundle.getString("login_hint")));

// layout to center login form when there is sufficient screen space
FlexLayout centeringLayout = new FlexLayout();
centeringLayout.setSizeFull();
centeringLayout.setJustifyContentMode(JustifyContentMode.CENTER);
centeringLayout.setAlignItems(Alignment.CENTER);
centeringLayout.add(loginForm);

// information text about logging in
Component loginInformation = buildLoginInformation();

add(loginInformation);
add(centeringLayout);
}

private Component buildLoginInformation() {
VerticalLayout loginInformation = new VerticalLayout();
loginInformation.setClassName("login-information");

H1 loginInfoHeader = new H1(resourceBundle.getString("login_info"));
loginInfoHeader.setWidth("100%");
Span loginInfoText = new Span(resourceBundle.getString("login_info_text"));
loginInfoText.setWidth("100%");
loginInformation.add(loginInfoHeader);
loginInformation.add(loginInfoText);
loginInformation.add(
new LanguageSwitcher(Locale.ENGLISH,
new Locale("fa","IR", "فارسی")));

return loginInformation;
}

private void login(LoginForm.LoginEvent event) {
if (accessControl.signIn(event.getUsername(), event.getPassword())) {
getUI().get().navigate("/dashboard");
} else {
event.getSource().setError(true);
}
}

private LoginI18n createLoginI18n() {
final LoginI18n i18n = LoginI18n.createDefault();

i18n.setHeader(new LoginI18n.Header());
i18n.getForm().setUsername(resourceBundle.getString("username"));
i18n.getForm().setTitle(resourceBundle.getString("login"));
i18n.getForm().setSubmit(resourceBundle.getString("login"));
i18n.getForm().setPassword(resourceBundle.getString("password"));
i18n.getForm().setForgotPassword(resourceBundle.getString("forgot_pass"));
i18n.getErrorMessage().setTitle(resourceBundle.getString("login_error_title"));
i18n.getErrorMessage().setMessage(resourceBundle.getString("login_error_msg"));
return i18n;
}
private transient ResourceBundle resourceBundle = ResourceBundle.getBundle("MockDataWords",
UI.getCurrent().getLocale() == Locale.US ? Locale.ROOT : UI.getCurrent().getLocale());

private AccessControl accessControl;

public LoginView() {
accessControl = AccessControlFactory.getInstance().createAccessControl();
buildUI();
}

private void buildUI() {
setSizeFull();
setClassName("login-screen");

LoginForm loginForm = new LoginForm();
loginForm.setI18n(createLoginI18n());
loginForm.addLoginListener(this::login);
loginForm.addForgotPasswordListener(event -> Notification.show(resourceBundle.getString("login_hint")));

VerticalLayout loginInformation = new VerticalLayout();

loginInformation.setSizeFull();
loginInformation.setJustifyContentMode(JustifyContentMode.CENTER);
loginInformation.setAlignItems(Alignment.CENTER);

loginInformation.setClassName("login-information");
Image imgApmis = new Image("images/apmislogo.png", "APMIS-LOGO");
imgApmis.setClassName("apmis-login-logo");
loginInformation.add(imgApmis);
loginInformation.add(loginForm);
loginInformation.add(new LanguageSwitcher(Locale.ENGLISH, new Locale("fa", "IR", "فارسی")));

add(loginInformation);
}

private void login(LoginForm.LoginEvent event) {
if (accessControl.signIn(event.getUsername(), event.getPassword())) {
getUI().get().navigate("/dashboard");
} else {
event.getSource().setError(true);
}
}

private LoginI18n createLoginI18n() {
final LoginI18n i18n = LoginI18n.createDefault();

i18n.setHeader(new LoginI18n.Header());
i18n.getForm().setUsername(resourceBundle.getString("username"));
i18n.getForm().setTitle(resourceBundle.getString("login"));
i18n.getForm().setSubmit(resourceBundle.getString("login"));
i18n.getForm().setPassword(resourceBundle.getString("password"));
i18n.getForm().setForgotPassword(resourceBundle.getString("forgot_pass"));
i18n.getErrorMessage().setTitle(resourceBundle.getString("login_error_title"));
i18n.getErrorMessage().setMessage(resourceBundle.getString("login_error_msg"));
return i18n;
}
}




//
//import com.vaadin.flow.component.Html;
//import com.vaadin.flow.component.dependency.StyleSheet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.cinoteck.application.views.dashboard.DashboardView;
import com.cinoteck.application.views.logout.LogoutView;
import com.cinoteck.application.views.myaccount.MyAccountView;
import com.cinoteck.application.views.pivot.PivotTableView;
import com.cinoteck.application.views.pivot.PivotView;
import com.cinoteck.application.views.reports.ReportView;
import com.cinoteck.application.views.support.SupportView;
//import com.cinoteck.application.views.user.UserView;
Expand Down Expand Up @@ -127,12 +129,14 @@ private AppNav createNavigation() {
nav.addItem(new AppNavItem("Configuration", ConfigurationsView.class, VaadinIcon.COG_O, "navitem"));
nav.addItem(new AppNavItem("Users", UserView.class, VaadinIcon.USERS, "navitem"));
nav.addItem(new AppNavItem("Reports", ReportView.class,VaadinIcon.CHART_LINE, "navitem"));
nav.addItem(new AppNavItem("Pivot", PivotView.class, VaadinIcon.TREE_TABLE, "navitem"));
nav.addItem(new AppNavItem("Pivot", PivotTableView.class, VaadinIcon.TREE_TABLE, "navitem"));
nav.addItem(new AppNavItem("User Profile", MyAccountView.class, VaadinIcon.USER, "navitem"));
// nav.addItem(new AppNavItem("Language", VaadinIcon.USER, "navitem",myButton));
nav.addItem(new AppNavItem("Support", SupportView.class, VaadinIcon.INFO_CIRCLE_O, "navitem"));
nav.addItem(new AppNavItem("About", AboutView.class, VaadinIcon.CHAT, "navitem"));

// nav.addItem(new AppNavItem("Test", TestPageView.class, "la la-info-circle", "navitem"));
nav.addItem(new AppNavItem("Sign Out", LogoutView.class, VaadinIcon.SIGN_OUT_ALT, "navitem"));
if (nav != null) {
nav.addClassName("active");
Expand Down
Loading

0 comments on commit cfda0e5

Please sign in to comment.