Skip to content

Commit

Permalink
Add comments / param is now 'package' / Sort by date DESC
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfacq committed Aug 16, 2023
1 parent d14ea62 commit 6107e2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/components/DownloadDropdowns/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,28 @@ const DownloadDropdowns = ({updaterAction, marketplace, Table}) => {
}
`)

// init the default selected Operation System, if any from the param 'os'
let defaultSelectedOS = 'any';
const osParam = queryString.parse(useLocation().search).os;
if (osParam) {
defaultSelectedOS = osParam.toString();
}

Check warning on line 39 in src/components/DownloadDropdowns/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/DownloadDropdowns/index.tsx#L38-L39

Added lines #L38 - L39 were not covered by tests

// init the default selected Architecture, if any from the param 'arch'
let defaultSelectedArch = 'any';
const archParam = queryString.parse(useLocation().search).arch;
if (archParam) {
defaultSelectedArch = archParam.toString();
}

Check warning on line 46 in src/components/DownloadDropdowns/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/DownloadDropdowns/index.tsx#L45-L46

Added lines #L45 - L46 were not covered by tests

// init the default selected Package Type, if any from the param 'package'
let defaultSelectedPackageType = 'any';
const packageTypeParam = queryString.parse(useLocation().search).packageType;
if (packageTypeParam) {
defaultSelectedPackageType = packageTypeParam.toString();
const packageParam = queryString.parse(useLocation().search).package;
if (packageParam) {
defaultSelectedPackageType = packageParam.toString();
}

Check warning on line 53 in src/components/DownloadDropdowns/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/DownloadDropdowns/index.tsx#L52-L53

Added lines #L52 - L53 were not covered by tests

// init the default selected Version, if any from the param 'version' or from 'variant'
let defaultSelectedVersion = data.mostRecentLts.version;
const versionParam = queryString.parse(useLocation().search).version;
if (versionParam) {
Expand Down Expand Up @@ -125,7 +129,7 @@ const DownloadDropdowns = ({updaterAction, marketplace, Table}) => {
}, []);

const setPackageType = useCallback((packageType) => {
setURLParam('packageType', packageType)
setURLParam('package', packageType)
updatePackageType(packageType);
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/components/TemurinDownloadTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const TemurinDownloadTable = ({results}) => {
<table id="download-table" className="table table-bordered releases-table" style={{borderSpacing: '0 10px', borderCollapse: 'separate'}}>
<tbody className="table-light">
{results ? (
results.map(
results.sort((pkg1, pkg2) => pkg2.release_date - pkg1.release_date).map(
(pkg, i): string | JSX.Element =>
pkg && (
<tr key={i}>
Expand Down

0 comments on commit 6107e2e

Please sign in to comment.