Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { collectionMetadata, getSource } from '../../modules/collection';

import styles from './sidebar-collection.less';

const DEFAULT_COLLECTION_TYPE = 'collection';
const TIME_SERIES_COLLECTION_TYPE = 'timeseries';

class SidebarCollection extends PureComponent {
Expand Down Expand Up @@ -137,6 +138,16 @@ class SidebarCollection extends PureComponent {
}
}

renderCollectionIcon() {
return (
<Icon
className={styles['compass-sidebar-collection-type-icon']}
glyph="Folder"
title="Collection"
/>
);
}

/**
* Render the readonly icon.
*
Expand Down Expand Up @@ -230,6 +241,7 @@ class SidebarCollection extends PureComponent {
data-test-id="sidebar-collection"
title={this.props._id}
>
{this.props.type === DEFAULT_COLLECTION_TYPE && this.renderCollectionIcon()}
{this.props.readonly && this.renderViewIcon()}
{this.props.type === TIME_SERIES_COLLECTION_TYPE && this.renderTimeSeriesIcon()}
{collectionName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('SidebarCollection [Component]', () => {
description="description"
activeNamespace=""
globalAppRegistryEmit={emitSpy}
type="collection"
/>);
});

Expand All @@ -44,8 +45,8 @@ describe('SidebarCollection [Component]', () => {
expect(component.find('[data-test-id="sidebar-collection"]').text()).to.match(/coll/);
});

it('does not have a collection type icon', () => {
expect(component.find(Icon)).to.be.not.present();
it('has a collection type icon', () => {
expect(component.find(Icon).props().glyph).to.equal('Folder');
});
});

Expand Down