Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Moved Dashboad webapp on Angular 5 !
[src/xds/xds-agent.git]
/
webapp
/
src
/
app
/
services
/
config.service.ts
diff --git
a/webapp/src/app/services/config.service.ts
b/webapp/src/app/services/config.service.ts
index
bbe2fb8
..
ffe2b45
100644
(file)
--- a/
webapp/src/app/services/config.service.ts
+++ b/
webapp/src/app/services/config.service.ts
@@
-3,10
+3,11
@@
import { CookieService } from 'ngx-cookie';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
-import { AlertService, IAlert } from
"../services/alert.service"
;
-import { UtilsService } from
"../services/utils.service"
;
+import { AlertService, IAlert } from
'../services/alert.service'
;
+import { UtilsService } from
'../services/utils.service'
;
export interface IConfig {
export interface IConfig {
+ language: string;
projectsRootDir: string;
}
projectsRootDir: string;
}
@@
-18,7
+19,7
@@
export class ConfigService {
private confSubject: BehaviorSubject<IConfig>;
private confStore: IConfig;
private confSubject: BehaviorSubject<IConfig>;
private confStore: IConfig;
- constructor(
private _window: Window,
+ constructor(
private cookie: CookieService,
private alert: AlertService,
private utils: UtilsService,
private cookie: CookieService,
private alert: AlertService,
private utils: UtilsService,
@@
-31,14
+32,15
@@
export class ConfigService {
// Load config
load() {
// Try to retrieve previous config from cookie
// Load config
load() {
// Try to retrieve previous config from cookie
-
let cookConf = this.cookie.getObject("xds-config"
);
+
const cookConf = this.cookie.getObject('xds-config'
);
if (cookConf != null) {
this.confStore = <IConfig>cookConf;
} else {
// Set default config
this.confStore = {
if (cookConf != null) {
this.confStore = <IConfig>cookConf;
} else {
// Set default config
this.confStore = {
- projectsRootDir: "",
- //projects: []
+ language: 'ENG',
+ projectsRootDir: '',
+ // projects: []
};
}
}
};
}
}
@@
-49,8
+51,8
@@
export class ConfigService {
this.confSubject.next(Object.assign({}, this.confStore));
// Don't save projects in cookies (too big!)
this.confSubject.next(Object.assign({}, this.confStore));
// Don't save projects in cookies (too big!)
-
le
t cfg = Object.assign({}, this.confStore);
- this.cookie.putObject(
"xds-config"
, cfg);
+
cons
t cfg = Object.assign({}, this.confStore);
+ this.cookie.putObject(
'xds-config'
, cfg);
}
set projectsRootDir(p: string) {
}
set projectsRootDir(p: string) {