-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable old and new data dictionary for VA
- Loading branch information
1 parent
7d03acf
commit 0b28e93
Showing
2 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 25 additions & 12 deletions
37
src/Analysis/AtlasDataDictionary/AtlasDataDictionaryContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { useLocation, useHistory, useRouteMatch } from 'react-router-dom'; | ||
import ProtectedContent from '../../Login/ProtectedContent'; | ||
import AtlasDataDictionaryLoading from './AtlasDataDictionaryTable/AtlasDataDictionaryLoading'; | ||
import AtlasDataDictionaryButton from './AtlasDataDictionaryButton/AtlasDataDictionaryButton'; | ||
import './AtlasDataDictionary.css'; | ||
|
||
const AtlasDataDictionaryContainer = () => { | ||
const AtlasDataDictionaryContainer = ({ title }) => { | ||
const location = useLocation(); | ||
const history = useHistory(); | ||
const match = useRouteMatch(); | ||
return ( | ||
<div className='atlas-data-dictionary-container'> | ||
<ProtectedContent | ||
public | ||
location={location} | ||
history={history} | ||
match={match} | ||
component={() => <AtlasDataDictionaryLoading />} | ||
/> | ||
</div> | ||
); | ||
|
||
if (!title || !title.includes('(new)')) { | ||
// Legacy component: render a div with AtlasDataDictionaryButton when title does not include '(new)' | ||
return ( | ||
<div style={{ width: '100%' }}><AtlasDataDictionaryButton /></div> | ||
); | ||
} else { | ||
return ( | ||
<div className='atlas-data-dictionary-container'> | ||
<ProtectedContent | ||
public | ||
location={location} | ||
history={history} | ||
match={match} | ||
component={() => <AtlasDataDictionaryLoading />} | ||
/> | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
AtlasDataDictionaryContainer.propTypes = { | ||
title: PropTypes.string, | ||
}; | ||
export default AtlasDataDictionaryContainer; |