@@ -16,10 +16,12 @@ import type {FilterEntryContextMenuItems} from 'ui/components/EntryContextMenu';
1616import { CounterName , GoalId , reachMetricaGoal } from 'ui/libs/metrica' ;
1717import { registry } from 'ui/registry' ;
1818import type { BreadcrumbsItem } from 'ui/registry/units/common/types/components/EntryBreadcrumbs' ;
19- import { getCollectionBreadcrumbs } from 'ui/store/actions/collectionsStructure' ;
20- import { selectGetCollectionBreadcrumbs } from 'ui/store/selectors/collectionsStructure' ;
21- import { addWorkbookInfo , resetWorkbookPermissions } from 'units/workbooks/store/actions' ;
22- import { selectWorkbookBreadcrumbs , selectWorkbookName } from 'units/workbooks/store/selectors' ;
19+ import {
20+ addCollectionBreadcrumbs ,
21+ addWorkbookInfo ,
22+ resetWorkbookPermissions ,
23+ } from 'units/workbooks/store/actions' ;
24+ import { selectEntityBreadcrumbs , selectWorkbookName } from 'units/workbooks/store/selectors' ;
2325
2426import type { GetEntryResponse } from '../../../../../shared/schema' ;
2527import { DL } from '../../../../constants/common' ;
@@ -109,9 +111,8 @@ class EntryPanel extends React.Component<Props, State> {
109111
110112 if ( workbookId ) {
111113 this . props . actions . addWorkbookInfo ( workbookId , true ) ;
112- }
113- if ( collectionId ) {
114- this . props . actions . getCollectionBreadcrumbs ( { collectionId} ) ;
114+ } else if ( collectionId ) {
115+ this . props . actions . addCollectionBreadcrumbs ( { collectionId} ) ;
115116 }
116117 }
117118
@@ -123,19 +124,17 @@ class EntryPanel extends React.Component<Props, State> {
123124
124125 if ( prevWorkbookId !== workbookId && workbookId ) {
125126 this . props . actions . addWorkbookInfo ( workbookId , true ) ;
127+ } else if ( prevCollectionId !== collectionId && collectionId ) {
128+ this . props . actions . addCollectionBreadcrumbs ( { collectionId} ) ;
126129 }
127130
128131 if ( prevWorkbookId && ! workbookId ) {
129132 this . props . actions . resetWorkbookPermissions ( ) ;
130133 }
131-
132- if ( prevCollectionId !== collectionId && collectionId ) {
133- this . props . actions . getCollectionBreadcrumbs ( { collectionId} ) ;
134- }
135134 }
136135
137136 render ( ) {
138- const { children, workbookName, workbookBreadcrumbs , collectionBreadcrumbs } = this . props ;
137+ const { children, workbookName, entityBreadcrumbs } = this . props ;
139138 const { EntryBreadcrumbs} = registry . common . components . getAll ( ) ;
140139
141140 return (
@@ -145,7 +144,7 @@ class EntryPanel extends React.Component<Props, State> {
145144 renderRootContent = { this . renderRootContent }
146145 entry = { this . state . entry }
147146 workbookName = { workbookName }
148- entityBreadcrumbs = { workbookBreadcrumbs ?? collectionBreadcrumbs . data }
147+ entityBreadcrumbs = { entityBreadcrumbs }
149148 endContent = {
150149 < React . Fragment >
151150 { this . renderControls ( ) }
@@ -342,16 +341,15 @@ const mapStateToProps = (state: DatalensGlobalState, ownProps: OwnProps) => {
342341
343342 return {
344343 workbookName : selectWorkbookName ( state , workbookId ) ,
345- workbookBreadcrumbs : selectWorkbookBreadcrumbs ( state ) ,
346- collectionBreadcrumbs : selectGetCollectionBreadcrumbs ( state ) ,
344+ entityBreadcrumbs : selectEntityBreadcrumbs ( state ) ,
347345 } ;
348346} ;
349347
350348const mapDispatchToProps = ( dispatch : Dispatch ) => {
351349 return {
352350 actions : bindActionCreators (
353351 {
354- getCollectionBreadcrumbs ,
352+ addCollectionBreadcrumbs ,
355353 addWorkbookInfo,
356354 resetWorkbookPermissions,
357355 } ,
0 commit comments