You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/10/19 10:02:13 UTC

[GitHub] garrensmith commented on a change in pull request #1144: [partitioned-dbs] Updates to doc editor

garrensmith commented on a change in pull request #1144: [partitioned-dbs] Updates to doc editor
URL: https://github.com/apache/couchdb-fauxton/pull/1144#discussion_r226593463
 
 

 ##########
 File path: app/addons/databases/reducers.js
 ##########
 @@ -12,15 +12,40 @@
 
 import ActionTypes from './actiontypes';
 const initialState = {
-  partitionedDatabasesAvailable: false
+  partitionedDatabasesAvailable: false,
+  isLoadingDbInfo: false,
+  dbInfo: undefined,
+  isDbPartitioned: false
 };
+
+export function isPartitioned(dbInfo) {
+  if (dbInfo && dbInfo.props && dbInfo.props.partitioned === true) {
+    return true;
+  }
+  return false;
+}
+
 export default function databases(state = initialState, action) {
   switch (action.type) {
     case ActionTypes.DATABASES_PARTITIONED_DB_AVAILABLE:
       return {
         ...state,
         partitionedDatabasesAvailable: action.options.available
       };
+    case ActionTypes.DATABASES_FETCH_SELECTED_DB_METADATA:
+      return {
+        ...state,
+        isLoadingDbInfo: true,
+        dbInfo: undefined,
+        isDbPartitioned: false
+      };
+    case ActionTypes.DATABASES_FETCH_SELECTED_DB_METADATA_SUCCESS:
+      return {
+        ...state,
+        isLoadingDbInfo: false,
+        dbInfo: action.info,
+        isDbPartitioned: isPartitioned(action.info)
 
 Review comment:
   we normally use `option` instead of `info`. I think we should stick to `option`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services