@@ -4,22 +4,18 @@ import Paper from '@mui/material/Paper'
44import Button from '@mui/material/Button' ;
55import Typography from '@mui/material/Typography' ;
66import DownIcon from '@mui/icons-material/ArrowDropDown' ;
7- import { uniq , compact , has } from 'lodash'
7+ import { has } from 'lodash'
88import RepoVersionChip from './RepoVersionChip' ;
99import RepoChip from './RepoChip'
10- import DotSeparator from '../common/DotSeparator' ;
1110import OwnerChip from '../common/OwnerChip' ;
12- import { PRIMARY_COLORS } from '../../common/colors' ;
13- import { formatDate , currentUserHasAccess } from '../../common/utils' ;
11+ import { currentUserHasAccess } from '../../common/utils' ;
1412import RepoManagementList from './RepoManagementList' ;
1513import FollowActionButton from '../common/FollowActionButton'
16- import EntityAttributesDialog from '../common/EntityAttributesDialog'
1714
18- const RepoHeader = ( { repo, owner, versions, onVersionChange, onCreateConceptClick, onCreateMappingClick, onVersionEditClick, essentials , onCreateVersionClick, onDeleteRepoClick, isVersion, onReleaseVersionClick} ) => {
15+ const RepoHeader = ( { repo, owner, versions, onVersionChange, onCreateConceptClick, onCreateMappingClick, onVersionEditClick, onCreateVersionClick, onDeleteRepoClick, isVersion, onReleaseVersionClick} ) => {
1916 const { t } = useTranslation ( )
2017 const [ menu , setMenu ] = React . useState ( false )
2118 const [ menuAnchorEl , setMenuAnchorEl ] = React . useState ( false )
22- const [ viewAll , setViewAll ] = React . useState ( false )
2319 const onMenuOpen = event => {
2420 setMenuAnchorEl ( event . currentTarget )
2521 setMenu ( true )
@@ -45,14 +41,6 @@ const RepoHeader = ({repo, owner, versions, onVersionChange, onCreateConceptClic
4541 onReleaseVersionClick ( )
4642 }
4743
48- const getRepo = ( ) => {
49- if ( repo ?. id ) {
50- const { default_locale, supported_locales} = repo
51- repo . locales = uniq ( compact ( [ default_locale , ...( supported_locales || [ ] ) ] ) )
52- }
53- return repo
54- }
55-
5644 const hasAccess = currentUserHasAccess ( )
5745
5846 return (
@@ -79,74 +67,15 @@ const RepoHeader = ({repo, owner, versions, onVersionChange, onCreateConceptClic
7967 }
8068 </ span >
8169 </ div >
82- < div className = 'col-xs-12 padding-0' style = { { margin : '8px 0' , marginBottom : essentials ? 0 : '8px '} } >
70+ < div className = 'col-xs-12 padding-0' style = { { margin : '8px 0 -8px 0 ' } } >
8371 < Typography component = 'span' sx = { { fontSize : '28px' , color : 'surface.dark' , fontWeight : 600 } } > { repo . name } </ Typography >
8472 {
8573 repo ?. canonical_url &&
8674 < Typography component = 'span' sx = { { marginLeft : '8px' , fontSize : '14px' , color : 'secondary.main' } } > { repo . canonical_url } </ Typography >
8775 }
8876 </ div >
89- {
90- ! essentials &&
91- < >
92- < div className = 'col-xs-12 padding-0' style = { { display : 'flex' , alignItems : 'center' , fontSize : '16px' } } >
93- < span style = { { display : 'flex' , alignItems : 'center' } } >
94- < a style = { { color : PRIMARY_COLORS . main , cursor : 'pointer' } } className = 'no-anchor-styles' onClick = { ( ) => setViewAll ( true ) } > { t ( 'common.view_all_attributes' ) } </ a >
95- </ span >
96- < DotSeparator margin = "0 6px" />
97- < span style = { { display : 'flex' , alignItems : 'center' , opacity : 0.7 } } >
98- { t ( 'common.updated_on' ) } { formatDate ( repo . updated_on ) }
99- </ span >
100- </ div >
101- < EntityAttributesDialog
102- fields = { {
103- name : { label : t ( 'common.name' ) } ,
104- full_name : { label : t ( 'common.full_name' ) } ,
105- external_id : { label : t ( 'common.external_id' ) } ,
106- repo_type : { label : t ( 'repo.repo_type' ) } ,
107- description : { label : t ( 'common.description' ) } ,
108- canonical_url : { label : t ( 'url_registry.canonical_url' ) } ,
109- locales : { label : t ( 'repo.locales' ) } ,
110- custom_validation_schema : { label : t ( 'repo.custom_validation_schema' ) } ,
111- public_access : { label : t ( 'common.access_level' ) } ,
112- properties : { label : t ( 'repo.properties' ) , type : 'table' } ,
113- filters : { label : t ( 'repo.filters' ) , type : 'table' } ,
114- meta : { label : t ( 'repo.meta' ) , type : 'json' } ,
115- identifier : { label : t ( 'repo.identifier' ) , type : 'json' } ,
116- contact : { label : t ( 'repo.contact' ) , type : 'json' } ,
117- jurisdiction : { label : t ( 'repo.jurisdiction' ) , type : 'json' } ,
118- publisher : { label : t ( 'repo.publisher' ) } ,
119- purpose : { label : t ( 'repo.purpose' ) } ,
120- copyright : { label : t ( 'repo.copyright' ) } ,
121- content_type : { label : t ( 'repo.content_type' ) } ,
122- revision_date : { label : t ( 'repo.revision_date' ) , type : 'date' } ,
123- experimental : { label : t ( 'repo.experimental' ) } ,
124- case_sensitive : { label : t ( 'repo.case_sensitive' ) } ,
125- hierarchy_meaning : { label : t ( 'repo.hierarchy_meaning' ) } ,
126- compositional : { label : t ( 'repo.compositional' ) } ,
127- version_needed : { label : t ( 'repo.version_needed' ) } ,
128- autoid_concept_mnemonic : { label : t ( 'repo.autoid_concept_mnemonic' ) } ,
129- autoid_concept_external_id : { label : t ( 'repo.autoid_concept_external_id' ) } ,
130- autoid_concept_name_external_id : { label : t ( 'repo.autoid_concept_name_external_id' ) } ,
131- autoid_concept_description_external_id : { label : t ( 'repo.autoid_concept_description_external_id' ) } ,
132- autoid_mapping_mnemonic : { label : t ( 'repo.autoid_mapping_mnemonic' ) } ,
133- autoid_mapping_external_id : { label : t ( 'repo.autoid_mapping_external_id' ) } ,
134- 'checksums.standard' : { label : t ( 'checksums.standard' ) } ,
135- 'checksums.smart' : { label : t ( 'checksums.smart' ) } ,
136- extras : { label : t ( 'custom_attributes.label' ) , type : 'json' } ,
137- created_on : { label : t ( 'common.created_on' ) , type : 'datetime' } ,
138- updated_on : { label : t ( 'common.updated_on' ) , type : 'datetime' } ,
139- created_by : { label : t ( 'common.created_by' ) , type : 'user' } ,
140- updated_by : { label : t ( 'common.updated_by' ) , type : 'user' } ,
141- } }
142- entity = { getRepo ( ) }
143- open = { viewAll }
144- onClose = { ( ) => setViewAll ( false ) }
145- />
146- </ >
147- }
14877 </ Paper >
149- )
78+ )
15079}
15180
15281export default RepoHeader ;
0 commit comments