diff --git a/package-lock.json b/package-lock.json index 3aaa92503..ec0f5b60d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -488,11 +488,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dependencies": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -631,12 +631,12 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -853,9 +853,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "bin": { "parser": "bin/babel-parser.js" }, @@ -2201,18 +2201,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", - "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dependencies": { "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/generator": "^7.23.0", "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2221,12 +2221,12 @@ } }, "node_modules/@babel/types": { - "version": "7.22.19", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", - "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.19", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { diff --git a/src/l10n/en.json b/src/l10n/en.json index ceb630447..58fe8f47f 100644 --- a/src/l10n/en.json +++ b/src/l10n/en.json @@ -1185,6 +1185,7 @@ "requestDataInfo": "Do you want to request data, APIs, or anything else you can do it here. You will be redirected to datalandsbyen.no.", "newestToOldest": "Newest to Oldest", "mostVotes": "Most Votes", - "mostViews": "Most Views" + "mostViews": "Most Views", + "view": "View" } } diff --git a/src/l10n/nb.json b/src/l10n/nb.json index 2555a2b39..4dcd9da21 100644 --- a/src/l10n/nb.json +++ b/src/l10n/nb.json @@ -1185,6 +1185,7 @@ "requestDataInfo": "Ønsker du å etterspørre data, APIer eller annet du kan gjøre det her. Du blir sendt til datalandsbyen.no.", "newestToOldest": "Nyeste til eldste", "mostVotes": "Flest stemmer", - "mostViews": "Flest visninger" + "mostViews": "Flest visninger", + "view": "Visning" } } diff --git a/src/l10n/nn.json b/src/l10n/nn.json index 38ef18fdb..f42a1c93e 100644 --- a/src/l10n/nn.json +++ b/src/l10n/nn.json @@ -1185,6 +1185,7 @@ "requestDataInfo": "Ynskjer du å etterspørre data, APIer eller anna kan du gjere det her. Du blir sendt til datalandsbyen.no.", "newestToOldest": "Nyeste til eldste", "mostVotes": "Flest stemmer", - "mostViews": "Flest visningar" + "mostViews": "Flest visningar", + "view": "Visning" } } diff --git a/src/pages/requests/index.tsx b/src/pages/requests/index.tsx index 66b6a1efb..51e45a96d 100644 --- a/src/pages/requests/index.tsx +++ b/src/pages/requests/index.tsx @@ -2,6 +2,7 @@ import React, { FC, useEffect, useState } from 'react'; import { compose } from 'redux'; import Link from '@fellesdatakatalog/link'; import Button from '@fellesdatakatalog/button'; +import Select from 'react-select'; import withCommunity, { Props as CommunityProps } from '../../components/with-community'; @@ -12,6 +13,7 @@ import { formatDate } from '../../lib/date-utils'; import Banner from '../../components/banner'; import localization from '../../lib/localization'; import env from '../../env'; +import { SelectOption } from '../../types'; const { FDK_COMMUNITY_BASE_URI } = env; interface Props extends CommunityProps {} @@ -27,6 +29,21 @@ const RequestsPage: FC = ({ const notDeletedRequests = topics?.filter(topic => topic.deleted === 0); const [search, setSearch] = useState(''); + const sortOptions: SelectOption[] = [ + { + value: 'timestamp', + label: localization.requestsPage.newestToOldest + }, + { + value: 'upvotes', + label: localization.requestsPage.mostVotes + }, + { + value: 'topic.viewcount', + label: localization.requestsPage.mostViews + } + ]; + return ( <> @@ -54,28 +71,26 @@ const RequestsPage: FC = ({ - - - - - - - setSearch(event.target.value)} +
+

{localization.requestsPage.view}

+ setSearch(event.target.value)} + /> + + +