Skip to content

Commit

Permalink
Merge pull request #2985 from the-deep/fix/ocr-hide-unhide
Browse files Browse the repository at this point in the history
Fix hide/unhide entries
  • Loading branch information
AdityaKhatri authored Dec 5, 2024
2 parents d679896 + 2083629 commit 861d8c3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
3 changes: 3 additions & 0 deletions app/components/LeftPaneEntries/TableAndVisualItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {

import EntryItem, { EntryItemProps } from '../EntryItem';

import styles from './styles.css';

interface EntryProps extends EntryItemProps {
type: 'entry-item'
}
Expand Down Expand Up @@ -63,6 +65,7 @@ function TableAndVisualItem(props: Props) {

return (
<Container
className={styles.tableAndVisualItem}
headerActions={(
<>
<QuickActionButton
Expand Down
3 changes: 3 additions & 0 deletions app/components/LeftPaneEntries/TableAndVisualItem/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.table-and-visual-item {
flex-shrink: 0;
}
20 changes: 11 additions & 9 deletions app/components/LeftPaneEntries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const LEAD_PREVIEW = gql`
$page: Int,
$pageSize: Int,
$excludeAttachmentIds: [ID!],
$excludeLeadattachmentCreatedEntries: Boolean,
) {
project(id: $projectId) {
id
Expand All @@ -103,6 +104,7 @@ const LEAD_PREVIEW = gql`
page: $page,
pageSize: $pageSize,
excludeAttachmentIds: $excludeAttachmentIds,
excludeLeadattachmentCreatedEntries: $excludeLeadattachmentCreatedEntries,
) {
results {
id
Expand Down Expand Up @@ -292,6 +294,7 @@ function LeftPaneEntries(props: Props) {
excludeAttachmentIds: attachmentsWithEntriesHidden
? leadAttachmentIdsWithEntries
: [],
excludeLeadattachmentCreatedEntries: !attachmentsWithEntriesHidden,
}) : undefined),
[
leadId,
Expand Down Expand Up @@ -899,21 +902,20 @@ function LeftPaneEntries(props: Props) {
activeClassName={styles.visualsTab}
retainMount="lazy"
>
{isDefined(leadPreviewCount) && (leadPreviewCount > 0) && (
<Switch
name="hide attachments"
label="Hide Created entries"
value={attachmentsWithEntriesHidden}
onChange={setAttachmentsWithEntriesHidden}
/>
)}
<Switch
className={styles.switch}
name="hide attachments"
label="Hide Created entries"
value={attachmentsWithEntriesHidden}
onChange={setAttachmentsWithEntriesHidden}
/>
<ListView
spacing="comfortable"
direction="vertical"
data={leadPreviewAttachments}
renderer={TablesAndVisualsItem}
rendererParams={leadAttachmentItemRendererParams}
className={styles.entryList}
className={styles.visualEntryList}
keySelector={leadAttachmentKeySelector}
filtered={false}
errored={false}
Expand Down
16 changes: 11 additions & 5 deletions app/components/LeftPaneEntries/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,18 @@
overflow: auto;
gap: var(--dui-spacing-medium);

.switch {
flex-shrink: 0;
}

.visual-entry-list {
flex-grow: 1;
overflow-y: auto;
}

.pager {
justify-content: center;
flex-shrink: 0;
justify-content: flex-end;
}
}

Expand Down Expand Up @@ -119,8 +129,4 @@
}
}
}
.entry-list {
overflow: unset;
}

}

0 comments on commit 861d8c3

Please sign in to comment.