bug fixed

This commit is contained in:
richard-loafle 2020-04-03 16:44:28 +09:00
parent cc973df61b
commit 638f41d26f
9 changed files with 29 additions and 91 deletions

6
package-lock.json generated
View File

@ -1926,9 +1926,9 @@
"integrity": "sha512-JnILmpoqUc8zQKZqbucBJ2H68y3Oy7HB4h/Ax6bq4Ctqxk6qaA2/Eda65WTS8L4EresYdVGW07AR4Z0p0XLIzg=="
},
"@ucap/ng-store-authentication": {
"version": "0.0.6",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.6.tgz",
"integrity": "sha512-qP3+rsni/z/JOTR/VPjH+09buvHphJc4IHMSS+HlAFvJPeLcWXWChANzpUG3tWNxEbrh8GhaOlzYkGyqBJTVLA=="
"version": "0.0.7",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/ng-store-authentication/-/ng-store-authentication-0.0.7.tgz",
"integrity": "sha512-6IxxjFYpmN3xC2zIix9BfXbHHKpZeeS09SlT7RujMGt58CPyLnWkCFa/a4NILYQpUaXwQn+CmB1o8nhaZvwMNw=="
},
"@ucap/ng-store-chat": {
"version": "0.0.4",

View File

@ -68,7 +68,7 @@
"@ucap/ng-protocol-status": "~0.0.2",
"@ucap/ng-protocol-sync": "~0.0.2",
"@ucap/ng-protocol-umg": "~0.0.2",
"@ucap/ng-store-authentication": "~0.0.6",
"@ucap/ng-store-authentication": "~0.0.7",
"@ucap/ng-store-chat": "~0.0.4",
"@ucap/ng-store-group": "~0.0.5",
"@ucap/ng-store-organization": "~0.0.3",

View File

@ -25,7 +25,10 @@ import { QueryProtocolService } from '@ucap/ng-protocol-query';
import { OptionProtocolService } from '@ucap/ng-protocol-option';
import { CompanyActions } from '@ucap/ng-store-organization';
import { LoginActions } from '@ucap/ng-store-authentication';
import {
ConfigurationActions,
LoginActions
} from '@ucap/ng-store-authentication';
import { LoginSession } from '@app/models/login-session';
import { AppKey } from '@app/types/app-key.type';
@ -100,7 +103,7 @@ export class AppAuthenticationResolver implements Resolve<void> {
) {
if (StatusCode.Fail === versionInfo2Res.statusCode) {
this.store.dispatch(
AppActions.versionInfo2Failure({
ConfigurationActions.versionInfo2Failure({
error: versionInfo2Res.errorMessage
})
);
@ -110,7 +113,7 @@ export class AppAuthenticationResolver implements Resolve<void> {
if (StatusCode.Fail === urlInfoRes.statusCode) {
this.store.dispatch(
AppActions.urlInfoFailure({
ConfigurationActions.urlInfoFailure({
error: urlInfoRes.errorMessage
})
);
@ -122,13 +125,13 @@ export class AppAuthenticationResolver implements Resolve<void> {
}
this.store.dispatch(
AppActions.versionInfo2Success({
ConfigurationActions.versionInfo2Success({
res: versionInfo2Res
})
);
this.store.dispatch(
AppActions.urlInfoSuccess({
ConfigurationActions.urlInfoSuccess({
res: urlInfoRes
})
);

View File

@ -1,34 +1,3 @@
import { createAction, props } from '@ngrx/store';
import { VersionInfo2Response, VersionInfo2Request } from '@ucap/api-public';
import { UrlInfoRequest, UrlInfoResponse } from '@ucap/api-external';
export const versionInfo2 = createAction(
'[ucap::app::app] versionInfo2',
props<{ req: VersionInfo2Request }>()
);
export const versionInfo2Success = createAction(
'[ucap::app::app] versionInfo2 Success',
props<{ res: VersionInfo2Response }>()
);
export const versionInfo2Failure = createAction(
'[ucap::app::app] versionInfo2 Failure',
props<{ error: any }>()
);
export const urlInfo = createAction(
'[ucap::app::app] urlInfo',
props<{ req: UrlInfoRequest }>()
);
export const urlInfoSuccess = createAction(
'[ucap::app::app] urlInfo Success',
props<{ res: UrlInfoResponse }>()
);
export const urlInfoFailure = createAction(
'[ucap::app::app] urlInfo Failure',
props<{ error: any }>()
);
export const init = createAction('[ucap::LG::app] init');

View File

@ -1,25 +1,4 @@
import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { versionInfo2Success, urlInfoSuccess } from './actions';
export const reducer = createReducer(
initialState,
on(versionInfo2Success, (state, action) => {
return {
...state,
versionInfo2Response: {
...state.versionInfo2Response,
...action.res
}
};
}),
on(urlInfoSuccess, (state, action) => {
return {
...state,
urlInfoResponse: {
...state.urlInfoResponse,
...action.res
}
};
})
);
export const reducer = createReducer(initialState);

View File

@ -1,27 +1,9 @@
import { Selector, createSelector } from '@ngrx/store';
import { VersionInfo2Response } from '@ucap/api-public';
import { UrlInfoResponse } from '@ucap/api-external';
export interface State {}
export interface State {
versionInfo2Response: VersionInfo2Response | null;
urlInfoResponse: UrlInfoResponse | null;
}
export const initialState: State = {
versionInfo2Response: null,
urlInfoResponse: null
};
export const initialState: State = {};
export function selectors<S>(selector: Selector<any, State>) {
return {
versionInfo2Response: createSelector(
selector,
(state: State) => state.versionInfo2Response
),
urlInfoResponse: createSelector(
selector,
(state: State) => state.urlInfoResponse
)
};
return {};
}

View File

@ -1,5 +1,6 @@
import { Type } from '@angular/core';
import { Effects as AuthenticationEffects } from './authentication/effects';
import { Effects as AppEffects } from './app/effects';
import { Effects as AppAuthenticationEffects } from './authentication/effects';
export const effects: Type<any>[] = [AuthenticationEffects];
export const effects: Type<any>[] = [AppEffects, AppAuthenticationEffects];

View File

@ -1,17 +1,19 @@
import { InjectionToken } from '@angular/core';
import { combineReducers, Action, ActionReducerMap } from '@ngrx/store';
import { Action, ActionReducerMap } from '@ngrx/store';
import * as fromRouter from '@ngrx/router-store';
import { State } from './state';
import { reducer as authenticationReducer } from './authentication/reducers';
import { reducer as appReducer } from './app/reducers';
import { reducer as appAuthenticationReducer } from './authentication/reducers';
export const ROOT_REDUCERS = new InjectionToken<
ActionReducerMap<State, Action>
>('Root reducers token', {
factory: () => ({
appRouter: fromRouter.routerReducer,
appAuthentication: authenticationReducer
app: appReducer,
appAuthentication: appAuthenticationReducer
})
});

View File

@ -8,11 +8,13 @@ import * as fromRouter from '@ngrx/router-store';
import { environment } from '@environments';
import { State as AuthenticationState } from './authentication/state';
import { State as AppState } from './app/state';
import { State as AppAuthenticationState } from './authentication/state';
export interface State {
appRouter: fromRouter.RouterReducerState<any>;
appAuthentication: AuthenticationState;
app: AppState;
appAuthentication: AppAuthenticationState;
}
export const metaReducers: MetaReducer<State>[] = !environment.production