@@ -530,13 +530,11 @@ export const WorkspaceData = _.flow(
530530 const forceRefresh = ( ) => setRefreshKey ( _ . add ( 1 ) ) ;
531531 const [ selectedData , setSelectedData ] = useState ( ( ) => StateHistory . get ( ) . selectedData ) ;
532532 const [ entityMetadata , setEntityMetadata ] = useState ( ( ) => StateHistory . get ( ) . entityMetadata ) ;
533- const [ snapshotDetails , setSnapshotDetails ] = useState ( ( ) => StateHistory . get ( ) . snapshotDetails ) ;
534533 const [ importingReference , setImportingReference ] = useState ( false ) ;
535534 const [ deletingReference , setDeletingReference ] = useState ( undefined ) ;
536535 const [ uploadingFile , setUploadingFile ] = useState ( false ) ;
537536 const [ uploadingWDSFile , setUploadingWDSFile ] = useState ( false ) ;
538537 const [ entityMetadataError , setEntityMetadataError ] = useState ( ) ;
539- const [ snapshotMetadataError , setSnapshotMetadataError ] = useState ( ) ;
540538 const [ sidebarWidth , setSidebarWidth ] = useState ( 280 ) ;
541539 const [ activeCrossTableTextFilter , setActiveCrossTableTextFilter ] = useState ( '' ) ;
542540 const [ crossTableResultCounts , setCrossTableResultCounts ] = useState ( { } ) ;
@@ -575,36 +573,8 @@ export const WorkspaceData = _.flow(
575573 }
576574 } ;
577575
578- const loadSnapshotMetadata = async ( ) => {
579- try {
580- setSnapshotMetadataError ( false ) ;
581- const { gcpDataRepoSnapshots : snapshotBody } = await Workspaces ( signal ) . workspace ( namespace , name ) . listSnapshots ( 1000 , 0 ) ;
582-
583- const snapshots = _ . reduce (
584- ( acc , { metadata : { name, ...metadata } , attributes } ) => {
585- return _ . set ( [ name , 'resource' ] , _ . merge ( metadata , attributes ) , acc ) ;
586- } ,
587- _ . pick ( _ . map ( 'name' , _ . map ( 'metadata' , snapshotBody ) ) , snapshotDetails ) || { } , // retain entities if loaded from state history, but only for snapshots that exist
588- _ . filter ( ( snapshot ) => {
589- // Do not display snapshot references that are only created for linking policies.
590- const isForPolicy = snapshot . metadata . properties . some ( ( p ) => p . key === 'purpose' && p . value === 'policy' ) ;
591- return ! isForPolicy ;
592- } , snapshotBody )
593- ) ;
594-
595- setSnapshotDetails ( snapshots ) ;
596- } catch ( error ) {
597- reportError ( 'Error loading workspace snapshot data' , error ) ;
598- setSnapshotMetadataError ( true ) ;
599- setSelectedData ( undefined ) ;
600- setSnapshotDetails ( { } ) ;
601- }
602- } ;
603-
604576 const loadMetadata = ( ) =>
605- isAzureWorkspace
606- ? Promise . all ( [ refreshRunningImportJobs ( ) , loadWdsData ( ) ] )
607- : Promise . all ( [ loadEntityMetadata ( ) , loadSnapshotMetadata ( ) , refreshRunningImportJobs ( ) ] ) ;
577+ isAzureWorkspace ? Promise . all ( [ refreshRunningImportJobs ( ) , loadWdsData ( ) ] ) : Promise . all ( [ loadEntityMetadata ( ) , refreshRunningImportJobs ( ) ] ) ;
608578
609579 const toSortedPairs = _ . flow ( _ . toPairs , _ . sortBy ( _ . first ) ) ;
610580
@@ -638,8 +608,8 @@ export const WorkspaceData = _.flow(
638608 } ) ;
639609
640610 useEffect ( ( ) => {
641- StateHistory . update ( { entityMetadata, selectedData, snapshotDetails } ) ;
642- } , [ entityMetadata , selectedData , snapshotDetails ] ) ;
611+ StateHistory . update ( { entityMetadata, selectedData } ) ;
612+ } , [ entityMetadata , selectedData ] ) ;
643613
644614 useImperativeHandle ( ref , ( ) => ( {
645615 refresh : ( ) => {
@@ -651,7 +621,6 @@ export const WorkspaceData = _.flow(
651621 // Render
652622 const referenceData = getReferenceData ( attributes ) ;
653623 const sortedEntityPairs = toSortedPairs ( entityMetadata ) ;
654- const sortedSnapshotPairs = toSortedPairs ( snapshotDetails ) ;
655624
656625 const { value : canEditWorkspace , message : editWorkspaceErrorMessage } = WorkspaceUtils . canEditWorkspace ( workspace ) ;
657626
@@ -664,7 +633,6 @@ export const WorkspaceData = _.flow(
664633 useEffect ( ( ) => {
665634 if ( isAzureWorkspace ) {
666635 // These aren't needed for Azure workspaces; just set them to empty objects
667- setSnapshotMetadataError ( false ) ;
668636 setEntityMetadata ( { } ) ;
669637
670638 if ( ! wdsReady && ! wdsError && ! pollWdsInterval . current ) {
@@ -908,26 +876,6 @@ export const WorkspaceData = _.flow(
908876 } , wdsTypes . state ) ,
909877 ]
910878 ) ,
911- ( ! _ . isEmpty ( sortedSnapshotPairs ) || snapshotMetadataError ) &&
912- isGoogleWorkspace &&
913- h (
914- DataTypeSection ,
915- {
916- title : 'Snapshots' ,
917- error : snapshotMetadataError ,
918- retryFunction : loadSnapshotMetadata ,
919- } ,
920- [
921- div (
922- // File Browser Banner
923- { style : { padding : '1rem' , margin : '0.75rem' , backgroundColor : colors . dark ( 0.1 ) , borderRadius : '0.5rem' } } ,
924- [
925- span ( { style : { fontWeight : 'bold' } } , [ 'Looking for your snapshots?' ] ) ,
926- div ( [ 'Snapshots of this type are no longer supported in this workspace. Please contact support for assistance.' ] ) ,
927- ]
928- ) ,
929- ]
930- ) ,
931879 isGoogleWorkspace &&
932880 h (
933881 DataTypeSection ,
0 commit comments