reducerIndex.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. import charts from 'src/components/Chart/chartReducer';
  20. import dataMask from 'src/dataMask/reducer';
  21. import dashboardInfo from 'src/dashboard/reducers/dashboardInfo';
  22. import dashboardState from 'src/dashboard/reducers/dashboardState';
  23. import dashboardFilters from 'src/dashboard/reducers/dashboardFilters';
  24. import nativeFilters from 'src/dashboard/reducers/nativeFilters';
  25. import datasources from 'src/dashboard/reducers/datasources';
  26. import sliceEntities from 'src/dashboard/reducers/sliceEntities';
  27. import dashboardLayout from 'src/dashboard/reducers/undoableDashboardLayout';
  28. import messageToasts from 'src/components/MessageToasts/reducers';
  29. import saveModal from 'src/explore/reducers/saveModalReducer';
  30. import explore from 'src/explore/reducers/exploreReducer';
  31. import sqlLab from 'src/SqlLab/reducers/sqlLab';
  32. import reports from 'src/features/reports/ReportModal/reducer';
  33. import getBootstrapData from 'src/utils/getBootstrapData';
  34. const impressionId = (state = '') => state;
  35. const bootstrapData = getBootstrapData();
  36. const common = { ...bootstrapData.common };
  37. const user = { ...bootstrapData.user };
  38. const noopReducer =
  39. <STATE = unknown>(initialState: STATE) =>
  40. (state: STATE = initialState) =>
  41. state;
  42. export default {
  43. charts,
  44. datasources,
  45. dashboardInfo,
  46. dashboardFilters,
  47. dataMask,
  48. nativeFilters,
  49. dashboardState,
  50. dashboardLayout,
  51. impressionId,
  52. messageToasts,
  53. sliceEntities,
  54. saveModal,
  55. explore,
  56. sqlLab,
  57. localStorageUsageInKilobytes: noopReducer(0),
  58. reports,
  59. common: noopReducer(common),
  60. user: noopReducer(user),
  61. };