Skip to content

Commit 1c987c8

Browse files
committed
#14: made some refactorings. Added signalr notifications.
1 parent 01b9808 commit 1c987c8

File tree

67 files changed

+3627
-305
lines changed

Some content is hidden

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

67 files changed

+3627
-305
lines changed

angular/.angular-cli.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
{
1+
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"project": {
44
"version": "1.0.0-beta.31",
5-
"name": "abp-project-name-template"
5+
"name": "abp-project-name-template"
66
},
77
"apps": [
88
{
99
"root": "src",
1010
"outDir": "dist",
1111
"assets": [
1212
"assets",
13-
"favicon.ico"
13+
"favicon.ico",
14+
{
15+
"glob": "abp.signalr.js",
16+
"input": "../node_modules/abp-web-resources/Abp/Framework/scripts/libs/",
17+
"output": "./assets/abp/"
18+
}
1419
],
1520
"index": "index.html",
1621
"main": "main.ts",
@@ -43,12 +48,12 @@
4348

4449
"../node_modules/signalr/jquery.signalR.js",
4550

46-
4751
"../node_modules/toastr/toastr.js",
4852
"../node_modules/sweetalert/dist/sweetalert-dev.js",
4953
"../node_modules/block-ui/jquery.blockUI.js",
5054
"../node_modules/spin.js/spin.min.js",
5155
"../node_modules/spin.js/jquery.spin.js",
56+
"../node_modules/push.js/push.min.js",
5257

5358
"../node_modules/abp-web-resources/Abp/Framework/scripts/abp.js",
5459
"../node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js",

angular/npm-shrinkwrap.json

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

angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"moment": "^2.15.1",
4646
"moment-timezone": "^0.5.7",
4747
"ng2-bootstrap": "^1.3.3",
48+
"push.js": "0.0.12",
4849
"rxjs": "^5.0.3",
4950
"signalr": "^2.2.1",
5051
"simple-line-icons": "^2.4.1",

angular/src/account/account.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ export class AccountComponent implements OnInit {
1818
currentYear: number = moment().year();
1919

2020
public constructor(
21-
private _loginService: LoginService,
22-
viewContainerRef: ViewContainerRef
21+
private _loginService: LoginService
2322
) {
24-
this.viewContainerRef = viewContainerRef; // We need this small hack in order to catch application root view container ref for modals
2523
}
2624

2725
showTenantChange(): boolean {

angular/src/account/account.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as ngCommon from '@angular/common';
1+
import { CommonModule } from '@angular/common';
22
import { NgModule, APP_INITIALIZER } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44
import { HttpModule, JsonpModule } from '@angular/http';
@@ -23,7 +23,7 @@ import { LoginService } from './login/login.service';
2323

2424
@NgModule({
2525
imports: [
26-
ngCommon.CommonModule,
26+
CommonModule,
2727
FormsModule,
2828
HttpModule,
2929
JsonpModule,

angular/src/account/login/login.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Router } from '@angular/router';
33
import { Http, Headers } from '@angular/http';
44
import { TokenAuthServiceProxy, AuthenticateModel, AuthenticateResultModel } from '@shared/service-proxies/service-proxies';
5-
import { AppComponentBase } from '@shared/common/app-component-base';
5+
import { AppComponentBase } from '@shared/app-component-base';
66
import { AppConsts } from '@shared/AppConsts';
77
import { LoginService, ExternalLoginProvider } from './login.service';
88
import { accountModuleAnimation } from '@shared/animations/routerTransition';

angular/src/account/login/login.service.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class LoginService {
9393

9494
if (authenticateResult.accessToken) {
9595
//Successfully logged in
96-
this.login(authenticateResult.accessToken, authenticateResult.expireInSeconds, this.rememberMe);
96+
this.login(authenticateResult.accessToken, authenticateResult.encryptedAccessToken, authenticateResult.expireInSeconds, this.rememberMe);
9797

9898
} else {
9999
//Unexpected result!
@@ -103,7 +103,7 @@ export class LoginService {
103103
}
104104
}
105105

106-
private login(accessToken: string, expireInSeconds: number, rememberMe?: boolean): void {
106+
private login(accessToken: string, encryptedAccessToken: string, expireInSeconds: number, rememberMe?: boolean): void {
107107

108108
var tokenExpireDate = rememberMe ? (new Date(new Date().getTime() + 1000 * expireInSeconds)) : undefined;
109109

@@ -112,11 +112,18 @@ export class LoginService {
112112
tokenExpireDate
113113
);
114114

115+
this._utilsService.setCookieValue(
116+
AppConsts.authorization.encrptedAuthTokenName,
117+
encryptedAccessToken,
118+
tokenExpireDate,
119+
abp.appPath
120+
);
121+
115122
var initialUrl = UrlHelper.initialUrl;
116123
if (initialUrl.indexOf('/login') > 0) {
117124
initialUrl = AppConsts.appBaseUrl;
118125
}
119-
126+
120127
location.href = initialUrl;
121128
}
122129

@@ -189,7 +196,7 @@ export class LoginService {
189196
return;
190197
}
191198

192-
this.login(result.accessToken, result.expireInSeconds);
199+
this.login(result.accessToken, result.encryptedAccessToken, result.expireInSeconds);
193200
});
194201
}
195202
}
@@ -207,7 +214,7 @@ export class LoginService {
207214
return;
208215
}
209216

210-
this.login(result.accessToken, result.expireInSeconds);
217+
this.login(result.accessToken, result.encryptedAccessToken, result.expireInSeconds);
211218
});
212219
}
213220
}

angular/src/account/register/register.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Injector, OnInit } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { AccountServiceProxy, RegisterInput } from '@shared/service-proxies/service-proxies'
4-
import { AppComponentBase } from '@shared/common/app-component-base';
4+
import { AppComponentBase } from '@shared/app-component-base';
55
import { LoginService } from '../login/login.service';
66
import { accountModuleAnimation } from '@shared/animations/routerTransition';
77

angular/src/account/tenant/tenant-change-modal.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ <h4 class="modal-title">
1616

1717
<div class="modal-body">
1818
<div class="form-group form-md-line-input form-md-floating-label no-hint">
19-
<input #tenancyNameInput type="text" name="TenancyName" class="form-control" [ngClass]="{'edited':tenancyName}" [(ngModel)]="tenancyName" maxlength="64">
20-
<label>{{l("TenancyName")}}</label>
19+
<label>{{l("TenancyName")}}</label>
20+
<input #tenancyNameInput type="text" name="TenancyName" class="form-control" [ngClass]="{'edited':tenancyName}" [(ngModel)]="tenancyName" maxlength="64">
2121
<span class="help-block">{{l("LeaveEmptyToSwitchToHost")}}</span>
2222
</div>
2323
</div>

angular/src/account/tenant/tenant-change-modal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit, ViewChild, Injector, ElementRef } from '@angular/core';
2-
import { AppComponentBase } from '@shared/common/app-component-base';
2+
import { AppComponentBase } from '@shared/app-component-base';
33
import { AccountServiceProxy } from '@shared/service-proxies/service-proxies';
44
import { IsTenantAvailableInput } from '@shared/service-proxies/service-proxies';
55
import { AppTenantAvailabilityState } from '@shared/AppEnums';

0 commit comments

Comments
 (0)