Skip to content

Commit

Permalink
Frontend - wording in RegulatoryLayerMetadata
Browse files Browse the repository at this point in the history
remove dead code

closes #21
  • Loading branch information
thoomasbro committed Jun 6, 2022
1 parent d8cc853 commit 24557fb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 28 deletions.
9 changes: 0 additions & 9 deletions frontend/src/domain/entities/regulatory.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ export const REGULATORY_TEXT_TYPE = {
REGULATION: 'regulation'
}

const regulatoryZoneTextType = type =>
type === REGULATORY_TEXT_TYPE.CREATION ? 'création' : REGULATORY_TEXT_TYPE.REGULATION ? 'réglementation' : undefined

export const getRegulatoryZoneTextTypeAsText = (textTypeList) => {
return `${textTypeList.length === 2
? `${regulatoryZoneTextType(textTypeList[0])} et ${regulatoryZoneTextType(textTypeList[1])}`
: `${regulatoryZoneTextType(textTypeList[0])}`} de zone`
}

export const DEFAULT_REGULATORY_TEXT = {
url: '',
reference: '',
Expand Down
11 changes: 0 additions & 11 deletions frontend/src/features/layers/regulatory/metadata/CodeAndName.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react'
import styled from 'styled-components'
import { SectionTitle, Section, List, Label } from './RegulatoryMetadata.style'
import { SectionTitle, Section, List } from './RegulatoryMetadata.style'
import { Link } from '../../../commonStyles/Link.style'
import { getRegulatoryZoneTextTypeAsText } from '../../../../domain/entities/regulatory'

const MetadataRegulatoryReferences = ({regulatoryReference, type, url}) => {
const MetadataRegulatoryReferences = ({regulatoryReference, url}) => {

return regulatoryReference && <Section>
<SectionTitle>Références réglementaires</SectionTitle>
<List>
<Reference data-cy="regulatory-layers-metadata-references">
<Label>{getRegulatoryZoneTextTypeAsText(type)}</Label>
<Reference data-cy="regulatory-layers-metadata-references">
<Link target={"_blank"} href={url}>{regulatoryReference}</Link>
</Reference>
</List>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RegulatoryLayerZoneMetadata = () => {
</Warning>
<Content>
<Identification entity_name={regulatoryMetadata?.entity_name} thematique={regulatoryMetadata?.thematique} type={regulatoryMetadata?.type} facade={regulatoryMetadata?.facade} />
<MetadataRegulatoryReferences regulatoryReference={regulatoryMetadata?.ref_reg} type={regulatoryMetadata?.type} url={regulatoryMetadata?.url} />
<MetadataRegulatoryReferences regulatoryReference={regulatoryMetadata?.ref_reg} url={regulatoryMetadata?.url} />
</Content></>
// eslint-disable-next-line react/forbid-component-props
: <FingerprintSpinner color={COLORS.background} className={'radar'} size={100}/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import styled from 'styled-components'
import { COLORS } from '../../../../constants/constants'

export const Label = styled.span``

export const Elem = styled.li``

export const List = styled.ul`
Expand Down

0 comments on commit 24557fb

Please sign in to comment.