import SourceViewer from './../../../components/source-viewer/SourceViewer';
import Search from './Search';
import ListFooter from '../../../components/controls/ListFooter';
-import { retrieveComponentBase, retrieveComponent, loadMoreChildren, parseError } from '../utils';
-import { addComponentBreadcrumbs } from '../bucket';
+import { retrieveComponentChildren, retrieveComponent, loadMoreChildren, parseError } from '../utils';
+import { addComponent, addComponentBreadcrumbs } from '../bucket';
import { selectCoverageMetric } from '../../../helpers/measures';
import '../code.css';
this.setState({ loading: true });
const isView = component.qualifier === 'VW' || component.qualifier === 'SVW';
- retrieveComponentBase(component.key, isView).then(component => {
- const prefix = selectCoverageMetric(component.measures);
+ retrieveComponentChildren(component.key, isView).then(r => {
+ addComponent(r.baseComponent);
+ const prefix = selectCoverageMetric(r.baseComponent.measures);
this.coverageMetric = `${prefix}coverage`;
this.handleUpdate();
}).catch(e => {
return {
components: r.components,
total: r.paging.total,
- page: r.paging.pageIndex
+ page: r.paging.pageIndex,
+ baseComponent: r.baseComponent
};
}
* @param {boolean} isView
* @returns {Promise}
*/
-export function retrieveComponentBase (componentKey, isView) {
+function retrieveComponentBase (componentKey, isView) {
const existing = getComponentFromBucket(componentKey);
if (existing) {
return Promise.resolve(existing);
* @param {boolean} isView
* @returns {Promise}
*/
-function retrieveComponentChildren (componentKey, isView) {
+export function retrieveComponentChildren (componentKey, isView) {
const existing = getComponentChildren(componentKey);
if (existing) {
return Promise.resolve({