mirror of https://github.com/grafana/grafana.git
Use package exports instead of individual clients
This commit is contained in:
parent
c0131c8e10
commit
2bb586aa8f
|
@ -2,11 +2,7 @@ import { ReducersMapObject } from '@reduxjs/toolkit';
|
|||
import { AnyAction, combineReducers } from 'redux';
|
||||
|
||||
import { alertingAPI as alertingPackageAPI } from '@grafana/alerting/unstable';
|
||||
import { generatedAPI as userPreferencesAPI } from '@grafana/api-clients/legacy/preferences';
|
||||
import { dashboardAPIv0alpha1 } from 'app/api/clients/dashboard/v0alpha1';
|
||||
import { preferencesAPIv1alpha1 } from 'app/api/clients/preferences/v1alpha1';
|
||||
import { rulesAPIv0alpha1 } from 'app/api/clients/rules/v0alpha1';
|
||||
import { shortURLAPIv1alpha1 } from 'app/api/clients/shorturl/v1alpha1';
|
||||
import { allReducers } from '@grafana/api-clients';
|
||||
import sharedReducers from 'app/core/reducers';
|
||||
import ldapReducers from 'app/features/admin/state/reducers';
|
||||
import alertingReducers from 'app/features/alerting/state/reducers';
|
||||
|
@ -21,7 +17,6 @@ import exploreReducers from 'app/features/explore/state/main';
|
|||
import foldersReducers from 'app/features/folders/state/reducers';
|
||||
import invitesReducers from 'app/features/invites/state/reducers';
|
||||
import importDashboardReducers from 'app/features/manage-dashboards/state/reducers';
|
||||
import { cloudMigrationAPI } from 'app/features/migrate-to-cloud/api';
|
||||
import organizationReducers from 'app/features/org/state/reducers';
|
||||
import panelsReducers from 'app/features/panel/state/reducers';
|
||||
import { reducer as pluginsReducer } from 'app/features/plugins/admin/state/reducer';
|
||||
|
@ -32,15 +27,8 @@ import teamsReducers from 'app/features/teams/state/reducers';
|
|||
import usersReducers from 'app/features/users/state/reducers';
|
||||
import templatingReducers from 'app/features/variables/state/keyedVariablesReducer';
|
||||
|
||||
import { advisorAPIv0alpha1 } from '../../api/clients/advisor/v0alpha1';
|
||||
import { folderAPIv1beta1 } from '../../api/clients/folder/v1beta1';
|
||||
import { iamAPIv0alpha1 } from '../../api/clients/iam/v0alpha1';
|
||||
import { playlistAPIv0alpha1 } from '../../api/clients/playlist/v0alpha1';
|
||||
import { provisioningAPIv0alpha1 } from '../../api/clients/provisioning/v0alpha1';
|
||||
import { alertingApi } from '../../features/alerting/unified/api/alertingApi';
|
||||
import { cleanUpAction } from '../actions/cleanUp';
|
||||
// Used by the API client generator
|
||||
// PLOP_INJECT_IMPORT
|
||||
|
||||
const rootReducers = {
|
||||
...sharedReducers,
|
||||
|
@ -68,19 +56,7 @@ const rootReducers = {
|
|||
[alertingPackageAPI.reducerPath]: alertingPackageAPI.reducer,
|
||||
[publicDashboardApi.reducerPath]: publicDashboardApi.reducer,
|
||||
[browseDashboardsAPI.reducerPath]: browseDashboardsAPI.reducer,
|
||||
[cloudMigrationAPI.reducerPath]: cloudMigrationAPI.reducer,
|
||||
[iamAPIv0alpha1.reducerPath]: iamAPIv0alpha1.reducer,
|
||||
[playlistAPIv0alpha1.reducerPath]: playlistAPIv0alpha1.reducer,
|
||||
[userPreferencesAPI.reducerPath]: userPreferencesAPI.reducer,
|
||||
[provisioningAPIv0alpha1.reducerPath]: provisioningAPIv0alpha1.reducer,
|
||||
[folderAPIv1beta1.reducerPath]: folderAPIv1beta1.reducer,
|
||||
[advisorAPIv0alpha1.reducerPath]: advisorAPIv0alpha1.reducer,
|
||||
[dashboardAPIv0alpha1.reducerPath]: dashboardAPIv0alpha1.reducer,
|
||||
[rulesAPIv0alpha1.reducerPath]: rulesAPIv0alpha1.reducer,
|
||||
[shortURLAPIv1alpha1.reducerPath]: shortURLAPIv1alpha1.reducer,
|
||||
[preferencesAPIv1alpha1.reducerPath]: preferencesAPIv1alpha1.reducer,
|
||||
// PLOP_INJECT_REDUCER
|
||||
// Used by the API client generator
|
||||
...allReducers,
|
||||
};
|
||||
|
||||
const addedReducers = {};
|
||||
|
|
|
@ -3,23 +3,11 @@ import { setupListeners } from '@reduxjs/toolkit/query';
|
|||
import { Middleware } from 'redux';
|
||||
|
||||
import { alertingAPI as alertingPackageAPI } from '@grafana/alerting/unstable';
|
||||
import { generatedAPI as dashboardAPIv0alpha1 } from '@grafana/api-clients/dashboard/v0alpha1';
|
||||
import { generatedAPI as userPreferencesAPI } from '@grafana/api-clients/legacy/preferences';
|
||||
import { preferencesAPIv1alpha1 } from 'app/api/clients/preferences/v1alpha1';
|
||||
import { rulesAPIv0alpha1 } from 'app/api/clients/rules/v0alpha1';
|
||||
import { shortURLAPIv1alpha1 } from 'app/api/clients/shorturl/v1alpha1';
|
||||
import { allMiddleware } from '@grafana/api-clients';
|
||||
import { browseDashboardsAPI } from 'app/features/browse-dashboards/api/browseDashboardsAPI';
|
||||
import { publicDashboardApi } from 'app/features/dashboard/api/publicDashboardApi';
|
||||
import { cloudMigrationAPI } from 'app/features/migrate-to-cloud/api';
|
||||
import { StoreState } from 'app/types/store';
|
||||
|
||||
import { advisorAPIv0alpha1 } from '../api/clients/advisor/v0alpha1';
|
||||
import { folderAPIv1beta1 } from '../api/clients/folder/v1beta1';
|
||||
import { iamAPIv0alpha1 } from '../api/clients/iam/v0alpha1';
|
||||
import { playlistAPIv0alpha1 } from '../api/clients/playlist/v0alpha1';
|
||||
import { provisioningAPIv0alpha1 } from '../api/clients/provisioning/v0alpha1';
|
||||
// Used by the API client generator
|
||||
// PLOP_INJECT_IMPORT
|
||||
import { buildInitialState } from '../core/reducers/navModel';
|
||||
import { addReducer, createRootReducer } from '../core/reducers/root';
|
||||
import { alertingApi } from '../features/alerting/unified/api/alertingApi';
|
||||
|
@ -50,19 +38,7 @@ export function configureStore(initialState?: Partial<StoreState>) {
|
|||
alertingPackageAPI.middleware,
|
||||
publicDashboardApi.middleware,
|
||||
browseDashboardsAPI.middleware,
|
||||
cloudMigrationAPI.middleware,
|
||||
userPreferencesAPI.middleware,
|
||||
iamAPIv0alpha1.middleware,
|
||||
playlistAPIv0alpha1.middleware,
|
||||
provisioningAPIv0alpha1.middleware,
|
||||
folderAPIv1beta1.middleware,
|
||||
advisorAPIv0alpha1.middleware,
|
||||
dashboardAPIv0alpha1.middleware,
|
||||
rulesAPIv0alpha1.middleware,
|
||||
shortURLAPIv1alpha1.middleware,
|
||||
preferencesAPIv1alpha1.middleware,
|
||||
// PLOP_INJECT_MIDDLEWARE
|
||||
// Used by the API client generator
|
||||
...allMiddleware,
|
||||
...extraMiddleware
|
||||
),
|
||||
devTools: process.env.NODE_ENV !== 'production',
|
||||
|
|
Loading…
Reference in New Issue