diff --git a/catalog-rest-service/src/main/resources/ui/src/constants/constants.ts b/catalog-rest-service/src/main/resources/ui/src/constants/constants.ts index 21b3f81d5c2..401777e284e 100644 --- a/catalog-rest-service/src/main/resources/ui/src/constants/constants.ts +++ b/catalog-rest-service/src/main/resources/ui/src/constants/constants.ts @@ -50,7 +50,7 @@ export const tiers = [ export const tableSortingFields = [ { - name: 'Last Updated Timestamp', + name: 'Last Updated', value: 'last_updated_timestamp', }, { name: 'Weekly Usage', value: 'weekly_stats' }, diff --git a/catalog-rest-service/src/main/resources/ui/src/pages/explore/index.tsx b/catalog-rest-service/src/main/resources/ui/src/pages/explore/index.tsx index f75430fd4cb..608f9a0ecd8 100644 --- a/catalog-rest-service/src/main/resources/ui/src/pages/explore/index.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/pages/explore/index.tsx @@ -16,6 +16,7 @@ */ import { AxiosError } from 'axios'; +import classNames from 'classnames'; import { cloneDeep } from 'lodash'; import { AggregationType, @@ -35,7 +36,6 @@ import { ERROR404, ERROR500, PAGE_SIZE, - sortingOrder, tableSortingFields, topicSortingFields, } from '../../constants/constants'; @@ -87,7 +87,6 @@ const ExplorePage: React.FC = (): React.ReactElement => { const [searchTag, setSearchTag] = useState(location.search); const [error, setError] = useState(''); const [fieldListVisible, setFieldListVisible] = useState(false); - const [orderListVisible, setOrderListVisible] = useState(false); const [sortField, setSortField] = useState('last_updated_timestamp'); const [sortOrder, setSortOrder] = useState('desc'); const [searchIndex, setSearchIndex] = useState(SearchIndex.TABLE); @@ -278,12 +277,8 @@ const ExplorePage: React.FC = (): React.ReactElement => { setSortField(value || 'last_updated_timestamp'); setFieldListVisible(false); }; - const handleOrderDropDown = ( - _e: React.MouseEvent, - value?: string - ) => { - setSortOrder(value || 'desc'); - setOrderListVisible(false); + const handleOrder = (value: string) => { + setSortOrder(value); }; const getSortingElements = () => { @@ -313,26 +308,24 @@ const ExplorePage: React.FC = (): React.ReactElement => { )} -
- Order by : - - - {orderListVisible && ( - + {sortOrder === 'asc' ? ( + + ) : ( + + )}
);