@@ -48,6 +48,7 @@ export class AnalysisComponent implements OnDestroy, OnInit {
4848 gridTheme$ = this . _configService . gridTheme$
4949 gridHeight = 0
5050 messages : AnalysesMessage [ ]
51+ originalViews : Record < number , number >
5152 orgId : number
5253 views : View [ ] = [ ]
5354 gridViews : ( View & { messages ?: string [ ] } ) [ ] = [ ]
@@ -81,20 +82,24 @@ export class AnalysisComponent implements OnDestroy, OnInit {
8182 this . _analysisService . getAnalysisViews ( this . orgId , this . analysisId )
8283 this . _analysisService . getMessages ( this . orgId , this . analysisId )
8384
84- combineLatest ( [ this . _analysisService . analysis$ , this . _analysisService . views$ , this . _analysisService . messages$ ] )
85- . pipe (
86- filter ( ( [ analysis , views ] ) => ! ! analysis && views . length && analysis . id === this . analysisId ) ,
87- takeUntil ( this . _unsubscribeAll$ ) ,
88- tap ( ( [ analysis , views , messages ] ) => {
89- this . analysis = analysis
90- this . views = views
91- this . messages = messages
92- this . analysisDescription = this . _analysisService . getAnalysisDescription ( analysis )
93- this . formatViews ( )
94- this . setColumnDefs ( )
95- } ) ,
96- )
97- . subscribe ( )
85+ combineLatest ( [
86+ this . _analysisService . analysis$ ,
87+ this . _analysisService . views$ ,
88+ this . _analysisService . messages$ ,
89+ this . _analysisService . originalViews$ ,
90+ ] ) . pipe (
91+ filter ( ( [ analysis , views ] ) => ! ! analysis && views . length && analysis . id === this . analysisId ) ,
92+ takeUntil ( this . _unsubscribeAll$ ) ,
93+ tap ( ( [ analysis , views , messages , originalViews ] ) => {
94+ this . analysis = analysis
95+ this . views = views
96+ this . messages = messages
97+ this . originalViews = originalViews
98+ this . analysisDescription = this . _analysisService . getAnalysisDescription ( analysis )
99+ this . formatViews ( )
100+ this . setColumnDefs ( )
101+ } ) ,
102+ ) . subscribe ( )
98103 }
99104
100105 formatViews ( ) {
@@ -216,10 +221,12 @@ export class AnalysisComponent implements OnDestroy, OnInit {
216221
217222 const target = event . event . target as HTMLElement
218223 const action = target . getAttribute ( 'data-action' )
219- const { id, output_files, property } = event . data as View
224+ const { id, output_files } = event . data as View
220225
221226 if ( action === 'viewProperty' ) {
222- void this . _router . navigate ( [ `/properties/${ property } ` ] )
227+ // map viewId to propertyViewId
228+ const propertyViewId : number = this . originalViews [ id ]
229+ void this . _router . navigate ( [ `/properties/${ propertyViewId } ` ] )
223230 } else if ( action === 'viewResults' ) {
224231 void this . _router . navigate ( [ `/analyses/${ this . analysisId } /views/${ id } ` ] )
225232 // this.viewResults(id)
0 commit comments