Fix build
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
Willem Dantuma 2022-01-31 21:38:23 +01:00
parent 2161951cbb
commit 37854d43fc

View File

@ -8,7 +8,7 @@ import { createSelector, createFeatureSelector, ActionReducerMap } from '@ngrx/s
import { MODULE_NAME } from '../module-name'; import { MODULE_NAME } from '../module-name';
import { IItem } from '../models/item'; import { IItem } from '../models/item';
import { userInfo } from 'os'; import {getValidPackages, isValidPackage} from '../services/package.service';
export interface State { export interface State {
openedModalName: string, openedModalName: string,
@ -58,13 +58,13 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
case appCommonActions.INITUSERSUCCESS: { case appCommonActions.INITUSERSUCCESS: {
let a = action as appCommonActions.InitUserSuccess; let a = action as appCommonActions.InitUserSuccess;
let claims = {} let claims = {}
Object.getOwnPropertyNames(a.userinfo.info).forEach((k) => { Object.getOwnPropertyNames(a.userinfo).forEach((k) => {
claims[k] = a.userinfo[k]; claims[k] = a.userinfo[k];
}); });
var user:IUser = { var user:IUser = {
code:a.user.code, code:a.user.code,
email:a.user?.name?a.user.name : claims["email"], email:a.userinfo["email"],
name:a.user?.email?a.user.email : claims["name"], name:a.userinfo["name"],
claims:claims, claims:claims,
searchable: false searchable: false
}; };
@ -132,7 +132,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
a.items.forEach((item) => { a.items.forEach((item) => {
item.data.dataDate = item.dataDate; item.data.dataDate = item.dataDate;
item.data.dataEndDate = item.dataEndDate; item.data.dataEndDate = item.dataEndDate;
packages[item.data.id]=item.data; if (!packages[item.data.id]) {
packages[item.data.id] = [];
}
packages[item.data.id].push(item.data);
}); });
return tassign(state,{userPackages:packages}); return tassign(state,{userPackages:packages});
@ -204,6 +207,9 @@ export const selectGetRouteLoading = createSelector(selectAppCommonState, getRou
export const SelectGetMenuVisible = createSelector(selectAppCommonState,getMenuVisible); export const SelectGetMenuVisible = createSelector(selectAppCommonState,getMenuVisible);
export const SelectGetUser = createSelector(selectAppCommonState,getUser); export const SelectGetUser = createSelector(selectAppCommonState,getUser);
export const SelectGetUserPackages = createSelector(selectAppCommonState,getUserPackages); export const SelectGetUserPackages = createSelector(selectAppCommonState,getUserPackages);
export const SelectGetValidUserPackages = createSelector(SelectGetUserPackages, (packageMap) => {
return getValidPackages(packageMap);
});
export const SelectGetUserSettingsRoot = createSelector(selectAppCommonState,getUserSettingsRoot); export const SelectGetUserSettingsRoot = createSelector(selectAppCommonState,getUserSettingsRoot);
export const SelectGetAccountMenuVisible = createSelector(selectAppCommonState,getAccountMenuVisible); export const SelectGetAccountMenuVisible = createSelector(selectAppCommonState,getAccountMenuVisible);
export const SelectGetAppMenuVisible = createSelector(selectAppCommonState,getAppMenuVisible); export const SelectGetAppMenuVisible = createSelector(selectAppCommonState,getAppMenuVisible);
@ -214,3 +220,4 @@ export const SelectgetUnreadNotifications = createSelector(selectAppCommonState,
export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline); export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline);
export const SelectGetIsPageMode = createSelector(selectAppCommonState,getIsPageMode); export const SelectGetIsPageMode = createSelector(selectAppCommonState,getIsPageMode);