-
Notifications
You must be signed in to change notification settings - Fork 11
WIP: implement quality-of-life changes for pre-enroll #995
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: main
Are you sure you want to change the base?
Changes from all commits
2230bc5
7dac0cc
b783479
b10632a
e33c7a1
9521050
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<template> | ||
<button | ||
class="bottombartab full-opacity-on-hover" | ||
:style="{ background: `#${color}` }" | ||
:style="{ | ||
background: `#${Math.floor(Math.random() * 0xffffff) | ||
.toString(16) | ||
.padEnd(6, '0')}`, | ||
}" | ||
Comment on lines
+4
to
+8
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. @cornell-dti/course-plan What do you think of this approach to ensure that no two tabs have the same color? It seems pretty questionable to me, but this is the best approach I could come up with for now. 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. I agree it's a bit questionable - since it’s random, there’s still a chance of collision (and color contrast might be inconsistent too). if we really want to ensure uniqueness and consistent colors we could:
|
||
@click="$emit('on-change-focus')" | ||
> | ||
<div class="bottombartab-wrapper"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ | |
:course="courseObj" | ||
:isCompactView="false" | ||
/> | ||
<span class="course-requirements">{{ requirementsString }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -146,6 +147,7 @@ export default defineComponent({ | |
components: { CourseCaution, CourseMenu, EditColor, SaveCourseModal, Note }, | ||
props: { | ||
courseObj: { type: Object as PropType<FirestoreSemesterCourse>, required: true }, | ||
requirements: { type: Array as PropType<string[]>, required: false, default: () => [] }, | ||
compact: { type: Boolean, required: true }, | ||
active: { type: Boolean, required: true }, | ||
isReqCourse: { type: Boolean, required: true }, | ||
|
@@ -214,6 +216,18 @@ export default defineComponent({ | |
return semesterString; | ||
}, | ||
|
||
requirementsString(): string { | ||
let requirementsString = ''; | ||
this.requirements.forEach(req => { | ||
requirementsString += `${req}, `; | ||
}); | ||
if (requirementsString.length > 0) { | ||
return requirementsString.substring(0, requirementsString.length - 2); | ||
} | ||
return 'testingRequirementsString'; | ||
// todo: if requirements string is too long, the course card text gets crunched together | ||
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. For the requirementsString length issue - maybe we could: Limit the number of requirements shown (e.g. 2 or 3), and if there are more, add a +X more indicator (e.g. "MATH, CS, +2 more") or switch to rendring them as separate badges (like small pill components) which could wrap or scroll more gracefully on smaller course cards Either way we might also want to set a max-width or text-overflow: ellipsis style if we’re sticking with plain text for now |
||
}, | ||
|
||
creditString(): string { | ||
if (this.courseObj.credits === 1) { | ||
return `${this.courseObj.credits} credit`; | ||
|
@@ -554,6 +568,19 @@ export default defineComponent({ | |
} | ||
} | ||
|
||
&-requirements { | ||
margin-left: 0.2rem; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
|
||
&:before { | ||
margin-right: 0.2rem; | ||
font-style: normal; | ||
content: '|'; | ||
} | ||
} | ||
|
||
&-buttons { | ||
display: flex; | ||
justify-content: space-around; | ||
|
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.
this changes disabledGray everywhere - was the incorrect hexcode being used originally according to design?