Skip to content
Snippets Groups Projects
Unverified Commit d32a252d authored by Dalton's avatar Dalton Committed by GitHub
Browse files

pass 'noEvent' api option to prevent unauthed event (#18920)

* pass 'noEvent' api option to prevent unauthed event

* unskip repro
parent e07909e1
No related branches found
No related tags found
No related merge requests found
...@@ -306,8 +306,8 @@ export function createEntity(def: EntityDefinition): Entity { ...@@ -306,8 +306,8 @@ export function createEntity(def: EntityDefinition): Entity {
({ id }) => [...getObjectStatePath(id), "fetch"], ({ id }) => [...getObjectStatePath(id), "fetch"],
), ),
withEntityActionDecorators("fetch"), withEntityActionDecorators("fetch"),
)(entityObject => async (dispatch, getState) => )((entityObject, options = {}) => async (dispatch, getState) =>
entity.normalize(await entity.api.get({ id: entityObject.id })), entity.normalize(await entity.api.get({ id: entityObject.id }, options)),
), ),
create: compose( create: compose(
......
...@@ -63,7 +63,9 @@ const WithVizSettingsData = ComposedComponent => { ...@@ -63,7 +63,9 @@ const WithVizSettingsData = ComposedComponent => {
fetch() { fetch() {
getLinkTargets(this.dashcardSettings(this.props)).forEach( getLinkTargets(this.dashcardSettings(this.props)).forEach(
({ entity, entityId }) => ({ entity, entityId }) =>
this.props.dispatch(entity.actions.fetch({ id: entityId })), this.props.dispatch(
entity.actions.fetch({ id: entityId }, { noEvent: true }),
),
); );
} }
......
...@@ -326,7 +326,7 @@ describe("scenarios > dashboard", () => { ...@@ -326,7 +326,7 @@ describe("scenarios > dashboard", () => {
expectedRouteCalls({ route_alias: "fetchFieldValues", calls: 0 }); expectedRouteCalls({ route_alias: "fetchFieldValues", calls: 0 });
}); });
it.skip("should be possible to visit a dashboard with click-behavior linked to the dashboard without permissions (metabase#15368)", () => { it("should be possible to visit a dashboard with click-behavior linked to the dashboard without permissions (metabase#15368)", () => {
cy.request("GET", "/api/user/current").then( cy.request("GET", "/api/user/current").then(
({ body: { personal_collection_id } }) => { ({ body: { personal_collection_id } }) => {
// Save new dashboard in admin's personal collection // Save new dashboard in admin's personal collection
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment