fix: bring back dashboard perf logger (#14584)

* fix: bring back dashboard perf logger

* add test
This commit is contained in:
Grace Guo 2021-05-12 08:25:46 -07:00 committed by GitHub
parent 6d786d4d47
commit ada380982b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -47,4 +47,9 @@ describe('Dashboard load', () => {
cy.get('[data-test="discard-changes-button"]').should('be.visible'); cy.get('[data-test="discard-changes-button"]').should('be.visible');
cy.get('#app-menu').should('not.exist'); cy.get('#app-menu').should('not.exist');
}); });
it('should send log data', () => {
cy.visit(WORLD_HEALTH_DASHBOARD);
cy.intercept('/superset/log/?explode=events&dashboard_id=*');
});
}); });

View File

@ -18,7 +18,6 @@
*/ */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import { isString, keyBy } from 'lodash'; import { isString, keyBy } from 'lodash';
import shortid from 'shortid';
import { import {
Behavior, Behavior,
CategoricalColorNamespace, CategoricalColorNamespace,
@ -376,8 +375,6 @@ export const hydrateDashboard = (dashboardData, chartData, datasourcesData) => (
lastModifiedTime: dashboardData.changed_on, lastModifiedTime: dashboardData.changed_on,
}, },
dashboardLayout, dashboardLayout,
messageToasts: [],
impressionId: shortid.generate(),
}, },
}); });
}; };

View File

@ -29,6 +29,8 @@ import nativeFilters from 'src/dashboard/reducers/nativeFilters';
import datasources from 'src/dashboard/reducers/datasources'; import datasources from 'src/dashboard/reducers/datasources';
import sliceEntities from 'src/dashboard/reducers/sliceEntities'; import sliceEntities from 'src/dashboard/reducers/sliceEntities';
import dashboardLayout from 'src/dashboard/reducers/undoableDashboardLayout'; import dashboardLayout from 'src/dashboard/reducers/undoableDashboardLayout';
import logger from 'src/middleware/loggerMiddleware';
import shortid from 'shortid';
// Some reducers don't do anything, and redux is just used to reference the initial "state". // Some reducers don't do anything, and redux is just used to reference the initial "state".
// This may change later, as the client application takes on more responsibilities. // This may change later, as the client application takes on more responsibilities.
@ -57,12 +59,12 @@ export const rootReducer = combineReducers({
messageToasts: messageToastReducer, messageToasts: messageToastReducer,
common: noopReducer(bootstrap.common || {}), common: noopReducer(bootstrap.common || {}),
user: noopReducer(bootstrap.user || {}), user: noopReducer(bootstrap.user || {}),
impressionId: noopReducer(''), impressionId: noopReducer(shortid.generate()),
...dashboardReducers, ...dashboardReducers,
}); });
export const store = createStore( export const store = createStore(
rootReducer, rootReducer,
{}, {},
compose(applyMiddleware(thunk), initEnhancer(false)), compose(applyMiddleware(thunk, logger), initEnhancer(false)),
); );