Skip to content

Commit

Permalink
fix(extension): remove fields marked as hidden from measures and dime…
Browse files Browse the repository at this point in the history
…nsions
  • Loading branch information
pjabl committed Jun 14, 2024
1 parent ecc6075 commit 90221dd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions explore-assistant-extension/src/hooks/useLookerFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,26 @@ export const useLookerFields = () => {
if (!fields || !fields.dimensions || !fields.measures) {
return
}
const dimensions = fields.dimensions.map(
({ name, type, description, tags }: any) => ({
const dimensions = fields.dimensions
.filter(({ hidden }: any) => !hidden)
.map(({ name, type, description, tags }: any) => ({
name,
type,
description,
tags,
}),
)
}))

const measures = fields.measures.map(
({ name, type, description, tags }: any) => ({
const measures = fields.measures
.filter(({ hidden }: any) => !hidden)
.map(({ name, type, description, tags }: any) => ({
name,
type,
description,
tags,
}),
)
}))

dispatch(setDimensions(dimensions))
dispatch(setMeasures(measures))
})
}, [dispatch, lookerModel, lookerExplore]) // Dependencies array to avoid unnecessary re-executions
}

0 comments on commit 90221dd

Please sign in to comment.