@@ -93,6 +93,7 @@ import {
9393 selectModules ,
9494 selectPackages ,
9595 selectRecommendedRepositories ,
96+ selectSnapshotDate ,
9697 selectTemplate ,
9798} from '../../../../store/wizardSlice' ;
9899import {
@@ -101,6 +102,7 @@ import {
101102 getEpelVersionForDistribution ,
102103} from '../../../../Utilities/epel' ;
103104import useDebounce from '../../../../Utilities/useDebounce' ;
105+ import { convertStringToDate } from '../../../../Utilities/time' ;
104106
105107export type PackageRepository = 'distro' | 'custom' | 'recommended' | '' ;
106108
@@ -144,6 +146,7 @@ const Packages = () => {
144146 const groups = useAppSelector ( selectGroups ) ;
145147 const modules = useAppSelector ( selectModules ) ;
146148 const template = useAppSelector ( selectTemplate ) ;
149+ const snapshotDate = useAppSelector ( selectSnapshotDate ) ;
147150
148151 const { data : templateData } = useGetTemplateQuery ( {
149152 uuid : template ,
@@ -298,6 +301,7 @@ const Packages = () => {
298301 ) ,
299302 limit : 500 ,
300303 include_package_sources : true ,
304+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
301305 } ,
302306 } ) ;
303307 }
@@ -312,13 +316,15 @@ const Packages = () => {
312316 } ) ,
313317 limit : 500 ,
314318 include_package_sources : true ,
319+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
315320 } ,
316321 } ) ;
317322 } else {
318323 searchRecommendedRpms ( {
319324 apiContentUnitSearchRequest : {
320325 search : debouncedSearchTerm ,
321326 urls : [ epelRepoUrlByDistribution ] ,
327+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
322328 } ,
323329 } ) ;
324330 }
@@ -337,6 +343,7 @@ const Packages = () => {
337343 template ,
338344 distribution ,
339345 debouncedSearchTermIsGroup ,
346+ snapshotDate ,
340347 ] ) ;
341348
342349 useEffect ( ( ) => {
@@ -346,7 +353,7 @@ const Packages = () => {
346353 if ( isSuccessDistroRepositories ) {
347354 searchDistroGroups ( {
348355 apiContentUnitSearchRequest : {
349- search : debouncedSearchTerm . substr ( 1 ) ,
356+ search : debouncedSearchTerm . substring ( 1 ) ,
350357 urls : distroRepositories
351358 ?. filter ( ( archItem ) => {
352359 return archItem . arch === arch ;
@@ -357,23 +364,26 @@ const Packages = () => {
357364 }
358365 return repo . baseurl ;
359366 } ) ,
367+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
360368 } ,
361369 } ) ;
362370 }
363371 if ( activeTabKey === Repos . INCLUDED && customRepositories . length > 0 ) {
364372 searchCustomGroups ( {
365373 apiContentUnitSearchRequest : {
366- search : debouncedSearchTerm . substr ( 1 ) ,
374+ search : debouncedSearchTerm . substring ( 1 ) ,
367375 uuids : customRepositories . flatMap ( ( repo ) => {
368376 return repo . id ;
369377 } ) ,
378+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
370379 } ,
371380 } ) ;
372381 } else if ( activeTabKey === Repos . OTHER && isSuccessEpelRepo ) {
373382 searchRecommendedGroups ( {
374383 apiContentUnitSearchRequest : {
375- search : debouncedSearchTerm . substr ( 1 ) ,
384+ search : debouncedSearchTerm . substring ( 1 ) ,
376385 urls : [ epelRepoUrlByDistribution ] ,
386+ date : ! ! snapshotDate ? new Date ( convertStringToDate ( snapshotDate ) ) . toISOString ( ) : undefined ,
377387 } ,
378388 } ) ;
379389 }
@@ -390,6 +400,7 @@ const Packages = () => {
390400 distroRepositories ,
391401 isSuccessDistroRepositories ,
392402 isSuccessEpelRepo ,
403+ snapshotDate ,
393404 ] ) ;
394405
395406 const EmptySearch = ( ) => {
@@ -1438,6 +1449,7 @@ const Packages = () => {
14381449 toggleSelected ,
14391450 activeTabKey ,
14401451 transformedPackages ,
1452+ transformedGroups ,
14411453 isSelectingPackage ,
14421454 recommendedRepositories ,
14431455 transformedPackages . length ,
0 commit comments