Skip to content
Open
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
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/datagrid-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue where the footer would take up unnecessary spacing when no content was rendered inside.

### Added

- We added a new property for export to excel. The new property allows to set the cell export type and also the format for type number and date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ import { useSelectionCounterViewModel } from "../features/selection-counter/inje
import { useDatagridConfig, usePaginationService, useTexts } from "../model/hooks/injection-hooks";
import { Pagination } from "./Pagination";

export const WidgetFooter = observer(function WidgetFooter(): ReactElement {
export const WidgetFooter = observer(function WidgetFooter(): ReactElement | null {
const config = useDatagridConfig();
const paging = usePaginationService();
const { loadMoreButtonCaption } = useTexts();
const selectionCounterVM = useSelectionCounterViewModel();

const showLoadMore = paging.hasMoreItems && paging.pagination === "loadMore";
const showFooter = selectionCounterVM.isBottomCounterVisible || showLoadMore || paging.pagination;

if (!showFooter) {
return null;
}

return (
<div className="widget-datagrid-footer table-footer">
<div className="widget-datagrid-paging-bottom">
Expand Down
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/gallery-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue where the footer would take up unnecessary spacing when no content was rendered inside.

### Added

- We added a refresh interval property, to allow defining an interval (in seconds) for refreshing the content in Gallery
Expand Down
33 changes: 20 additions & 13 deletions packages/pluggableWidgets/gallery-web/src/components/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export function Gallery<T extends ObjectItem>(props: GalleryProps<T>): ReactElem
const showTopSelectionCounter = selectionCounter && props.selectionCountPosition === "top";
const showBottomSelectionCounter = selectionCounter && props.selectionCountPosition === "bottom";

const showLoadMore = props.paginationType === "loadMore";
const showFooter = showBottomSelectionCounter || showBottomPagination || showLoadMore;

return (
<GalleryRoot
className={props.className}
Expand Down Expand Up @@ -140,21 +143,25 @@ export function Gallery<T extends ObjectItem>(props: GalleryProps<T>): ReactElem
<div className="empty-placeholder">{children}</div>
</section>
))}
<GalleryFooter>
<div className="widget-gallery-footer-controls">
{showBottomSelectionCounter && <div className="widget-gallery-fc-start">{selectionCounter}</div>}
{showFooter && (
<GalleryFooter>
<div className="widget-gallery-footer-controls">
{showBottomSelectionCounter && (
<div className="widget-gallery-fc-start">{selectionCounter}</div>
)}

<div className="widget-gallery-fc-end">
{showBottomPagination && pagination}
{props.paginationType === "loadMore" &&
(props.preview ? (
<LoadMorePreview>{loadMoreButtonCaption}</LoadMorePreview>
) : (
<LoadMore>{loadMoreButtonCaption}</LoadMore>
))}
<div className="widget-gallery-fc-end">
{showBottomPagination && pagination}
{showLoadMore &&
(props.preview ? (
<LoadMorePreview>{loadMoreButtonCaption}</LoadMorePreview>
) : (
<LoadMore>{loadMoreButtonCaption}</LoadMore>
))}
</div>
</div>
</div>
</GalleryFooter>
</GalleryFooter>
)}
</GalleryRoot>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ exports[`Gallery DOM Structure renders correctly 1`] = `
</div>
</div>
</div>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -136,17 +125,6 @@ exports[`Gallery DOM Structure renders correctly with onclick event 1`] = `
</div>
</div>
</div>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -207,17 +185,6 @@ exports[`Gallery with accessibility properties renders correctly with items 1`]
</div>
</div>
</div>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -256,17 +223,6 @@ exports[`Gallery with accessibility properties renders correctly without items 1
</span>
</div>
</section>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -304,17 +260,6 @@ exports[`Gallery with empty option renders correctly 1`] = `
</span>
</div>
</section>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -491,17 +436,6 @@ exports[`Gallery with pagination renders correctly 1`] = `
</div>
</div>
</div>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Expand Down Expand Up @@ -553,17 +487,6 @@ exports[`Gallery without filters renders structure without header container 1`]
</div>
</div>
</div>
<div
class="widget-gallery-footer"
>
<div
class="widget-gallery-footer-controls"
>
<div
class="widget-gallery-fc-end"
/>
</div>
</div>
</div>
</DocumentFragment>
`;
Loading