Skip to content

Commit

Permalink
[frontend] trash sorting using runtimeField
Browse files Browse the repository at this point in the history
  • Loading branch information
labo-flg committed Apr 4, 2024
1 parent 67ef5ff commit b92e137
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import type { DeleteOperationsLinesPaginationQuery, DeleteOperationsLinesPaginationQuery$variables } from './all/__generated__/DeleteOperationsLinesPaginationQuery.graphql';
import { DataColumns } from '../../../components/list_lines';
import useAuth from '../../../utils/hooks/useAuth';

const LOCAL_STORAGE_KEY = 'trash';

Expand Down Expand Up @@ -37,12 +38,17 @@ const Trash: React.FC = () => {
orderAsc,
} = viewStorage;

const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();

const queryRef = useQueryLoading<DeleteOperationsLinesPaginationQuery>(
deleteOperationsLinesQuery,
paginationOptions,
);

const renderLines = () => {
const isRuntimeSort = isRuntimeFieldEnable() ?? false;
const dataColumns: DataColumns = {
main_entity_type: {
label: 'Type',
Expand All @@ -57,7 +63,7 @@ const Trash: React.FC = () => {
deletedBy: {
label: 'Deleted by',
width: '25%',
isSortable: true,
isSortable: isRuntimeSort,
},
timestamp: {
label: 'Deletion date',
Expand Down

0 comments on commit b92e137

Please sign in to comment.