Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix filter drawer being open below resource action content #1614

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/frontend/components/routes/resource-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { NoActionError, NoResourceError } from '../app/error-message.js'
import FilterDrawer from '../app/filter-drawer.js'
import { ActionHeader } from '../app/index.js'
import Wrapper from './utils/wrapper.js'
import { getResourceElementCss } from '../../utils/data-css-name.js'

type PropsFromState = {
resources: Array<ResourceJSON>
Expand All @@ -36,6 +37,8 @@ const ResourceAction: React.FC<Props> = (props) => {
return <NoActionError resourceId={resourceId!} actionName={actionName!} />
}

const contentTag = getResourceElementCss(resource.id, action.name)

if (action.showInDrawer) {
return (
<DrawerPortal width={action.containerWidth}>
Expand All @@ -45,8 +48,8 @@ const ResourceAction: React.FC<Props> = (props) => {
}

return (
<Wrapper width={action.containerWidth} showFilter={action.showFilter}>
<Box flex flexDirection="column">
<Wrapper width={action.containerWidth} showFilter={action.showFilter} data-css={contentTag}>
<Box flex flexDirection="column" flexGrow={1}>
<ActionHeader
resource={resource}
action={action}
Expand All @@ -55,7 +58,7 @@ const ResourceAction: React.FC<Props> = (props) => {
/>
<BaseActionComponent action={action} resource={resource} setTag={setTag} />
</Box>
{action.showFilter ? <FilterDrawer resource={resource} /> : ''}
{action.showFilter && <FilterDrawer resource={resource} />}
</Wrapper>
)
}
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/components/routes/utils/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import allowOverride from '../../../hoc/allow-override.js'

const StyledWrapperWithFilter = styled(Box)`
& > ${Drawer} {
position: relative;
box-shadow: none;
border-radius: ${({ theme }) => theme.space.sm};
}

Expand Down