Skip to content

Commit

Permalink
Merge pull request #6031 from specify/issue-6030
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfitzsimmons authored Jan 3, 2025
2 parents ea6649f + 16d9ba1 commit c55f4dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions specifyweb/frontend/js_src/lib/components/Atoms/DataEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const DataEntry = {
>(
'DataEntry.Grid',
'div',
`items-center p-1 -ml-1 gap-2`,
`items-center p-1 gap-2`,
({
viewDefinition,
display,
Expand Down Expand Up @@ -138,7 +138,7 @@ export const DataEntry = {
SubFormHeader: wrap(
'DataEntry.SubFormHeader',
'legend',
'gap-2 flex font-bold border-b border-gray-500 pt-5 pb-1 items-center',
'gap-2 flex font-bold border-b border-gray-500 pt-3 pb-1 items-center',
({ children, ...props }) => ({
// A hack for Safari. See https://github.com/specify/specify7/issues/1535
children: <div {...props}>{children}</div>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ exports[`DataEntry.Footer renders without errors 1`] = `
exports[`DataEntry.Grid renders without errors 1`] = `
<DocumentFragment>
<div
class="grid items-center p-1 -ml-1 gap-2"
class="grid items-center p-1 gap-2"
style="grid-template-columns: 1fr 2fr 3fr auto;"
>
Test
Expand Down Expand Up @@ -231,7 +231,7 @@ exports[`DataEntry.SubFormHeader renders without errors 1`] = `
<DocumentFragment>
<legend>
<div
class="gap-2 flex font-bold border-b border-gray-500 pt-5 pb-1 items-center"
class="gap-2 flex font-bold border-b border-gray-500 pt-3 pb-1 items-center"
>
Test
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ export function FormTable<SCHEMA extends AnySchema>({
<p>{formsText.noData()}</p>
) : (
<div
className={isCollapsed ? 'hidden' : 'overflow-x-auto'}
className={
isCollapsed
? 'hidden'
: 'overflow-x-auto border border-gray-500 border-t-0 rounded-b pl-1 pr-1 pb-1'
}
onScroll={handleScroll}
>
<DataEntry.Grid
Expand Down
15 changes: 14 additions & 1 deletion specifyweb/frontend/js_src/lib/components/Forms/ResourceView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ export function ResourceView<SCHEMA extends AnySchema>({
</ErrorBoundary>
) : undefined;

const hasNoData =
!resource || (Array.isArray(resource) && resource.length === 0);

const headerContent = (
<>
{specifyNetworkBadge}
Expand Down Expand Up @@ -313,7 +316,17 @@ export function ResourceView<SCHEMA extends AnySchema>({
</DataEntry.SubFormTitle>
{headerComponents}
</DataEntry.SubFormHeader>
<div className={isCollapsed ? 'hidden' : ''}>{formattedChildren}</div>
<div
className={
isCollapsed
? 'hidden'
: hasNoData
? ''
: 'border border-gray-500 border-t-0 rounded-b p-1'
}
>
{formattedChildren}
</div>
</DataEntry.SubForm>
) : (
<Container.FullGray>
Expand Down

0 comments on commit c55f4dd

Please sign in to comment.