Repository navigation
feat: Pathways strip in course pages [FC-0137] #2159
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
base: master
Are you sure you want to change the base?
Changes from all commits
5f92fb9
3a903df
8a0ecd3
d80d6e6
4f0f65b
8fea1e6
cca472a
45ffc32
e8f73ea
585c008
b4369de
fc95bb5
696901a
3201351
113f3b3
6d3e24e
216a935
c1143e8
39e6890
cd6dbcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import type { PathwayData, PathwaysByCourse } from '../types'; | ||
|
|
||
| export const dataEngineering: PathwayData = { | ||
| pathway: { | ||
| id: 'pathway-1', | ||
| content: { displayName: 'Data Engineering Fundamentals' }, | ||
| itemCount: 6, | ||
| category: 'bootcamp', | ||
| categoryLabel: 'Bootcamp', | ||
| }, | ||
| progress: { completedItemCount: 0 }, | ||
| provider: { name: 'MIT OpenCourseWare' }, | ||
| }; | ||
|
|
||
| export const machineLearning: PathwayData = { | ||
| pathway: { | ||
| id: 'pathway-2', | ||
| content: { displayName: 'Introduction to Machine Learning' }, | ||
| itemCount: 12, | ||
| category: 'tutorial', | ||
| categoryLabel: 'Tutorial', | ||
| categoryBackgroundColor: '#FCE4F3', | ||
| categoryTextColor: '#9B1766', | ||
| }, | ||
| progress: { completedItemCount: 0 }, | ||
| provider: { name: 'Stanford' }, | ||
| }; | ||
|
|
||
| export const loremIpsum: PathwayData = { | ||
| pathway: { | ||
| id: 'pathway-3', | ||
| content: { displayName: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod' }, | ||
| itemCount: 4, | ||
| category: 'tutorial', | ||
| categoryLabel: 'Tutorial', | ||
| }, | ||
| progress: { completedItemCount: 1 }, | ||
| provider: { name: 'Stanford' }, | ||
| }; | ||
|
|
||
| export const sedUt: PathwayData = { | ||
| pathway: { | ||
| id: 'pathway-4', | ||
| content: { displayName: 'Sed ut perspiciatis unde omnis iste natus' }, | ||
| itemCount: 3, | ||
| category: 'tutorial', | ||
| categoryLabel: 'Tutorial', | ||
| }, | ||
| progress: { completedItemCount: 0 }, | ||
| }; | ||
|
|
||
| export const nemoEnim: PathwayData = { | ||
| pathway: { | ||
| id: 'pathway-5', | ||
| content: { displayName: 'Nemo enim ipsam voluptatem' }, | ||
| itemCount: 5, | ||
| category: 'certificate', | ||
| categoryLabel: 'Certificate', | ||
| }, | ||
| progress: { completedItemCount: 2 }, | ||
| }; | ||
|
|
||
| export const courseIdWithPathways = 'course-v1:edX+DemoX+Demo_Course'; | ||
| export const courseIdWithManyPathways = 'course-v1:edX+Many+Pathways'; | ||
| export const courseIdWithoutPathways = 'course-v1:edX+No+Pathways'; | ||
|
|
||
| export const pathwaysByCourse: PathwaysByCourse = { | ||
| [courseIdWithPathways]: [dataEngineering, machineLearning], | ||
| [courseIdWithManyPathways]: [dataEngineering, machineLearning, loremIpsum, sedUt, nemoEnim], | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { getPathwaysByCourse } from './api'; | ||
|
|
||
| describe('course-pathways api', () => { | ||
| describe('getPathwaysByCourse', () => { | ||
| // Until the backend exists, no course has pathways | ||
| it('returns an empty map', async () => { | ||
| await expect(getPathwaysByCourse(['course-v1:edX+DemoX+Demo_Course'])).resolves.toEqual({}); | ||
| }); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type { PathwaysByCourse } from './types'; | ||
|
|
||
| // TODO The backend is missing. | ||
| // This endpoint should receive a list of course IDs and return a map | ||
| // containing the pathways in which the learner is enrolled for each course. | ||
| // The response must be mapped here to the `PathwayData` shape. | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| export const getPathwaysByCourse = async (_courseIds: string[]): Promise<PathwaysByCourse> => ({}); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| import { renderHook, waitFor } from '@testing-library/react'; | ||
| import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
|
||
| import { getPathwaysByCourse } from './api'; | ||
| import { useCoursePathways } from './apiHooks'; | ||
| import { | ||
| courseIdWithPathways, | ||
| courseIdWithoutPathways, | ||
| dataEngineering, | ||
| machineLearning, | ||
| pathwaysByCourse, | ||
| } from './__fixtures__/pathways'; | ||
|
|
||
| jest.mock('./api', () => ({ | ||
| getPathwaysByCourse: jest.fn(), | ||
| })); | ||
|
|
||
| const mockGetPathwaysByCourse = getPathwaysByCourse as jest.MockedFunction<typeof getPathwaysByCourse>; | ||
|
|
||
| const buildWrapper = () => { | ||
| const queryClient = new QueryClient({ | ||
| defaultOptions: { queries: { retry: false } }, | ||
| }); | ||
| const wrapper = ({ children }) => ( | ||
| <QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
| ); | ||
| return { wrapper }; | ||
| }; | ||
|
|
||
| describe('course-pathways apiHooks', () => { | ||
| beforeEach(() => { | ||
| mockGetPathwaysByCourse.mockReset(); | ||
| }); | ||
|
|
||
| describe('useCoursePathways', () => { | ||
| it('requests the pathways of the given course', async () => { | ||
| mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse); | ||
| const { wrapper } = buildWrapper(); | ||
| const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper }); | ||
|
|
||
| await waitFor(() => expect(result.current.isSuccess).toBe(true)); | ||
| expect(mockGetPathwaysByCourse).toHaveBeenCalledWith([courseIdWithPathways]); | ||
| }); | ||
|
|
||
| it('returns only the pathways of the given course', async () => { | ||
| mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse); | ||
| const { wrapper } = buildWrapper(); | ||
| const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper }); | ||
|
|
||
| await waitFor(() => expect(result.current.isSuccess).toBe(true)); | ||
| expect(result.current.data).toEqual([dataEngineering, machineLearning]); | ||
| }); | ||
|
|
||
| it('returns an empty list when the course has no pathways', async () => { | ||
| mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse); | ||
| const { wrapper } = buildWrapper(); | ||
| const { result } = renderHook(() => useCoursePathways(courseIdWithoutPathways), { wrapper }); | ||
|
|
||
| await waitFor(() => expect(result.current.isSuccess).toBe(true)); | ||
| expect(result.current.data).toEqual([]); | ||
| }); | ||
|
|
||
| it('does not request anything without a course', () => { | ||
| const { wrapper } = buildWrapper(); | ||
| const { result } = renderHook(() => useCoursePathways(undefined), { wrapper }); | ||
|
|
||
| expect(result.current.fetchStatus).toBe('idle'); | ||
| expect(result.current.data).toBeUndefined(); | ||
| expect(mockGetPathwaysByCourse).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it('exposes the error when the request fails', async () => { | ||
| mockGetPathwaysByCourse.mockRejectedValue(new Error('network error')); | ||
| const { wrapper } = buildWrapper(); | ||
| const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper }); | ||
|
|
||
| await waitFor(() => expect(result.current.isError).toBe(true)); | ||
| expect(result.current.data).toBeUndefined(); | ||
| }); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { appId } from '@src/constants'; | ||
| import { skipToken, useQuery } from '@tanstack/react-query'; | ||
|
|
||
| import { getPathwaysByCourse } from './api'; | ||
| import type { PathwayData } from './types'; | ||
|
|
||
| export const coursePathwaysQueryKeys = { | ||
| all: [appId, 'coursePathways'] as const, | ||
| course: (courseId: string) => [...coursePathwaysQueryKeys.all, courseId] as const, | ||
| }; | ||
|
|
||
| // Pathways in which the learner is enrolled that include the given course. | ||
| export const useCoursePathways = (courseId?: string) => useQuery({ | ||
| queryKey: coursePathwaysQueryKeys.course(courseId!), | ||
| queryFn: courseId ? () => getPathwaysByCourse([courseId]) : skipToken, | ||
| select: (pathwaysByCourse): PathwayData[] => pathwaysByCourse[courseId!] ?? [], | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // The shape the UI needs. The API layer is in charge of mapping the backend response to it. | ||
| export interface PathwayData { | ||
| pathway: { | ||
| id: string; | ||
| content: { | ||
| displayName: string; | ||
| }; | ||
| itemCount: number; | ||
| category?: string; | ||
| categoryLabel?: string; | ||
| categoryBackgroundColor?: string; | ||
| categoryTextColor?: string; | ||
| }; | ||
| progress?: { | ||
| completedItemCount: number; | ||
| }; | ||
| provider?: { | ||
| name: string; | ||
| }; | ||
| } | ||
|
|
||
| export type PathwaysByCourse = Record<string, PathwayData[]>; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| .course-pathways-strip { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding custom After thinking about it more I realized that this strip should probably be a Paragon component. With that in mind, I think the best path forward here would be to:
Once the generic version of the component is in place, Then later we can actually add the component to Paragon and have Does that work for you? Please let me know if you have any concerns/questions! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hi @brian-smith-tcril! Do you mind if we do the other way around? We reference the Paragon here with a I'm asking because we have a big stack of open PRs and we're starting to get tight on our budget.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rpenido I'm not sure what you mean by "the other way around" here. My suggestion is to make the generic component here, have it live in this MFE and land in this PR, and then make the Paragon issue to port the generic component to Paragon in the future. I had Claude throw together a diff to demonstrate what I'm thinking Diff making it genericdiff --git a/src/pathways/pathways-strip/CoursePathwaysStrip.scss b/src/generic/info-strip/InfoStrip.scss
similarity index 84%
rename from src/pathways/pathways-strip/CoursePathwaysStrip.scss
rename to src/generic/info-strip/InfoStrip.scss
index cdcf8c0..530eacc 100644
--- a/src/pathways/pathways-strip/CoursePathwaysStrip.scss
+++ b/src/generic/info-strip/InfoStrip.scss
@@ -1,17 +1,17 @@
-.course-pathways-strip {
- .course-pathways-strip-container {
+.info-strip {
+ .info-strip-container {
position: relative;
flex: 1;
min-width: 0;
overflow: hidden;
}
- .course-pathways-strip-label {
+ .info-strip-label {
flex-shrink: 0;
white-space: nowrap;
// Labels are separated by a vertical line
- & + .course-pathways-strip-label {
+ & + .info-strip-label {
margin-inline-start: 0.75rem;
padding-inline-start: 0.75rem;
border-inline-start: 1px solid var(--pgn-color-light-700);
@@ -19,7 +19,7 @@
}
// "+N" trigger, right after the last visible label and separated from it by a vertical line
- .course-pathways-strip-trigger {
+ .info-strip-trigger {
flex-shrink: 0;
margin-inline-start: 0.75rem;
padding-top: 0;
@@ -43,7 +43,7 @@
}
// Hidden copy of every label, only used to measure their natural width
- .course-pathways-strip-measure {
+ .info-strip-measure {
position: absolute;
top: 0;
left: 0;
diff --git a/src/generic/info-strip/InfoStrip.tsx b/src/generic/info-strip/InfoStrip.tsx
new file mode 100644
index 0000000..de5c964
--- /dev/null
+++ b/src/generic/info-strip/InfoStrip.tsx
@@ -0,0 +1,43 @@
+import type { ReactNode } from 'react';
+
+import { MoreItemsPopover } from './MoreItemsPopover';
+import { useVisibleItems } from './hooks';
+import type { InfoStripItem } from './types';
+
+export interface InfoStripProps {
+ label: ReactNode;
+ items: InfoStripItem[];
+ getMoreItemsLabel: (count: number) => string;
+}
+
+export const InfoStrip = ({ label, items, getMoreItemsLabel }: InfoStripProps) => {
+ const {
+ containerRef,
+ measureRef,
+ visibleItems,
+ hiddenItems,
+ } = useVisibleItems(items);
+
+ return (
+ <div className="info-strip bg-primary text-white small">
+ <div className="container-xl d-flex align-items-center py-2">
+ <span className="text-gray-200 flex-shrink-0 mr-3">
+ {label}
+ </span>
+ <div ref={containerRef} className="info-strip-container d-flex align-items-center">
+ {visibleItems.map((item) => (
+ <span key={item.id} className="info-strip-label">{item.label}</span>
+ ))}
+ {hiddenItems.length > 0 && (
+ <MoreItemsPopover items={hiddenItems} label={getMoreItemsLabel(hiddenItems.length)} />
+ )}
+ <div ref={measureRef} className="info-strip-measure d-flex align-items-center" aria-hidden>
+ {items.map((item) => (
+ <span key={item.id} className="info-strip-label">{item.label}</span>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/src/pathways/pathways-strip/MorePathwaysPopover.tsx b/src/generic/info-strip/MoreItemsPopover.tsx
similarity index 55%
rename from src/pathways/pathways-strip/MorePathwaysPopover.tsx
rename to src/generic/info-strip/MoreItemsPopover.tsx
index c2e8306..0846bbb 100644
--- a/src/pathways/pathways-strip/MorePathwaysPopover.tsx
+++ b/src/generic/info-strip/MoreItemsPopover.tsx
@@ -1,15 +1,12 @@
import { useState } from 'react';
-import { useIntl } from '@edx/frontend-platform/i18n';
import {
Badge, Button, ModalPopup, useToggle,
} from '@openedx/paragon';
import { ArrowDropDown } from '@openedx/paragon/icons';
-import type { PathwayData } from '../data/types';
-import messages from './messages';
+import type { InfoStripItem } from './types';
-export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) => {
- const { formatMessage } = useIntl();
+export const MoreItemsPopover = ({ items, label }: { items: InfoStripItem[]; label: string }) => {
const [isOpen, open, close] = useToggle(false);
const [target, setTarget] = useState<HTMLButtonElement | null>(null);
@@ -20,11 +17,11 @@ export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) =
variant="inverse-tertiary"
size="sm"
iconAfter={ArrowDropDown}
- className="course-pathways-strip-trigger pl-2"
- aria-label={formatMessage(messages.morePathways, { count: pathways.length })}
+ className="info-strip-trigger pl-2"
+ aria-label={label}
onClick={open}
>
- <Badge pill variant="light">{pathways.length}</Badge>
+ <Badge pill variant="light">{items.length}</Badge>
</Button>
<ModalPopup
positionRef={target}
@@ -35,9 +32,8 @@ export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) =
>
<div className="bg-white px-4 py-3 rounded shadow small">
<ul className="mb-0 pl-3">
- {pathways.map((pathway) => (
- // TODO Link to the pathway outline once its URL is known
- <li key={pathway.pathway.id}>{pathway.pathway.content.displayName}</li>
+ {items.map((item) => (
+ <li key={item.id}>{item.label}</li>
))}
</ul>
</div>
diff --git a/src/pathways/pathways-strip/hooks.ts b/src/generic/info-strip/hooks.ts
similarity index 80%
rename from src/pathways/pathways-strip/hooks.ts
rename to src/generic/info-strip/hooks.ts
index c30986b..961738e 100644
--- a/src/pathways/pathways-strip/hooks.ts
+++ b/src/generic/info-strip/hooks.ts
@@ -1,35 +1,35 @@
import { useLayoutEffect, useRef, useState } from 'react';
-import type { PathwayData } from '../data/types';
+import type { InfoStripItem } from './types';
// Width kept free after the last visible label for the "+N" popover trigger, including its
// 0.75rem (12px) start margin
const COUNTER_RESERVED_WIDTH = 86;
/**
- * Splits the course pathways into the ones that fit in the strip and the ones that go to the
+ * Splits the items into the ones that fit in the strip and the ones that go to the
* "+N" popover. Only the labels that fit entirely are shown, so a label that would be cut goes to
* the popover, even if it is the first one. The split is recalculated whenever the strip resizes.
*/
-export const useVisiblePathways = (pathways: PathwayData[]) => {
+export const useVisibleItems = (items: InfoStripItem[]) => {
// Goes on the element whose width is available for the labels and the trigger
const containerRef = useRef<HTMLDivElement>(null);
// Goes on a hidden row that renders every label at its natural width
const measureRef = useRef<HTMLDivElement>(null);
- const [visibleCount, setVisibleCount] = useState(pathways.length);
+ const [visibleCount, setVisibleCount] = useState(items.length);
useLayoutEffect(() => {
const container = containerRef.current;
const measure = measureRef.current;
if (!container || !measure || typeof ResizeObserver === 'undefined') {
- setVisibleCount(pathways.length);
+ setVisibleCount(items.length);
return undefined;
}
const calculate = () => {
const available = container.clientWidth;
if (measure.offsetWidth <= available) {
- setVisibleCount(pathways.length);
+ setVisibleCount(items.length);
return;
}
// A label is visible if it ends before the space kept for the "+N" trigger
@@ -49,12 +49,12 @@ export const useVisiblePathways = (pathways: PathwayData[]) => {
// The labels change width without resizing the container, e.g. when the web font loads
observer.observe(measure);
return () => observer.disconnect();
- }, [pathways]);
+ }, [items]);
return {
containerRef,
measureRef,
- visiblePathways: pathways.slice(0, visibleCount),
- hiddenPathways: pathways.slice(visibleCount),
+ visibleItems: items.slice(0, visibleCount),
+ hiddenItems: items.slice(visibleCount),
};
};
diff --git a/src/generic/info-strip/types.ts b/src/generic/info-strip/types.ts
new file mode 100644
index 0000000..e09e232
--- /dev/null
+++ b/src/generic/info-strip/types.ts
@@ -0,0 +1,6 @@
+import type { ReactNode } from 'react';
+
+export interface InfoStripItem {
+ id: string;
+ label: ReactNode;
+}
diff --git a/src/index.scss b/src/index.scss
index 0e49db1..c74d3ca 100755
--- a/src/index.scss
+++ b/src/index.scss
@@ -465,4 +465,4 @@
@import "course-tabs/course-tabs-navigation.scss";
@import "courseware/course/sidebar/common/SidebarBase.scss";
@import "courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.scss";
-@import "pathways/pathways-strip/CoursePathwaysStrip.scss";
+@import "generic/info-strip/InfoStrip.scss";
diff --git a/src/pathways/pathways-strip/CoursePathwaysStrip.tsx b/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
index 76c081d..51ef59e 100644
--- a/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
+++ b/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
@@ -1,57 +1,32 @@
-import { FormattedMessage } from '@edx/frontend-platform/i18n';
+import { useMemo } from 'react';
+import { useIntl } from '@edx/frontend-platform/i18n';
+import { InfoStrip } from '@src/generic/info-strip/InfoStrip';
import { useCoursePathways } from '../data/apiHooks';
-import type { PathwayData } from '../data/types';
-import { MorePathwaysPopover } from './MorePathwaysPopover';
-import { useVisiblePathways } from './hooks';
import messages from './messages';
-interface PathwayLabelProps {
- pathway: PathwayData;
-}
-
export interface CoursePathwaysStripProps {
courseId?: string;
}
-const PathwayLabel = ({ pathway }: PathwayLabelProps) => (
- // TODO Link to the pathway outline once its URL is known
- <span className="course-pathways-strip-label">
- {pathway.pathway.content.displayName}
- </span>
-);
-
export const CoursePathwaysStrip = ({ courseId }: CoursePathwaysStripProps) => {
+ const { formatMessage } = useIntl();
const { data: pathways = [] } = useCoursePathways(courseId);
- const {
- containerRef,
- measureRef,
- visiblePathways,
- hiddenPathways,
- } = useVisiblePathways(pathways);
+ const items = useMemo(() => pathways.map(({ pathway }) => ({
+ id: pathway.id,
+ // TODO Link to the pathway outline once its URL is known
+ label: pathway.content.displayName,
+ })), [pathways]);
if (!pathways.length) {
return null;
}
return (
- <div className="course-pathways-strip bg-primary text-white small">
- <div className="container-xl d-flex align-items-center py-2">
- <span className="text-gray-200 flex-shrink-0 mr-3">
- <FormattedMessage {...messages.includedIn} />
- </span>
- <div ref={containerRef} className="course-pathways-strip-container d-flex align-items-center">
- {visiblePathways.map((pathway) => (
- <PathwayLabel key={pathway.pathway.id} pathway={pathway} />
- ))}
- {hiddenPathways.length > 0 && <MorePathwaysPopover pathways={hiddenPathways} />}
- <div ref={measureRef} className="course-pathways-strip-measure d-flex align-items-center" aria-hidden>
- {pathways.map((pathway) => (
- <PathwayLabel key={pathway.pathway.id} pathway={pathway} />
- ))}
- </div>
- </div>
- </div>
- </div>
+ <InfoStrip
+ label={formatMessage(messages.includedIn)}
+ items={items}
+ getMoreItemsLabel={(count) => formatMessage(messages.morePathways, { count })}
+ />
);
};There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brian-smith-tcril What I meant was merging it as-is with a Also (not that it is the specific case here), we may have changes once product/design evaluate the whole flow, which could mean dropping/refactoring some of the work we are polishing here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rpenido I understand that, and reviewing the frontend PRs for Pathways is my top priority now. That being said, I don't feel landing this PR as-is is a good option. As I mentioned in #2159 (comment)
and
Unfortunately it doesn't seem like the info strip is something that can easily be made by composing existing out-of-the-box Paragon components and instead requires custom styles. The true "happy path" (given unlimited time) for this type of thing would be to propose the new component in Paragon, review the proposed component for usability and a11y, land the new component in Paragon, and then use the new component in the MFE. I recognized that wasn't a viable option here, so I instead proposed having the component live in the MFE for now. This would just mean separating the Pathways specific logic out from the info strip logic, it wouldn't mean having the new info strip component go through the entire Paragon component review process as part of this PR. The proposal on the Paragon side could then simply point to the info strip component in this MFE, and the more in-depth review of it would happen there while the MFE was already using it. If your issue is with making changes to this PR specifically, I could be open to landing this as-is if there was a Paragon PR (or draft) proposing the info strip component there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@rpenido and @cassiezamparini - Let's touch base on the project hours, where we are today with what hours have been used, what work have left, and discuss if you have any concerns about completing the project with the hours that currently remain. |
||
| .course-pathways-strip-container { | ||
| position: relative; | ||
| flex: 1; | ||
| min-width: 0; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .course-pathways-strip-label { | ||
| flex-shrink: 0; | ||
| white-space: nowrap; | ||
|
|
||
| // Labels are separated by a vertical line | ||
| & + .course-pathways-strip-label { | ||
| margin-inline-start: 0.75rem; | ||
| padding-inline-start: 0.75rem; | ||
| border-inline-start: 1px solid var(--pgn-color-light-700); | ||
| } | ||
| } | ||
|
|
||
| // "+N" trigger, right after the last visible label and separated from it by a vertical line | ||
| .course-pathways-strip-trigger { | ||
| flex-shrink: 0; | ||
| margin-inline-start: 0.75rem; | ||
| padding-top: 0; | ||
| padding-bottom: 0; | ||
| border-inline-start: 1px solid var(--pgn-color-light-700); | ||
| border-radius: 0; | ||
|
|
||
| .badge { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| min-width: 1.25rem; | ||
| height: 1.25rem; | ||
| padding: 0; | ||
| margin-inline-start: 0.5rem; | ||
| } | ||
|
|
||
| .btn-icon-after { | ||
| margin-inline-start: 0; | ||
| } | ||
| } | ||
|
|
||
| // Hidden copy of every label, only used to measure their natural width | ||
| .course-pathways-strip-measure { | ||
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
| width: max-content; | ||
| visibility: hidden; | ||
| pointer-events: none; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: I think it is safe to assume these fields are not undefined. But we can revisit it when we add the backend