summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-03-31 12:40:19 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-31 12:40:19 +0000
commit6ec75490615fc3238926531b1fe555ee0adb9b27 (patch)
tree6c7ff74b6683e14b9f08e6d582c49388f7b0f0b0 /sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts
parentd693378eaecbe21675c89688ef89353949254350 (diff)
parent62e834802dae0bd15504785503060d7875c7b4ad (diff)
Merge "Add SDN-R odlux performance"
Diffstat (limited to 'sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts')
-rw-r--r--sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts
new file mode 100644
index 000000000..2fd0ac8f1
--- /dev/null
+++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts
@@ -0,0 +1,43 @@
+import { IActionHandler } from '../../../../framework/src/flux/action';
+
+import {
+ AllAvailableLtpsLoadedAction,
+ LoadAllAvailableLtpsAction,
+} from '../actions/ltpAction';
+
+import { Ltp } from '../models/availableLtps';
+
+export interface IAvailableLtpsState {
+ distinctLtps: Ltp[];
+ busy: boolean;
+}
+
+const connectedNetworkElementsStateInit: IAvailableLtpsState = {
+ distinctLtps: [],
+ busy: false
+};
+
+export const availableLtpsActionHandler: IActionHandler<IAvailableLtpsState> = (state = connectedNetworkElementsStateInit, action) => {
+ if (action instanceof LoadAllAvailableLtpsAction) {
+
+ state = {
+ ...state,
+ busy: true
+ };
+
+ } else if (action instanceof AllAvailableLtpsLoadedAction) {
+ if (!action.error && action.availableLtps) {
+ state = {
+ ...state,
+ distinctLtps: action.availableLtps,
+ busy: false
+ };
+ } else {
+ state = {
+ ...state,
+ busy: false
+ };
+ }
+ }
+ return state;
+}; \ No newline at end of file
.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#
# ============LICENSE_START=======================================================
# ONAP : ccsdk features
# ================================================================================
# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============LICENSE_END=======================================================
#
#

# Properties filled in by maven during build process
version = ${project.version}
build = ${buildtime}