From 24f4438871e061bc78053cd25951016a15e9c869 Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Thu, 4 Oct 2018 14:56:12 +0200 Subject: [PATCH] fixed reducer issue --- VERSION | 2 +- client/Makefile | 3 +++ client/components/routeservers/reducer.jsx | 31 ++++++---------------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/VERSION b/VERSION index 4a36342..cb2b00e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 +3.0.1 diff --git a/client/Makefile b/client/Makefile index aebed7a..415e5f5 100644 --- a/client/Makefile +++ b/client/Makefile @@ -45,6 +45,9 @@ $(DIST_BUILD): deps client_prod @echo "Done. Don't forget to push the dist to github" +clean: + rm -rf build/ + dist: $(DIST_BUILD) echo $(DIST_BUILD) diff --git a/client/components/routeservers/reducer.jsx b/client/components/routeservers/reducer.jsx index 4238cd1..7898997 100644 --- a/client/components/routeservers/reducer.jsx +++ b/client/components/routeservers/reducer.jsx @@ -22,12 +22,7 @@ const initialState = { statusErrors: {}, rejectReasons: {}, - rejectId: 0, - rejectAsn: 0, - noexportReasons: {}, - noexportId: 0, - noexportAsn: 0, rejectCandidates: { communities: {} @@ -42,27 +37,17 @@ const initialState = { // == Handlers == const _importConfig = function(state, payload) { // Get reject and filter reasons from config - const rejectReasons = payload.reject_reasons; - const rejectId = payload.rejection.reject_id; - const rejectAsn = payload.rejection.asn; - + const rejectReasons = payload.reject_reasons; const noexportReasons = payload.noexport_reasons; - const noexportId = payload.noexport.noexport_id; - const noexportAsn = payload.noexport.asn; // Get reject candidates from config const rejectCandidates = payload.reject_candidates; return Object.assign({}, state, { - rejectReasons: rejectReasons, - rejectAsn: rejectAsn, - rejectId: rejectId, + rejectReasons: rejectReasons, + rejectCandidates: rejectCandidates, - rejectCandidates: rejectCandidates, - - noexportReasons: noexportReasons, - noexportAsn: noexportAsn, - noexportId: noexportId, + noexportReasons: noexportReasons }); }; @@ -77,7 +62,7 @@ const _updateStatus = function(state, payload) { return Object.assign({}, state, { details: details, - statusErrors: errors + statusErrors: errors }); } @@ -90,18 +75,18 @@ const _updateStatusError = function(state, payload) { }; if (payload.error && - payload.error.response && + payload.error.response && payload.error.response.data && payload.error.response.data.code) { info = payload.error.response.data; } - + var errors = Object.assign({}, state.statusErrors, { [payload.routeserverId]: info }); return Object.assign({}, state, { - statusErrors: errors + statusErrors: errors }); }