Skip to content

Commit

Permalink
feat(cdp): remove "show hidden" test actions (#25481)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Oct 9, 2024
1 parent 37e2fcc commit 85f9317
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function DestinationsFilters({
hideShowPaused,
hideKind,
}: DestinationsFiltersProps): JSX.Element | null {
const { user, filters } = useValues(destinationsFiltersLogic)
const { filters } = useValues(destinationsFiltersLogic)
const { setFilters, openFeedbackDialog } = useActions(destinationsFiltersLogic)

return (
Expand All @@ -42,16 +42,6 @@ export function DestinationsFilters({
onChange={(e) => setFilters({ showPaused: e ?? undefined })}
/>
)}
{(user?.is_staff || user?.is_impersonated) && (
<LemonCheckbox
label="Show hidden"
bordered
size="small"
checked={filters.showHidden}
onChange={(e) => setFilters({ showHidden: e ?? undefined })}
/>
)}

{!hideKind && (
<LemonSelect
type="secondary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export type DestinationsFilters = {
kind?: PipelineBackend | null
sub_template?: string
showPaused?: boolean
showHidden?: boolean
}

export const destinationsFiltersLogic = kea<destinationsFiltersLogicType>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const pipelineDestinationsLogic = kea<pipelineDestinationsLogicType>([
},
],

_hogFunctions: [
hogFunctions: [
[] as HogFunctionType[],
{
loadHogFunctions: async () => {
Expand Down Expand Up @@ -205,11 +205,6 @@ export const pipelineDestinationsLogic = kea<pipelineDestinationsLogicType>([
],
})),
selectors({
hogFunctions: [
(s) => [s._hogFunctions, s.filters],
(hogFunctions, filters) =>
filters.showHidden ? hogFunctions : hogFunctions.filter((hf) => !hf.name.includes('[CDP-TEST-HIDDEN]')),
],
paidHogFunctions: [
(s) => [s.hogFunctions],
(hogFunctions) => {
Expand All @@ -220,7 +215,7 @@ export const pipelineDestinationsLogic = kea<pipelineDestinationsLogicType>([
},
],
loading: [
(s) => [s.pluginsLoading, s.pluginConfigsLoading, s.batchExportConfigsLoading, s._hogFunctionsLoading],
(s) => [s.pluginsLoading, s.pluginConfigsLoading, s.batchExportConfigsLoading, s.hogFunctionsLoading],
(pluginsLoading, pluginConfigsLoading, batchExportConfigsLoading, hogFunctionsLoading) =>
pluginsLoading || pluginConfigsLoading || batchExportConfigsLoading || hogFunctionsLoading,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function HogFunctionList({
extraControls,
...props
}: HogFunctionListLogicProps & { extraControls?: JSX.Element }): JSX.Element {
const { user, loading, filteredHogFunctions, filters, hogFunctions, canEnableHogFunction } = useValues(
const { loading, filteredHogFunctions, filters, hogFunctions, canEnableHogFunction } = useValues(
hogFunctionListLogic(props)
)
const { loadHogFunctions, setFilters, resetFilters, toggleEnabled, deleteHogFunction } = useActions(
Expand Down Expand Up @@ -47,15 +47,6 @@ export function HogFunctionList({
onChange={(e) => setFilters({ showPaused: e ?? undefined })}
/>
)}
{(user?.is_staff || user?.is_impersonated) && typeof props.forceFilters?.showHidden !== 'boolean' && (
<LemonCheckbox
label="Show hidden"
bordered
size="small"
checked={filters.showHidden}
onChange={(e) => setFilters({ showHidden: e ?? undefined })}
/>
)}
{extraControls}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export interface Fuse extends FuseClass<HogFunctionType> {}
export type HogFunctionListFilters = {
search?: string
showPaused?: boolean
showHidden?: boolean
filters?: Record<string, any>
}

Expand Down Expand Up @@ -70,7 +69,7 @@ export const hogFunctionListLogic = kea<hogFunctionListLogicType>([
],
})),
loaders(({ values, actions }) => ({
_hogFunctions: [
hogFunctions: [
[] as HogFunctionType[],
{
loadHogFunctions: async () => {
Expand Down Expand Up @@ -114,18 +113,13 @@ export const hogFunctionListLogic = kea<hogFunctionListLogicType>([
]
},
addHogFunction: ({ hogFunction }) => {
return [hogFunction, ...values._hogFunctions]
return [hogFunction, ...values.hogFunctions]
},
},
],
})),
selectors({
loading: [(s) => [s._hogFunctionsLoading], (hogFunctionsLoading) => hogFunctionsLoading],
hogFunctions: [
(s) => [s._hogFunctions, s.filters],
(hogFunctions, filters) =>
filters.showHidden ? hogFunctions : hogFunctions.filter((hf) => !hf.name.includes('[CDP-TEST-HIDDEN]')),
],
loading: [(s) => [s.hogFunctionsLoading], (hogFunctionsLoading) => hogFunctionsLoading],
sortedHogFunctions: [
(s) => [s.hogFunctions],
(hogFunctions): HogFunctionType[] => {
Expand Down

0 comments on commit 85f9317

Please sign in to comment.