Skip to content

Commit

Permalink
Source Home | Breadcrumbs to have version selector
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Dec 3, 2021
1 parent db483bc commit 968d48f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/sources/SourceHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class SourceHome extends React.Component {
currentURL={currentURL}
config={selectedConfig}
splitView={splitView}
versions={versions}
/>
<Split className='split' sizes={splitViewSizes} minSize={[50, 0]}>
{tabsView}
Expand Down
16 changes: 6 additions & 10 deletions src/components/sources/SourceHomeHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import {
import { Tooltip, ButtonGroup, Button, Collapse } from '@mui/material';
import { isEmpty, map, filter, get } from 'lodash';
import { toFullAPIURL, copyURL, nonEmptyCount, currentUserHasAccess } from '../../common/utils';
import { GREEN } from '../../common/constants';
import APIService from '../../services/APIService';
import OwnerButton from '../common/OwnerButton';
import SourceButton from '../common/SourceButton';
import VersionButton from '../common/VersionButton';
import LastUpdatedOnLabel from '../common/LastUpdatedOnLabel';
import ExternalIdLabel from '../common/ExternalIdLabel';
import LinkLabel from '../common/LinkLabel';
Expand All @@ -32,12 +30,13 @@ import ProcessingChip from '../common/ProcessingChip';
import ConceptContainerDelete from '../common/ConceptContainerDelete';
import CollapsibleDivider from '../common/CollapsibleDivider';
import { SOURCE_DEFAULT_CONFIG } from '../../common/defaultConfigs';
import VersionSelectorButton from '../common/VersionSelectorButton';

const DEFAULT_VISIBLE_ATTRIBUTES = SOURCE_DEFAULT_CONFIG.config.header.visibleAttributes
const DEFAULT_INVISIBLE_ATTRIBUTES = SOURCE_DEFAULT_CONFIG.config.header.invisibleAttributes

const SourceHomeHeader = ({
source, isVersionedObject, versionedObjectURL, currentURL, config, splitView
source, isVersionedObject, versionedObjectURL, currentURL, config, splitView, versions
}) => {
const downloadFileName = isVersionedObject ? `${source.type}-${source.short_code}` : `${source.type}-${source.short_code}-${source.id}`;
const hasAccess = currentUserHasAccess();
Expand Down Expand Up @@ -116,13 +115,10 @@ const SourceHomeHeader = ({
<OwnerButton {...source} href={versionedObjectURL} />
<span className='separator'>/</span>
<SourceButton label={source.short_code} href={`#${versionedObjectURL}`} />
{
!isVersionedObject &&
<React.Fragment>
<span className='separator'>/</span>
<VersionButton label={source.version} href={`#${currentURL}`} bgColor={GREEN} />
</React.Fragment>
}
<React.Fragment>
<span className='separator'>/</span>
<VersionSelectorButton selected={source} versions={versions} />
</React.Fragment>
{
source.retired &&
<span style={{marginLeft: '10px'}}>
Expand Down

0 comments on commit 968d48f

Please sign in to comment.