AW-1419
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			This commit is contained in:
		| @@ -74,6 +74,12 @@ export class InitUserSuccess implements Action { | |||||||
|   constructor(public user:IUser,public userinfo:UserInfo ) { } |   constructor(public user:IUser,public userinfo:UserInfo ) { } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | export class InitUserPackages implements Action { | ||||||
|  |   readonly type = INITUSERPACKAGES; | ||||||
|  |  | ||||||
|  |   constructor() {} | ||||||
|  | } | ||||||
|  |  | ||||||
| export class InitUserPackagesSuccess implements Action { | export class InitUserPackagesSuccess implements Action { | ||||||
|   readonly type = INITUSERPACKAGESSUCCESS; |   readonly type = INITUSERPACKAGESSUCCESS; | ||||||
|  |  | ||||||
| @@ -301,6 +307,7 @@ export type Actions = OpenModal | |||||||
|   | DeviceUpdateEvent |   | DeviceUpdateEvent | ||||||
|   | ToggleMenu |   | ToggleMenu | ||||||
|   | SetMenuVisible |   | SetMenuVisible | ||||||
|  |   | InitUserPackages | ||||||
|   | InitUserPackagesSuccess |   | InitUserPackagesSuccess | ||||||
|   | ToggleAccountMenu |   | ToggleAccountMenu | ||||||
|   | CloseAll |   | CloseAll | ||||||
|   | |||||||
| @@ -58,23 +58,36 @@ export class AppCommonEffects { | |||||||
|     } |     } | ||||||
|   )); |   )); | ||||||
|      |      | ||||||
|  |  | ||||||
|   @Effect() |   @Effect() | ||||||
|   initUserPackages$:Observable<Action> = this.actions$.pipe( |   initUserPackages$:Observable<Action> = this.actions$.pipe( | ||||||
|     ofType(appCommonActions.INITUSERSUCCESS), |     ofType(appCommonActions.INITUSERPACKAGES), | ||||||
|     switchMap((action) => { |     withLatestFrom(this.store$.select(appCommonReducers.SelectGetUser)), | ||||||
|       let a = action as appCommonActions.InitUserSuccess; |     switchMap(([action,user]) => { | ||||||
|       return this.itemService$.getChildItemList(a.user.code+":USER_PACKAGES","vnd.farmmaps.itemtype.package").pipe( |       return this.itemService$.getChildItemList(user.code+":USER_PACKAGES","vnd.farmmaps.itemtype.package").pipe( | ||||||
|         switchMap((items) => of(new appCommonActions.InitUserPackagesSuccess(items))), |         switchMap((items) => of(new appCommonActions.InitUserPackagesSuccess(items))), | ||||||
|         catchError(error =>  of(new appCommonActions.Fail(error))) |         catchError(error =>  of(new appCommonActions.Fail(error))) | ||||||
|       ) |       ) | ||||||
|     }) |     }) | ||||||
|   ); |   ); | ||||||
|  |  | ||||||
|  |   @Effect() | ||||||
|  |   userPackagesChanged$:Observable<Action> = this.actions$.pipe( | ||||||
|  |     ofType(appCommonActions.ITEMCHANGEDEVENT), | ||||||
|  |     switchMap((action) => { | ||||||
|  |       let a = action as appCommonActions.ItemChangedEvent; | ||||||
|  |       if(a.itemCode.endsWith(":USER_PACKAGES"))  | ||||||
|  |         return of(new appCommonActions.InitUserPackages()); | ||||||
|  |       else | ||||||
|  |         return of(undefined); | ||||||
|  |     }) | ||||||
|  |   ); | ||||||
|  |  | ||||||
|   @Effect() |   @Effect() | ||||||
|   initUserSuccess$: Observable<Action> = this.actions$.pipe( |   initUserSuccess$: Observable<Action> = this.actions$.pipe( | ||||||
|     ofType(appCommonActions.INITUSERSUCCESS), |     ofType(appCommonActions.INITUSERSUCCESS), | ||||||
|     switchMap(() => { |     switchMap(() => { | ||||||
|       return of(new appCommonActions.InitRoot()); |       return [new appCommonActions.InitRoot(),new appCommonActions.InitUserPackages()]; | ||||||
|     } |     } | ||||||
|     )); |     )); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user