Skip to content

Commit

Permalink
fix: fixed tab css
Browse files Browse the repository at this point in the history
  • Loading branch information
Elessar1802 committed May 12, 2024
1 parent 75afa7b commit 9d320e9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
41 changes: 24 additions & 17 deletions src/components/ResourceBrowser/ResourceList/K8SResourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,37 @@ export const K8SResourceList = ({
const searchText = searchParams[SEARCH_QUERY_PARAM_KEY] || ''

/* TODO: what to do with the error? */
const [resourceListLoader, _resourceList, /*resourceListDataError*/, reloadResourceListData] = useAsync(() => {
if (!selectedResource || selectedResource.gvk.Kind === SIDEBAR_KEYS.nodeGVK.Kind) {
return null
}
return abortPreviousRequests(
() => getResourceList(
getResourceListPayload(
clusterId,
selectedNamespace.value.toLowerCase(),
selectedResource,
location.search,
),
abortControllerRef.current.signal,
),
abortControllerRef,
)
}, [selectedResource, clusterId, selectedNamespace])
const [resourceListLoader, _resourceList, /*resourceListDataError*/, reloadResourceListData] = useAsync(
() => {
if (!selectedResource || selectedResource.gvk.Kind === SIDEBAR_KEYS.nodeGVK.Kind) {
return null
}
return abortPreviousRequests(
() =>
getResourceList(
getResourceListPayload(
clusterId,
selectedNamespace.value.toLowerCase(),
selectedResource,
location.search,
),
abortControllerRef.current.signal,
),
abortControllerRef,
)
},
[selectedResource, clusterId, selectedNamespace],
true,
{ resetOnChange: true },
)

const resourceList = _resourceList?.result || null

const showPaginatedView = resourceList?.data?.length >= 100

useEffect(() => {
if (!resourceList) {
setFilteredResourceList(null)
return
}
switch (selectedResource?.gvk.Kind) {
Expand Down
14 changes: 9 additions & 5 deletions src/components/common/DynamicTabs/DynamicTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,17 @@ const DynamicTabs = ({
>
{getTabNavLink(tab, isFixed)}
{_showNameOnSelect && (
<div
className="dynamic-tab__close icon-dim-16 flex ml-auto"
data-id={tab.id}
<button
type="button"
className="dc__unset-button-styles pr-12"
aria-label={`Stop tab ${tab.name}`}
onClick={handleTabStopAction}
data-id={tab.id}
>
<Cross className="icon-dim-16 cursor p-2 fcn-6 scn-6" />
</div>
<div className="dynamic-tab__close flex br-4">
<Cross className="icon-dim-16 cursor p-2 fcn-6 scn-6" />
</div>
</button>
)}
{!isFixed && (
<button
Expand Down

0 comments on commit 9d320e9

Please sign in to comment.