Skip to content

Commit

Permalink
Merge branch 'fix/DHIS2-15558-interpretations-modal-height' into inte…
Browse files Browse the repository at this point in the history
…rpretationsfest-2023

* fix/DHIS2-15558-interpretations-modal-height:
  fix: only scroll thread of messages
  fix: avoid double scrollbar
  fix: set height to 100%
  • Loading branch information
HendrikThePendric committed Sep 28, 2023
2 parents 8d11ffa + d9b9114 commit 57e812d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,22 @@ const modalCSS = css.resolve`
max-width: calc(100vw - 128px) !important;
max-height: calc(100vh - 128px) !important;
width: auto !important;
height: auto !important;
height: calc(100vw - 128px) !important;
overflow-y: hidden;
}
aside.hidden {
display: none;
}
aside > :global(div) > :global(div) {
max-height: none;
height: 100%;
}
`

function getModalContentCSS(width) {
return css.resolve`
div {
width: ${width}px;
overflow-y: visible;
}
`
}
Expand Down Expand Up @@ -216,12 +217,14 @@ const InterpretationModal = ({
.container {
display: flex;
flex-direction: column;
height: 100%;
}
.row {
display: flex;
flex-direction: row;
gap: 16px;
height: 100%;
}
.visualisation-wrap {
Expand All @@ -233,7 +236,6 @@ const InterpretationModal = ({
padding-right: ${spacers.dp4};
flex-basis: 300px;
flex-shrink: 0;
overflow-y: auto;
}
`}</style>
</Modal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,52 @@ const InterpretationThread = ({

return (
<div className={cx('container', { fetching })}>
<div className={'scrollbox'}>
<div className={'title'}>
<IconClock16 color={colors.grey700} />
{moment(fromServerDate(interpretation.created)).format(
'LLL'
)}
</div>
{DownloadMenu && (
<DownloadMenu relativePeriodDate={interpretation.created} />
)}
<div className={'thread'}>
<Interpretation
currentUser={currentUser}
interpretation={interpretation}
onReplyIconClick={
interpretationAccess.comment
? () => focusRef.current?.focus()
: null
}
onUpdated={() => onThreadUpdated(true)}
onDeleted={onInterpretationDeleted}
isInThread={true}
/>
<div className={'comments'}>
{interpretation.comments.map((comment) => (
<Comment
key={comment.id}
comment={comment}
currentUser={currentUser}
interpretationId={interpretation.id}
onThreadUpdated={onThreadUpdated}
canComment={interpretationAccess.comment}
/>
))}
</div>
{interpretationAccess.comment && (
<CommentAddForm
<div className={'title'}>
<IconClock16 color={colors.grey700} />
{moment(fromServerDate(interpretation.created)).format('LLL')}
</div>
{DownloadMenu && (
<DownloadMenu relativePeriodDate={interpretation.created} />
)}
<div className={'thread'}>
<Interpretation
currentUser={currentUser}
interpretation={interpretation}
onReplyIconClick={
interpretationAccess.comment
? () => focusRef.current?.focus()
: null
}
onUpdated={() => onThreadUpdated(true)}
onDeleted={onInterpretationDeleted}
isInThread={true}
/>
<div className={'comments'}>
{interpretation.comments.map((comment) => (
<Comment
key={comment.id}
comment={comment}
currentUser={currentUser}
interpretationId={interpretation.id}
onSave={() => onThreadUpdated(true)}
focusRef={focusRef}
onThreadUpdated={onThreadUpdated}
canComment={interpretationAccess.comment}
/>
)}
))}
</div>
</div>
{interpretationAccess.comment && (
<CommentAddForm
currentUser={currentUser}
interpretationId={interpretation.id}
onSave={() => onThreadUpdated(true)}
focusRef={focusRef}
/>
)}
<style jsx>{`
.thread {
margin-top: var(--spacers-dp16);
overflow-y: auto;
scroll-behavior: smooth;
}
.container {
Expand Down Expand Up @@ -117,11 +115,6 @@ const InterpretationThread = ({
rotation;
}
.scrollbox {
overflow-y: auto;
scroll-behavior: smooth;
}
.title {
display: flex;
align-items: center;
Expand Down

0 comments on commit 57e812d

Please sign in to comment.