Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: interpretations modal height (DHIS2-15558) #1549

Closed
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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
height: calc(100vw - 128px) !important;
height: calc(100vh - 128px) !important;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup 👍

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 @@ -33,52 +33,52 @@ const InterpretationThread = ({

return (
<div className={cx('container', { fetching })}>
<div className={'scrollbox'}>
<div className={'title'}>
<IconClock16 color={colors.grey700} />
{moment(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(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 @@ -113,11 +113,6 @@ const InterpretationThread = ({
rotation;
}

.scrollbox {
overflow-y: auto;
scroll-behavior: smooth;
}

.title {
display: flex;
align-items: center;
Expand Down
Loading