Skip to content

Commit 7d44d6f

Browse files
Merge branch 'pr/382'
2 parents 122af7b + 83b46fa commit 7d44d6f

File tree

58 files changed

+2548
-1791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2548
-1791
lines changed

angular/.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:4200",
12+
"sourceMaps": true,
13+
"webRoot": "${workspaceFolder}"
14+
}
15+
]
16+
}

angular/angular.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
}
3232
],
3333
"styles": [
34+
"node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
3435
"src/assets/fonts/roboto/roboto.css",
3536
"node_modules/bootstrap/dist/css/bootstrap.min.css",
3637
"node_modules/simple-line-icons/css/simple-line-icons.css",

angular/package-lock.json

Lines changed: 45 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular/animations": "^7.1.3",
16+
"@angular/animations": "^7.1.4",
17+
"@angular/cdk": "^7.2.0",
1718
"@angular/common": "^7.1.3",
1819
"@angular/compiler": "^7.1.3",
1920
"@angular/core": "^7.1.3",
2021
"@angular/forms": "^7.1.3",
2122
"@angular/http": "^7.1.3",
23+
"@angular/material": "^7.2.0",
2224
"@angular/platform-browser": "^7.1.3",
2325
"@angular/platform-browser-dynamic": "^7.1.3",
2426
"@angular/router": "^7.1.3",
@@ -42,6 +44,7 @@
4244
"famfamfam-flags": "^1.0.0",
4345
"flot": "^0.8.0-alpha",
4446
"font-awesome": "^4.7.0",
47+
"hammerjs": "^2.0.8",
4548
"jquery": "^3.1.1",
4649
"jquery-countto": "^1.2.0",
4750
"jquery-migrate": "^3.0.0",

angular/src/account/account.module.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ import { ServiceProxyModule } from '@shared/service-proxies/service-proxy.module
1515
import { SharedModule } from '@shared/shared.module';
1616

1717
import { AccountComponent } from './account.component';
18-
import { TenantChangeComponent } from './tenant/tenant-change.component';
19-
import { TenantChangeModalComponent } from './tenant/tenant-change-modal.component';
2018
import { LoginComponent } from './login/login.component';
2119
import { RegisterComponent } from './register/register.component';
2220
import { AccountLanguagesComponent } from './layout/account-languages.component';
2321

2422
import { LoginService } from './login/login.service';
2523

24+
// tenants
25+
import { TenantChangeComponent } from './tenant/tenant-change.component';
26+
import { TenantChangeDialogComponent } from './tenant/tenant-change-dialog.component';
27+
2628
@NgModule({
2729
imports: [
2830
CommonModule,
@@ -37,14 +39,19 @@ import { LoginService } from './login/login.service';
3739
],
3840
declarations: [
3941
AccountComponent,
40-
TenantChangeComponent,
41-
TenantChangeModalComponent,
4242
LoginComponent,
4343
RegisterComponent,
44-
AccountLanguagesComponent
44+
AccountLanguagesComponent,
45+
// tenant
46+
TenantChangeComponent,
47+
TenantChangeDialogComponent,
4548
],
4649
providers: [
4750
LoginService
51+
],
52+
entryComponents: [
53+
// tenant
54+
TenantChangeDialogComponent
4855
]
4956
})
5057
export class AccountModule {
Lines changed: 74 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,77 @@
1-
<div class="card" id="LoginArea" [@routerTransition]>
2-
<div #cardBody class="body">
3-
<form #loginForm="ngForm" id="LoginForm" method="post" novalidate (ngSubmit)="login()">
4-
<h4 class="text-center">{{ "LogIn" | localize }}</h4>
5-
6-
<div class="input-group">
7-
<span class="input-group-addon">
8-
<i class="material-icons">person</i>
9-
</span>
10-
<div class="form-line">
11-
<input materialInput [(ngModel)]="loginService.authenticateModel.userNameOrEmailAddress" autoFocus class="form-control" type="text" autocomplete="off" placeholder="{{ 'UserNameOrEmail' | localize }}" name="userNameOrEmailAddress" required maxlength="255" />
12-
</div>
1+
<div class="card" [@routerTransition]>
2+
<div class="body">
3+
<form
4+
novalidate
5+
autocomplete="off"
6+
#loginForm="ngForm"
7+
(ngSubmit)="login()"
8+
>
9+
<h4 class="text-center">{{ "LogIn" | localize }}</h4>
10+
<div class="row clearfix">
11+
<div class="col-xs-12">
12+
<div class="input-group">
13+
<span class="input-group-addon">
14+
<i class="material-icons">person</i>
15+
</span>
16+
<div>
17+
<mat-form-field>
18+
<input
19+
matInput
20+
name="userNameOrEmailAddress"
21+
[(ngModel)]="
22+
loginService.authenticateModel.userNameOrEmailAddress
23+
"
24+
[placeholder]="'UserNameOrEmail' | localize"
25+
autocomplete="off"
26+
required
27+
maxlength="255"
28+
/>
29+
</mat-form-field>
1330
</div>
14-
15-
<div class="input-group">
16-
<span class="input-group-addon">
17-
<i class="material-icons">lock</i>
18-
</span>
19-
<div class="form-line">
20-
<input materialInput type="password" [(ngModel)]="loginService.authenticateModel.password" class="form-control" name="password" placeholder="{{ 'Password' | localize }}" required maxlength="32">
21-
</div>
31+
</div>
32+
<div class="input-group">
33+
<span class="input-group-addon">
34+
<i class="material-icons">lock</i>
35+
</span>
36+
<div>
37+
<mat-form-field>
38+
<input
39+
matInput
40+
type="password"
41+
name="password"
42+
[(ngModel)]="loginService.authenticateModel.password"
43+
[placeholder]="'Password' | localize"
44+
required
45+
maxlength="32"
46+
/>
47+
</mat-form-field>
2248
</div>
23-
<div class="row">
24-
<div class="col-xs-8 p-t-5">
25-
<input type="checkbox" [(ngModel)]="loginService.rememberMe" name="rememberMe" id="rememberme" class="filled-in chk-col-pink" value="true">
26-
<label for="rememberme">{{ "RememberMe" | localize }}</label>
27-
</div>
28-
<div class="col-xs-4">
29-
<button id="LoginButton" class="btn btn-block bg-pink waves-effect" type="submit">{{ "LogIn" | localize }}</button>
30-
</div>
31-
</div>
32-
33-
<div class="row m-t-15 m-b--20" *ngIf="isSelfRegistrationAllowed">
34-
<div class="col-xs-12">
35-
<a [routerLink]="['../register']">{{ "Register" | localize }}</a>
36-
</div>
37-
</div>
38-
</form>
39-
</div>
49+
</div>
50+
</div>
51+
</div>
52+
<div class="row">
53+
<div class="col-xs-8 p-t-5">
54+
<mat-checkbox name="rememberMe" [(ngModel)]="loginService.rememberMe">
55+
{{ "RememberMe" | localize }}
56+
</mat-checkbox>
57+
</div>
58+
<div class="col-xs-4">
59+
<button
60+
mat-flat-button
61+
type="submit"
62+
flex="15"
63+
color="accent"
64+
[disabled]="!loginForm.form.valid || submitting"
65+
>
66+
{{ "LogIn" | localize }}
67+
</button>
68+
</div>
69+
</div>
70+
<div class="row m-t-15 m-b--20" *ngIf="isSelfRegistrationAllowed">
71+
<div class="col-xs-12">
72+
<a [routerLink]="['../register']">{{ "Register" | localize }}</a>
73+
</div>
74+
</div>
75+
</form>
76+
</div>
4077
</div>

angular/src/account/login/login.component.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@
1010
}
1111
}
1212
}
13+
14+
mat-form-field {
15+
width: 100%;
16+
}
17+
mat-checkbox {
18+
padding-bottom: 5px;
19+
}
Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,39 @@
1-
import { Component, Injector, ElementRef, ViewChild } from '@angular/core';
2-
import { Router } from '@angular/router';
1+
import { Component, Injector } from '@angular/core';
2+
import { AbpSessionService } from '@abp/session/abp-session.service';
33
import { AppComponentBase } from '@shared/app-component-base';
4-
import { LoginService } from './login.service';
54
import { accountModuleAnimation } from '@shared/animations/routerTransition';
6-
import { AbpSessionService } from '@abp/session/abp-session.service';
5+
import { LoginService } from './login.service';
76

87
@Component({
9-
templateUrl: './login.component.html',
10-
styleUrls: [
11-
'./login.component.less'
12-
],
13-
animations: [accountModuleAnimation()]
8+
templateUrl: './login.component.html',
9+
styleUrls: ['./login.component.less'],
10+
animations: [accountModuleAnimation()]
1411
})
1512
export class LoginComponent extends AppComponentBase {
16-
17-
@ViewChild('cardBody') cardBody: ElementRef;
18-
19-
submitting: boolean = false;
20-
21-
constructor(
22-
injector: Injector,
23-
public loginService: LoginService,
24-
private _router: Router,
25-
private _sessionService: AbpSessionService
26-
) {
27-
super(injector);
13+
submitting: boolean = false;
14+
15+
constructor(
16+
injector: Injector,
17+
private loginService: LoginService,
18+
private _sessionService: AbpSessionService
19+
) {
20+
super(injector);
21+
}
22+
23+
get multiTenancySideIsTeanant(): boolean {
24+
return this._sessionService.tenantId > 0;
25+
}
26+
27+
get isSelfRegistrationAllowed(): boolean {
28+
if (!this._sessionService.tenantId) {
29+
return false;
2830
}
2931

30-
ngAfterViewInit(): void {
31-
$(this.cardBody.nativeElement).find('input:first').focus();
32-
}
33-
34-
get multiTenancySideIsTeanant(): boolean {
35-
return this._sessionService.tenantId > 0;
36-
}
37-
38-
get isSelfRegistrationAllowed(): boolean {
39-
if (!this._sessionService.tenantId) {
40-
return false;
41-
}
32+
return true;
33+
}
4234

43-
return true;
44-
}
45-
46-
login(): void {
47-
this.submitting = true;
48-
this.loginService.authenticate(
49-
() => this.submitting = false
50-
);
51-
}
35+
login(): void {
36+
this.submitting = true;
37+
this.loginService.authenticate(() => (this.submitting = false));
38+
}
5239
}

0 commit comments

Comments
 (0)