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

resolve merge conflict from previous commit #663

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ const DegreeAddInterior = styled.div`
export const createMajorLabel = (degree: DegreeListing) => {
const concentration =
degree.concentration && degree.concentration !== "NONE"
? ` - ${degree.concentration_name}`
? ` - ${degree.concentration}`
: "";
return `${degree.major_name}${concentration} (${degree.year})`;
return `${degree.major}${concentration} (${degree.year})`;
};

interface RemoveDegreeProps {
Expand Down
17 changes: 11 additions & 6 deletions frontend/degree-plan/components/FourYearPlanPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ const PanelWrapper = styled(Pane)`
height: 100%;
display: flex;
flex-direction: row;
<<<<<<< HEAD
gap: 0.8rem;
=======
gap: 1rem;
>>>>>>> 2744e72b (resolve merge conflict)
`

const PanelInteriorWrapper = styled.div<{ $maxWidth?: string; $minWidth?: string }>`
Expand Down Expand Up @@ -160,11 +164,10 @@ const FourYearPlanPage = ({
// @ts-ignore */}
<SplitPane
split="vertical"
// maxSize={windowWidth ? windowWidth * 0.60 : 1000}
maxSize={searchPanelOpen ?
(windowWidth ? windowWidth : 1000) * 0.5
: (windowWidth ? windowWidth : 1000) * 0.6}
defaultSize="50%"
(windowWidth ? windowWidth : 1000) * 0.45
: (windowWidth ? windowWidth : 1000) * 0.6}
defaultSize="60%"
style={{
padding: "1.5rem",
paddingBottom: "1rem" // less padding on bottom for penn labs footer
Expand Down Expand Up @@ -201,8 +204,10 @@ const FourYearPlanPage = ({
/>
</PanelInteriorWrapper>
{searchPanelOpen && (
<PanelInteriorWrapper $minWidth={"40%"} $maxWidth={"43%"}>
<SearchPanel activeDegreeplanId={activeDegreeplan ? activeDegreeplan.id : null} setSearchedRuleId={setSearchRuleId}/>
<PanelInteriorWrapper $minWidth={"40%"} $maxWidth={"45%"}>
<SearchPanel
activeDegreeplanId={activeDegreeplan ? activeDegreeplan.id : null}
setSearchRuleId={setSearchRuleId}/>
</PanelInteriorWrapper>
)}
</PanelWrapper>
Expand Down
1 change: 0 additions & 1 deletion frontend/degree-plan/components/Requirements/QObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ const SearchCondition = ({ ruleId, ruleQuery, fulfillments, ruleIsSatisfied, q,
$isDisabled={false}
$isUsed={false}
$isSearched={searchRuleId == ruleId}

>
<SearchConditionInner q={q} />
<DarkGrayIcon onClick={() => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/degree-plan/components/Requirements/ReqPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ interface DegreeHeaderProps {
}

const DegreeHeader = ({ degree, remove, setCollapsed, collapsed, editMode, skeleton }: DegreeHeaderProps) => {
const degreeName = !skeleton ? `${degree.degree} in ${degree.major_name} ${degree.concentration ? `(${degree.concentration_name})` : ''}` : <DarkBlueBackgroundSkeleton width="10em" />;
console.log(degree)
const degreeName = !skeleton ? `${degree.degree} in ${degree.major} ${degree.concentration ? `(${degree.concentration})` : ''}` : <DarkBlueBackgroundSkeleton width="10em" />;
return (
<DegreeHeaderContainer onClick={() => setCollapsed(!collapsed)}>
<DegreeTitleWrapper>
Expand Down
9 changes: 2 additions & 7 deletions frontend/degree-plan/components/Search/CourseInSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ export default function Course({
isStar,
}: CourseProps) {
/** React dnd */
// const [{ isDragging }, drag, dragPreview] = useDrag<DnDCourse>(() => ({
// type: ItemTypes.COURSE_IN_REQ,
// item: {full_code: course.id, semester:-1, rule_id: ruleId},
// collect: (monitor) => ({
// isDragging: !!monitor.isDragging(),
// })
// }))
const [{ isDragging }, drag] = useDrag<DnDCourse, never, { isDragging: boolean }>(() => ({
type: ItemTypes.COURSE_IN_PLAN,
item: {full_code: course.id},
Expand All @@ -171,6 +164,8 @@ export default function Course({
<ReviewPanelTrigger full_code={course.id} triggerType="click">
<CourseContainer onMouseEnter={() => setIsMouseOver(true)} onMouseLeave={() => setIsMouseOver(false)}>
<CourseInfoContainer
ref={drag}
className="draggable"
role="button"
>
<CourseIdentityContainer >
Expand Down
2 changes: 1 addition & 1 deletion frontend/degree-plan/components/Search/ResultsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const ResultsList = ({
// star means the course is a fulfillment
isStar={!!fulfillments.find((fulfillment) => fulfillment.full_code == course.id)}
/>) :
Array.from(Array(5).keys()).map(() => <SkeletonCourse />)
Array.from(Array(6).keys()).map(() => <SkeletonCourse />)
}
</CoursesContainer>
</CourseListContainer>
Expand Down
7 changes: 4 additions & 3 deletions frontend/degree-plan/components/Search/SearchPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ const SearchPanelHeader = styled(PanelHeader)`

interface SearchPanelProp {
activeDegreeplanId: DegreePlan["id"] | null;
setSearchedRuleId: (arg0: number) => void;
setSearchRuleId: (arg0: number | null) => void;
}

export const SearchPanel = ({ activeDegreeplanId, setSearchedRuleId }: SearchPanelProp) => {
export const SearchPanel = ({ activeDegreeplanId, setSearchRuleId }: SearchPanelProp) => {
const {
setSearchPanelOpen,
searchRuleId: ruleId,
Expand All @@ -103,7 +103,7 @@ export const SearchPanel = ({ activeDegreeplanId, setSearchedRuleId }: SearchPan
const handleCloseSearch = () => {
setQueryString("");
setSearchPanelOpen(false);
setSearchedRuleId(-1);
setSearchRuleId(null);
}

return (
Expand All @@ -127,6 +127,7 @@ export const SearchPanel = ({ activeDegreeplanId, setSearchedRuleId }: SearchPan
value={queryString}
onChange={(e) => {setQueryString(e.target.value)}}
autoComplete="off"
// placeholder={!ruleId ? "Search for a course!" : `Filtering for ${ruleQuery ? ruleQuery : 'a requirement'}`}
placeholder={!ruleId ? "Search for a course!" : `Filtering for a requirement`}
/>
</SearchContainer>
Expand Down
Loading