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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -156,6 +157,11 @@ const ApplicationResourcesView: React.FC<ApplicationResourcesViewProps> = ({
actions={
<ApplicationResourcesToolbar viewType={viewType} onViewChange={onViewChange} />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resources toolbar (the view switcher button) is not on the right side. It should not be directly next to the filter/column management widgets

ListGraphButton ListGraphButton2 Original

}
pagination={

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test it when you resize the browser window to a small width, and ensure everything is layed out properly. Ensure there are filters enabled.

For example this is what i see before the fix:

NarrowWindow

Expanding the filter:

NarrowWindowWithFilters

I saw some issues with this.

isListView && itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
</StackItem>
<StackItem isFilled className="gitops-graph-list-view__content">
Expand All @@ -174,6 +180,7 @@ const ApplicationResourcesView: React.FC<ApplicationResourcesViewProps> = ({
activeState={isEmptyResources ? DataViewState.empty : null}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
) : (
<div className="gitops-graph-list-view__graph">
Expand Down
12 changes: 11 additions & 1 deletion src/gitops/components/application/ApplicationSourcesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ import {
buildManagedDataViewColumns,
useGitOpsManagedDataView,
} from '../shared/ColumnManagement';
import { GitOpsDataViewTable, useGitOpsListPagePagination } from '../shared/DataView';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsListPagePagination,
} from '../shared/DataView';
import { GitOpsListPageToolbar } from '../shared/GitOpsListPageToolbar';

type ApplicationDetailsTabProps = RouteComponentProps<{
Expand Down Expand Up @@ -214,6 +218,11 @@ export const SourceList: React.FC<SourceListProps> = ({ sources, obj, argoServer
) : undefined
}
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
rows={visibleRows}
Expand All @@ -223,6 +232,7 @@ export const SourceList: React.FC<SourceListProps> = ({ sources, obj, argoServer
isEmpty={sources.length === 0}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</>
);
Expand Down
11 changes: 10 additions & 1 deletion src/gitops/components/application/ApplicationSyncStatusTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -283,7 +284,14 @@ const ApplicationSyncStatusTab: React.FC<ApplicationSyncStatusTabProps> = ({ obj
<Title headingLevel="h2" className="co-section-heading">
{t('Resources Last Synced')}
</Title>
<GitOpsListPageToolbar columnManagement={columnManagement} />
<GitOpsListPageToolbar
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
rows={visibleRows}
columns={columns}
Expand All @@ -293,6 +301,7 @@ const ApplicationSyncStatusTab: React.FC<ApplicationSyncStatusTabProps> = ({ obj
activeState={resources.length === 0 ? DataViewState.empty : null}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</PageSection>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/gitops/components/application/History/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Tbody, Td, ThProps, Tr } from '@patternfly/react-table';

import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../../shared/DataView';
Expand Down Expand Up @@ -114,6 +115,11 @@ const HistoryList: React.FC<HistoryListProps> = ({ history, obj }) => {
) : undefined
}
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
rows={visibleRows}
Expand All @@ -123,6 +129,7 @@ const HistoryList: React.FC<HistoryListProps> = ({ history, obj }) => {
isEmpty={displayHistory.length === 0}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</div>
);
Expand Down
12 changes: 11 additions & 1 deletion src/gitops/components/imageupdater/ImageUpdaterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -238,7 +239,15 @@ const ImageUpdaterList: React.FC<ImageUpdaterListTabProps> = ({
)}
<ListPageBody>
{hasItems && (
<GitOpsListPageToolbar filters={listPageFilter} columnManagement={columnManagement} />
<GitOpsListPageToolbar
filters={listPageFilter}
columnManagement={columnManagement}
pagination={
itemCount > 0 && !loadError ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
)}
<GitOpsDataViewTable
columns={visibleColumnsDV}
Expand All @@ -250,6 +259,7 @@ const ImageUpdaterList: React.FC<ImageUpdaterListTabProps> = ({
errorState={error || undefined}
itemCount={itemCount}
pagination={pagination}
showTopPagination={!hasItems}
/>
</ListPageBody>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ImageUpdaterKind, ImageUpdaterRecentUpdate } from '../../models/ImageUp
import { useGitOpsTranslation } from '../../utils/hooks/useGitOpsTranslation';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -105,7 +106,14 @@ const ImageUpdaterRecentUpdatesTab: React.FC<ImageUpdaterRecentUpdatesTabProps>
<Title headingLevel="h2" className="co-section-heading">
{t('Recent Updates')}
</Title>
<GitOpsListPageToolbar columnManagement={columnManagement} />
<GitOpsListPageToolbar
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
rows={visibleRows}
columns={columns}
Expand All @@ -114,6 +122,7 @@ const ImageUpdaterRecentUpdatesTab: React.FC<ImageUpdaterRecentUpdatesTabProps>
isEmpty={sortedUpdates.length === 0}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</PageSection>
</div>
Expand Down
12 changes: 11 additions & 1 deletion src/gitops/components/project/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -261,7 +262,15 @@ const ProjectList: React.FC<ProjectListTabProps> = ({
)}
<ListPageBody>
{hasProjects && (
<GitOpsListPageToolbar filters={listPageFilter} columnManagement={columnManagement} />
<GitOpsListPageToolbar
filters={listPageFilter}
columnManagement={columnManagement}
pagination={
itemCount > 0 && !loadError ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
)}
<div className="gitops-project-list">
<GitOpsDataViewTable
Expand All @@ -274,6 +283,7 @@ const ProjectList: React.FC<ProjectListTabProps> = ({
errorState={error || undefined}
itemCount={itemCount}
pagination={pagination}
showTopPagination={!hasProjects}
/>
</div>
</ListPageBody>
Expand Down
7 changes: 7 additions & 0 deletions src/gitops/components/project/ProjectRolesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -177,6 +178,11 @@ const ProjectRolesTab: React.FC<ProjectRolesTabProps> = ({ obj }) => {
<GitOpsListPageToolbar
filters={argoCDUrl ? <ArgoCDLink href={argoCDUrl} /> : undefined}
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
columns={columns}
Expand All @@ -186,6 +192,7 @@ const ProjectRolesTab: React.FC<ProjectRolesTabProps> = ({ obj }) => {
emptyState={empty}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</PageSection>
);
Expand Down
7 changes: 7 additions & 0 deletions src/gitops/components/project/ProjectSyncWindowsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand Down Expand Up @@ -134,6 +135,11 @@ const ProjectSyncWindowsTab: React.FC<ProjectSyncWindowsTabProps> = ({ obj }) =>
<GitOpsListPageToolbar
filters={argoCDUrl ? <ArgoCDLink href={argoCDUrl} /> : undefined}
columnManagement={columnManagement}
pagination={
itemCount > 0 ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
columns={columns}
Expand All @@ -143,6 +149,7 @@ const ProjectSyncWindowsTab: React.FC<ProjectSyncWindowsTabProps> = ({ obj }) =>
emptyState={empty}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</PageSection>
);
Expand Down
18 changes: 10 additions & 8 deletions src/gitops/components/rollout/RolloutList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
} from '../shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '../shared/DataView';
Expand All @@ -55,7 +56,7 @@ import {

import { useRolloutActionsProvider } from './hooks/useRolloutActionsProvider';
import { RolloutKind, RolloutModel } from './model/RolloutModel';
import { RolloutStatus } from './utils/rollout-utils';
import { matchesSelectedStatusPhase, RolloutStatus } from './utils/rollout-utils';
import { topologyLink } from './utils/TopologyLink';
import { RolloutStatusFragment } from './RolloutStatus';

Expand Down Expand Up @@ -245,6 +246,11 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
<GitOpsListPageToolbar
filters={listPageFilter}
columnManagement={columnAndTopologyControls}
pagination={
itemCount > 0 && !loadError ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
)}
<GitOpsDataViewTable
Expand All @@ -257,6 +263,7 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
errorState={error || undefined}
itemCount={itemCount}
pagination={pagination}
showTopPagination={!(hasRollouts || !hideNameLabelFilters)}
/>
</ListPageBody>
</>
Expand Down Expand Up @@ -486,13 +493,8 @@ const getFilters = (t: (key: string) => string): RowFilter[] => [
filterGroupName: t('Rollout Status'),
type: 'rollout-status',
reducer: (rollout) => rollout.status?.phase,
filter: (input, rollout) => {
if (input.selected?.length && rollout?.status?.phase) {
return input.selected.includes(rollout.status.phase);
} else {
return true;
}
},
filter: (input, rollout) =>
matchesSelectedStatusPhase(input.selected, rollout?.status?.phase),
items: [
{ id: RolloutStatus.Healthy, title: RolloutStatus.Healthy },
{ id: RolloutStatus.Paused, title: RolloutStatus.Paused },
Expand Down
16 changes: 9 additions & 7 deletions src/gitops/components/rollout/components/PodList/PodList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import {
} from '@gitops/components/shared/ColumnManagement';
import {
GitOpsDataViewTable,
GitOpsListPagination,
useGitOpsDataViewSort,
useGitOpsListPagePagination,
} from '@gitops/components/shared/DataView';
import { GitOpsListPageToolbar } from '@gitops/components/shared/GitOpsListPageToolbar';
import { matchesSelectedStatusPhase } from '@gitops/components/rollout/utils/rollout-utils';
import {
getRolloutPodsManagedColumns,
ROLLOUT_PODS_COLUMN_MANAGEMENT_ID,
Expand Down Expand Up @@ -149,13 +151,7 @@ const getFilters = (t: (key: string) => string): RowFilter[] => [
filterGroupName: t('Health Status'),
type: 'app-health',
reducer: (pod) => pod.status?.phase,
filter: (input, pod) => {
if (input.selected?.length && pod?.status?.phase) {
return input.selected.includes(pod.status.phase);
} else {
return true;
}
},
filter: (input, pod) => matchesSelectedStatusPhase(input.selected, pod?.status?.phase),
items: [
{ id: PodStatus.RUNNING, title: PodStatus.RUNNING },
{ id: PodStatus.PENDING, title: PodStatus.PENDING },
Expand Down Expand Up @@ -447,6 +443,11 @@ export const PodList: React.FC<PodListProps> = ({ rollout, namespace, selector }
/>
}
columnManagement={columnManagement}
pagination={
itemCount > 0 && !loadError ? (
<GitOpsListPagination itemCount={itemCount} pagination={pagination} />
) : undefined
}
/>
<GitOpsDataViewTable
columns={columns}
Expand All @@ -457,6 +458,7 @@ export const PodList: React.FC<PodListProps> = ({ rollout, namespace, selector }
isError={!!loadError}
itemCount={itemCount}
pagination={pagination}
showTopPagination={false}
/>
</ListPageBody>
</div>
Expand Down
Loading
Loading