Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const setupLearningPaths = ({
urls.learningResources.details({ id: resource.id }),
resource,
)
setMockResponse.get(urls.learningPaths.list(), paginatedLearningPaths)
setMockResponse.get(
urls.learningPaths.list({ limit: 100 }),
paginatedLearningPaths,
)
const view = renderWithProviders(null)
if (dialogOpen) {
act(() => {
Expand Down Expand Up @@ -100,7 +103,7 @@ const setupUserLists = ({
urls.learningResources.details({ id: resource.id }),
resource,
)
setMockResponse.get(urls.userLists.list(), paginatedUserLists)
setMockResponse.get(urls.userLists.list({ limit: 100 }), paginatedUserLists)
const view = renderWithProviders(null)
if (dialogOpen) {
act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import { usePostHog } from "posthog-js/react"

import * as NiceModal from "@ebay/nice-modal-react"

import {
type LearningPathResource,
type LearningResource,
type UserList,
} from "api"
import type { LearningPathResource, LearningResource, UserList } from "api"

import {
useLearningResourceSetUserListRelationships,
Expand All @@ -31,6 +27,8 @@ import { manageListDialogs } from "@/page-components/ManageListDialogs/ManageLis
import { ListType } from "api/constants"
import { useFormik } from "formik"

const LIST_LIMIT = 100

const ResourceTitle = styled.span({
fontStyle: "italic",
})
Expand Down Expand Up @@ -202,7 +200,7 @@ const AddToLearningPathDialogInner: React.FC<AddToListDialogProps> = ({
}) => {
const resourceQuery = useLearningResourcesDetail(resourceId)
const resource = resourceQuery.data
const listsQuery = useLearningPathsList()
const listsQuery = useLearningPathsList({ limit: LIST_LIMIT })
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Showing up to 100 and scrolling isn't a great solution. We should have infinite scroll or something.

This is a remediation to unblock the DLLs.


const isReady = !!(resource && listsQuery.isSuccess)
const lists = listsQuery.data?.results ?? []
Expand All @@ -221,7 +219,7 @@ const AddToUserListDialogInner: React.FC<AddToListDialogProps> = ({
}) => {
const resourceQuery = useLearningResourcesDetail(resourceId)
const resource = resourceQuery.data
const listsQuery = useUserListList()
const listsQuery = useUserListList({ limit: LIST_LIMIT })

const isReady = !!(resource && listsQuery.isSuccess)
const lists = listsQuery.data?.results ?? []
Expand Down
4 changes: 3 additions & 1 deletion frontends/ol-components/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const Header = styled.div`
`

const Content = styled.div`
margin: 28px 28px 40px;
margin: 28px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, in Figma, a couple dialogs had 40px between the content and the dialog footer but most had 28px.

In THE CODE it was determined via Dialog vs FormDialog. Both used 40px margin on the content, but FormDialog also had -12px on the footer for an effective 28px. This is (a) weird, and (b) the negative margin approach did not work well with scrolling overflow. (Which is why it's showing up in this PR).

Confirmed with @steven-hatch we want 28px uniformly across the dialogs.

Here's an example of a noticeable change:

Screenshot 2024-10-15 at 11 17 04 AM

min-height: 0;
overflow: auto;
`

const DialogActions = styled(MuiDialogActions)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const FormContent = styled.div`
flex-direction: column;
gap: 20px;
width: 100%;
margin-bottom: -12px;
`
interface FormDialogProps {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ const themeOptions: ThemeOptions = {
styleOverrides: { paper: { borderRadius: "4px" } },
},
MuiAutocomplete: {
styleOverrides: { paper: { borderRadius: "4px" } },
styleOverrides: {
paper: { borderRadius: "4px" },
// Mui puts paddingRight: 2px, marginRight: -2px on the popupIndicator,
// which causes the browser to show a horizontal scrollbar on overflow
// containers when a scrollbar isn't really necessary.
popupIndicator: { paddingRight: 0, marginRight: 0 },
},
},
MuiChip: chips.chipComponent,
},
Expand Down
Loading