Skip to content

Commit

Permalink
Signalements - Il n'y a plus de scroll dans la liste des signalement (#…
Browse files Browse the repository at this point in the history
…3792)

## Linked issues

- Resolve #3786

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
ivangabriele authored Oct 22, 2024
2 parents f05f602 + 869a272 commit 6532ac1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function ReportingList() {
</StyledLinkButton>
</CardHeader>

<CurrentReportingList
<StyledCurrentReportingList
onIsDirty={handleIsDirty}
vesselIdentity={vesselIdentity}
withOpenedNewReportingForm
Expand Down Expand Up @@ -94,3 +94,8 @@ const StyledLinkButton = styled(LinkButton)`
rotate: 90deg;
}
`

const StyledCurrentReportingList = styled(CurrentReportingList)`
flex-grow: 1;
overflow-y: auto;
`
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ import type { Reporting, ReportingAndOccurrences, VesselReportings } from '@feat
import type { VesselIdentity } from 'domain/entities/vessel/types'

type ContentProps = Readonly<{
className: string | undefined
onIsDirty: ((isDirty: boolean) => void) | undefined
vesselIdentity: VesselIdentity
vesselReportings: VesselReportings
withOpenedNewReportingForm: boolean
withVesselSidebarHistoryLink: boolean
}>
export function Content({
className,
onIsDirty,
vesselIdentity,
vesselReportings,
Expand Down Expand Up @@ -56,7 +58,7 @@ export function Content({
}

return (
<Wrapper>
<Wrapper className={className}>
{!vesselReportings.current.length && !isNewReportingFormOpen && (
<NoReporting>Pas de signalement ouvert sur ce navire.</NoReporting>
)}
Expand Down Expand Up @@ -101,7 +103,7 @@ const Wrapper = styled.div`
display: flex;
flex-direction: column;
margin: 10px 5px 5px 5px;
padding: 16px 16px 1px 16px;
padding: 16px;
text-align: left;
`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import { Content } from './Content'
import type { VesselIdentity } from 'domain/entities/vessel/types'

type CurrentReportingListProps = Readonly<{
className?: string
onIsDirty?: (isDirty: boolean) => void
startDate?: Date
vesselIdentity: VesselIdentity | undefined
withOpenedNewReportingForm?: boolean
withVesselSidebarHistoryLink?: boolean
}>
export function CurrentReportingList({
className,
onIsDirty,
startDate = getDefaultReportingsStartDate(),
vesselIdentity,
Expand All @@ -39,6 +41,7 @@ export function CurrentReportingList({

return (
<Content
className={className}
onIsDirty={onIsDirty}
vesselIdentity={vesselIdentity}
vesselReportings={vesselReportings}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const Body = styled.div`
display: flex;
flex-direction: column;
flex-grow: 1;
max-height: 700px;
overflow-x: hidden;
padding: 5px;
`

0 comments on commit 6532ac1

Please sign in to comment.