Skip to content

Commit

Permalink
feat: ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
YounixM committed Dec 18, 2024
1 parent c044f31 commit 14eb19a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,14 @@
}

.periscope-btn {
&.ghost {
&.ghost:not(:disabled) {
border: none;
background: transparent;

&:hover {
background: transparent;
color: var(--bg-robin-500);
color: var(--bg-robin-500) !important;
font-weight: 500;

svg {
height: 16px;
width: 16px;
}
}
}
}
Expand Down Expand Up @@ -271,13 +266,9 @@
.periscope-btn {
padding: 4px 8px;

&.ghost {
&.ghost:not(:disabled) {
border: none;
background: transparent;

&:hover {
color: var(--bg-vanilla-100);
}
}
}
}
Expand Down
35 changes: 22 additions & 13 deletions frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,29 @@ import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { Filter, SlidersHorizontal } from 'lucide-react';
import { useCallback, useMemo, useState } from 'react';
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';

import K8sFiltersSidePanel from './K8sFiltersSidePanel/K8sFiltersSidePanel';
import { IPodColumn } from './utils';

interface K8sHeaderProps {
selectedGroupBy: BaseAutocompleteData[];
defaultAddedColumns: IPodColumn[];
groupByOptions: { value: string; label: string }[];
addedColumns: IPodColumn[];
isLoadingGroupByFilters: boolean;
availableColumns: IPodColumn[];
handleFiltersChange: (value: IBuilderQuery['filters']) => void;
handleGroupByChange: (value: IBuilderQuery['groupBy']) => void;
onAddColumn: (column: IPodColumn) => void;
onRemoveColumn: (column: IPodColumn) => void;
handleFilterVisibilityChange: () => void;
isFiltersVisible: boolean;
}

function K8sHeader({
selectedGroupBy,
defaultAddedColumns,
groupByOptions,
isLoadingGroupByFilters,
Expand All @@ -23,22 +40,13 @@ function K8sHeader({
onRemoveColumn,
handleFilterVisibilityChange,
isFiltersVisible,
}: {
defaultAddedColumns: IPodColumn[];
groupByOptions: { value: string; label: string }[];
addedColumns: IPodColumn[];
isLoadingGroupByFilters: boolean;
availableColumns: IPodColumn[];
handleFiltersChange: (value: IBuilderQuery['filters']) => void;
handleGroupByChange: (value: IBuilderQuery['groupBy']) => void;
onAddColumn: (column: IPodColumn) => void;
onRemoveColumn: (column: IPodColumn) => void;
handleFilterVisibilityChange: () => void;
isFiltersVisible: boolean;
}): JSX.Element {
}: K8sHeaderProps): JSX.Element {
const [isFiltersSidePanelOpen, setIsFiltersSidePanelOpen] = useState(false);

const { currentQuery } = useQueryBuilder();

console.log('selectedGroupBy', selectedGroupBy);

const updatedCurrentQuery = useMemo(
() => ({
...currentQuery,
Expand Down Expand Up @@ -117,6 +125,7 @@ function K8sHeader({
<Button
type="text"
className="periscope-btn ghost"
disabled={selectedGroupBy.length > 0}
onClick={(): void => setIsFiltersSidePanelOpen(true)}
>
<SlidersHorizontal size={14} />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 14eb19a

Please sign in to comment.