aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/storeUtil
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/storeUtil')
-rw-r--r--vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts2
-rw-r--r--vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts10
-rw-r--r--vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts13
3 files changed, 24 insertions, 1 deletions
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts
index faf4aae4e..a8254b45d 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts
@@ -31,6 +31,7 @@ import {pnfReducer} from "./pnf/pnf.reducers";
export let initialState: ServiceState = {
serviceHierarchy: {},
+ serviceInfoModel: {},
serviceInstance: {},
lcpRegionsAndTenants: new LcpRegionsAndTenants(),
subscribers: null,
@@ -44,6 +45,7 @@ export let initialState: ServiceState = {
export interface ServiceState {
serviceHierarchy: any;
+ serviceInfoModel: any;
serviceInstance: { [uuid: string]: ServiceInstance; };
lcpRegionsAndTenants: LcpRegionsAndTenants;
subscribers: SelectOptionInterface[];
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
index 069ef82e8..20c6dbe85 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
@@ -12,6 +12,7 @@ export enum ServiceActions {
UNDO_DELETE_ACTION_SERVICE_INSTANCE = "UNDO_DELETE_ACTION_SERVICE_INSTANCE",
CHANGE_SERVICE_IS_DIRTY = "CHANGE_SERVICE_IS_DIRTY",
UPGRADE_SERVICE_ACTION = "UPGRADE_SERVICE_ACTION",
+ UPDATE_SERVICE_INFO_MODEL = "UPDATE_SERVICE_INFO_MODEL",
UNDO_UPGRADE_SERVICE_ACTION = "UNDO_UPGRADE_SERVICE_ACTION"
}
@@ -63,6 +64,10 @@ export interface ChangeServiceDirty extends Action {
serviceId : string;
}
+export interface UpdateServiceModelInfoAction extends Action {
+ serviceInfoModel?: any;
+}
+
export const addServiceAction: ActionCreator<AddServiceAction> = (serviceUuid : string, actionName : ServiceInstanceActions) => ({
type: ServiceActions.ADD_SERVICE_ACTION,
serviceUuid: serviceUuid,
@@ -117,3 +122,8 @@ export const undoUpgradeService: ActionCreator<UndoUpgradeServiceAction> = (serv
type: ServiceActions.UNDO_UPGRADE_SERVICE_ACTION,
serviceUuid
});
+
+export const updateServiceInfoModel : ActionCreator<UpdateServiceModelInfoAction> = (serviceInfoModel : any) => ({
+ type: ServiceActions.UPDATE_SERVICE_INFO_MODEL,
+ serviceInfoModel
+});
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts
index 811238385..771dc23c2 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts
@@ -7,12 +7,14 @@ import {
UndoUpgradeServiceAction,
UpdateServiceInstanceAction,
UpdateServiceModelAction,
- UpgradeServiceAction
+ UpgradeServiceAction,
+ UpdateServiceModelInfoAction
} from "./service.actions";
import {ServiceInstance} from "../../../models/serviceInstance";
import {ServiceState} from "../main.reducer";
import {ServiceInstanceActions} from "../../../models/serviceInstanceActions";
import * as _ from "lodash";
+import {ServiceInfoModel} from "../../../server/serviceInfo/serviceInfo.model";
export function serviceReducer(state: ServiceState, action: Action) : ServiceState{
@@ -98,6 +100,15 @@ export function serviceReducer(state: ServiceState, action: Action) : ServiceSta
return undoUpgradeServiceInstance(clonedState, uuid);
}
}
+
+ case ServiceActions.UPDATE_SERVICE_INFO_MODEL: {
+ const updateServiceInfoModel = <UpdateServiceModelInfoAction>action;
+ let newState = _.cloneDeep(state);
+ const serviceInfoModel : ServiceInfoModel = new ServiceInfoModel();
+ const currentServiceInfoModel = state.serviceInfoModel ? serviceInfoModel : null;
+ newState.serviceInfoModel = Object.assign(serviceInfoModel, updateServiceInfoModel.serviceInfoModel);
+ return newState
+ }
}
}