Skip to content

Commit 06ecff9

Browse files
fix: emilie's UX UI review
1 parent 414138a commit 06ecff9

File tree

11 files changed

+27
-33
lines changed

11 files changed

+27
-33
lines changed

frontend/src/components/style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ export const TransparentButton = styled.button.attrs(() => ({
7070
padding: 0;
7171
`
7272

73-
export const StyledTransparentButton = styled(TransparentButton)`
73+
export const StyledTransparentButton = styled(TransparentButton)<{ $width?: string }>`
7474
display: flex;
7575
align-items: center;
76-
width: 70%;
76+
width: ${p => p.$width || '80%'};
7777
`
7878

7979
export const InlineTransparentButton = styled(TransparentButton)`

frontend/src/features/Dashboard/components/DashboardForm/VigilanceAreas/Layer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function Layer({ isPinned = false, isSelected = false, vigilanceArea }: V
6868
$withBorderBottom
6969
onClick={toggleZoneMetadata}
7070
>
71-
<StyledTransparentButton>
71+
<StyledTransparentButton $width="70%">
7272
<LayerLegend
7373
isDisabled={vigilanceArea?.isArchived}
7474
layerType={MonitorEnvLayers.VIGILANCE_AREA}
@@ -132,6 +132,7 @@ const StyledLayer = styled(LayerSelector.Layer)<{ $isSelected: boolean; $metadat
132132
const TagAndButtons = styled.div`
133133
display: flex;
134134
gap: 10px;
135+
flex-grow: 0;
135136
`
136137
const StyledTag = styled(Tag)`
137138
align-self: center;

frontend/src/features/Dashboard/components/DashboardsNavBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function DashboardsNavBar() {
7878
<TabWrapper key={item.nextPath} className={`rs-navbar-item ${item.isActive ? 'rs-navbar-item-active' : ''}`}>
7979
{item.icon}
8080
<Tab
81+
$width="70%"
8182
data-cy={`dashboard-${index}`}
8283
onClick={() => selectDashboard(item.nextPath)}
8384
onKeyDown={e => {

frontend/src/features/LocalizedArea/components/LocalizedAreasItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getExtentOfLocalizedAreasGroupByGroupName } from '@api/localizedAreasAPI'
2-
import { InlineTransparentButton } from '@components/style'
2+
import { StyledTransparentButton } from '@components/style'
33
import { closeMetadataPanel, openLocalizedAreasMetadataPanel } from '@features/layersSelector/metadataPanel/slice'
44
import { LayerLegend } from '@features/layersSelector/utils/LayerLegend.style'
55
import { Accent, Icon, IconButton, Size, THEME } from '@mtes-mct/monitor-ui'
@@ -59,7 +59,7 @@ export function LocalizedAreasItem({
5959

6060
return (
6161
<Wrapper>
62-
<InlineTransparentButton data-cy="localized-areas-layer-toggle" onClick={toggleLayer}>
62+
<StyledTransparentButton data-cy="localized-areas-layer-toggle" onClick={toggleLayer}>
6363
<NameContainer>
6464
<LayerLegend
6565
layerType={MonitorEnvLayers.LOCALIZED_AREAS}
@@ -68,7 +68,7 @@ export function LocalizedAreasItem({
6868
/>
6969
<LayerName title={firstLocalizedArea.groupName}>{firstLocalizedArea.groupName}</LayerName>
7070
</NameContainer>
71-
</InlineTransparentButton>
71+
</StyledTransparentButton>
7272
<ButtonsContainer>
7373
{hasAmpIdsOrControlUnitIds && (
7474
<IconButton

frontend/src/features/Mission/components/MissionForm/ActionForm/ControlForm/InfractionForm/InfractionForm.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { Accent, Button, FormikMultiRadio, FormikNumberInput, FormikTextarea, Ic
44
import {
55
administrativeResponseOptions,
66
formalNoticeLabels,
7+
type Infraction,
78
infractionSeizureLabels,
8-
infractionTypeLabels,
9-
type Infraction
9+
infractionTypeLabels
1010
} from 'domain/entities/missions'
1111
import { TargetTypeEnum } from 'domain/entities/targetType'
1212
import { useField } from 'formik'
@@ -118,7 +118,7 @@ export function InfractionForm({
118118
min={1}
119119
name={`${infractionPath}.nbTarget`}
120120
/>
121-
<StyledTooltip Icon={Icon.AttentionFilled} isSideWindow>
121+
<StyledTooltip Icon={Icon.AttentionFilled} isSideWindow orientation="TOP_LEFT">
122122
Ne déclarez plusieurs cibles dans une infraction que dans le cas où les unités n&apos;ont pas transmis de
123123
données permettant de les identifier (nom, immatriculation…)
124124
</StyledTooltip>
@@ -157,8 +157,6 @@ const NbTargetWrapper = styled.div`
157157
const StyledTooltip = styled(Tooltip)`
158158
display: flex;
159159
width: 50%;
160-
position: relative;
161-
margin-bottom: 6px;
162160
`
163161
const NbTargetInput = styled(FormikNumberInput)`
164162
width: 48.5%;

frontend/src/features/Mission/components/MissionForm/ActionsTimeLine/ActionCard/style.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ export const TitleAndButtonsContainer = styled.div`
100100
padding-right: 52px;
101101
`
102102
export const Title = styled.span`
103+
display: block;
103104
font: normal normal normal 14px/20px Marianne;
105+
max-width: 80%;
104106
`
105107

106108
export const ControlSummary = styled.div`

frontend/src/features/layersSelector/myVigilanceAreas/MyVigilanceAreaLayerZone.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useGetVigilanceAreasQuery } from '@api/vigilanceAreasAPI'
2-
import { InlineTransparentButton } from '@components/style'
2+
import { StyledTransparentButton } from '@components/style'
33
import { vigilanceAreaActions } from '@features/VigilanceArea/slice'
44
import { useAppSelector } from '@hooks/useAppSelector'
55
import { Accent, Icon, IconButton, OPENLAYERS_PROJECTION, Size, THEME, WSG84_PROJECTION } from '@mtes-mct/monitor-ui'
@@ -74,7 +74,7 @@ export function MyVigilanceAreaLayerZone({
7474

7575
return (
7676
<LayerSelector.Layer $metadataIsShown={metadataIsShown} $withBorderBottom>
77-
<InlineTransparentButton onClick={zoomToLayerExtent}>
77+
<StyledTransparentButton onClick={zoomToLayerExtent}>
7878
<LayerLegend
7979
isDisabled={layer?.isArchived}
8080
layerType={MonitorEnvLayers.VIGILANCE_AREA}
@@ -84,7 +84,7 @@ export function MyVigilanceAreaLayerZone({
8484
<LayerSelector.Name data-cy={`vigilance-area-zone-${layer?.name}`} title={layer?.name}>
8585
{layer?.name}
8686
</LayerSelector.Name>
87-
</InlineTransparentButton>
87+
</StyledTransparentButton>
8888
<LayerSelector.IconGroup>
8989
<StyledSummaryButton
9090
$withMargin={pinnedVigilanceArea}

frontend/src/features/layersSelector/search/LayerFilters.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useGetAMPsQuery } from '@api/ampsAPI'
22
import { RegulatoryTagsFilter } from '@components/RegulatoryTagsFilter'
33
import { RegulatoryThemesFilter } from '@components/RegulatoryThemesFilter'
4+
import { TransparentButton } from '@components/style'
45
import { Tooltip } from '@components/Tooltip'
56
import { PeriodFilter } from '@features/VigilanceArea/components/PeriodFilter'
67
import {
@@ -291,11 +292,9 @@ const TagWrapper = styled.div`
291292
gap: 4px;
292293
margin-top: 8px;
293294
`
294-
const ResetFilters = styled.div`
295+
const ResetFilters = styled(TransparentButton)`
295296
color: ${p => p.theme.color.slateGray};
296-
cursor: pointer;
297297
display: flex;
298-
padding: 0;
299298
text-decoration: underline;
300299
`
301300

frontend/src/features/layersSelector/search/ResultsList/index.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export function ResultList({ searchedText }: ResultListProps) {
3939
const isRegulatorySearchResultsVisible = useAppSelector(state => state.layerSearch.isRegulatorySearchResultsVisible)
4040
const regulatoryLayersSearchResult = useAppSelector(state => state.layerSearch.regulatoryLayersSearchResult)
4141
const areRegulatoryResultsOpen = useAppSelector(state => state.layerSidebar.areRegulatoryResultsOpen)
42-
4342
const isVigilanceAreaSearchResultsVisible = useAppSelector(
4443
state => state.layerSearch.isVigilanceAreaSearchResultsVisible
4544
)
@@ -132,28 +131,22 @@ export function ResultList({ searchedText }: ResultListProps) {
132131
dispatch(layerSidebarActions.toggleVigilanceAreaResults())
133132
}
134133

135-
const toggleAMPVisibility = (isChecked: boolean | undefined) => {
136-
if (!isChecked) {
137-
dispatch(layerSidebarActions.toggleAmpResults(false))
138-
}
134+
const toggleRegulatoryVisibility = (isChecked: boolean | undefined) => {
139135
dispatch(closeMetadataPanel())
140-
dispatch(setIsAmpSearchResultsVisible(!!isChecked))
136+
dispatch(setIsRegulatorySearchResultsVisible(!!isChecked))
137+
dispatch(layerSidebarActions.toggleRegulatoryResults(!!isChecked))
141138
}
142139

143-
const toggleRegulatoryVisibility = (isChecked: boolean | undefined) => {
144-
if (!isChecked) {
145-
dispatch(layerSidebarActions.toggleRegulatoryResults(false))
146-
}
140+
const toggleAMPVisibility = (isChecked: boolean | undefined) => {
147141
dispatch(closeMetadataPanel())
148-
dispatch(setIsRegulatorySearchResultsVisible(!!isChecked))
142+
dispatch(setIsAmpSearchResultsVisible(!!isChecked))
143+
dispatch(layerSidebarActions.toggleAmpResults(!!isChecked))
149144
}
150145

151146
const toggleVigilanceAreaVisibility = (isChecked: boolean | undefined) => {
152-
if (!isChecked) {
153-
dispatch(layerSidebarActions.toggleVigilanceAreaResults(false))
154-
}
155147
dispatch(closeMetadataPanel())
156148
dispatch(setIsVigilanceAreaSearchResultsVisible(!!isChecked))
149+
dispatch(layerSidebarActions.toggleVigilanceAreaResults(!!isChecked))
157150
}
158151

159152
const hasTransitionReg = useMountTransition(areRegulatoryResultsOpen, 500)

frontend/src/features/layersSelector/utils/MyLayerGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function MyLayerGroup({
6969
return (
7070
<li>
7171
<LayerSelector.GroupWrapper $isOpen={zonesAreOpen} $isPadded onClick={toggleZonesAreOpen}>
72-
<StyledTransparentButton onClick={handleClickOnGroupName}>
72+
<StyledTransparentButton $width="70%" onClick={handleClickOnGroupName}>
7373
<LayerSelector.GroupName data-cy={`${name}-layer-topic`} title={groupName}>
7474
{groupName}
7575
</LayerSelector.GroupName>

0 commit comments

Comments
 (0)