Merge branch 'develop' into feature/vectortileselect
# Conflicts: # package-lock.json # package.json
This commit is contained in:
@@ -16,7 +16,11 @@ export class HasPackageDirective implements OnInit,OnDestroy{
|
||||
private packSub:Subscription;
|
||||
ngOnInit() {
|
||||
this.packages$.subscribe((packages) => {
|
||||
if (packages[this.package] && packages[this.package].enabled) {
|
||||
const today = new Date(new Date(Date.now()).toUTCString()).setHours(0,0,0,0);
|
||||
if (packages[this.package] &&
|
||||
packages[this.package].enabled &&
|
||||
(packages[this.package].dataDate && new Date(packages[this.package].dataDate).setHours(0, 0, 0, 0) <= today) &&
|
||||
(packages[this.package].dataEndDate == null || new Date(packages[this.package].dataEndDate).setHours(0, 0, 0, 0) >= today)) {
|
||||
this.viewContainerRef$.createEmbeddedView(this.templateRef$);
|
||||
this.hasView=true;
|
||||
} else if (this.hasView) {
|
||||
|
@@ -2,6 +2,8 @@ export interface IPackage {
|
||||
id:string
|
||||
name:string;
|
||||
enabled?:boolean;
|
||||
dataDate?:Date;
|
||||
dataEndDate?:Date;
|
||||
}
|
||||
|
||||
export interface IPackages {
|
||||
|
@@ -116,7 +116,9 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
||||
let a = action as appCommonActions.InitUserPackagesSuccess;
|
||||
let packages = {}
|
||||
a.items.forEach((item) => {
|
||||
packages[item.data.id]=item.data;
|
||||
item.data.dataDate = item.dataDate;
|
||||
item.data.dataEndDate = item.dataEndDate;
|
||||
packages[item.data.id]=item.data;
|
||||
});
|
||||
|
||||
return tassign(state,{userPackages:packages});
|
||||
|
Reference in New Issue
Block a user