Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $backgroundBlue: #f6fafc;
$primaryGray: #3d3d3d;
$secondaryGray: #858585;
$activeGray: #5b676d;
$disabledGray: #cccccc;
$disabledGray: #78848a;
Copy link
Contributor

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?

$searchBoxBorderGray: #d4d4d4;
$searchBoxHoverGray: #e9e9e9;

Expand Down
1 change: 1 addition & 0 deletions src/components/BottomBar/BottomBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
>
<bottom-bar-title
:color="focusedBottomBarCourse.color"
:code="focusedBottomBarCourse.code"
:name="focusedBottomBarCourse.name"
:isExpanded="isExpanded"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BottomBar/BottomBarCourseReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</div>
<div class="details-head">Prerequisites</div>
<p class="info-fact">{{ coursePrereqs }}</p>
<div class="details-head">Description</div>
<div class="details-head" v-if="courseObj.description.length > 0">Description</div>
<p class="info-fact">{{ courseObj.description }}</p>
</div>
</template>
Expand Down
6 changes: 5 additions & 1 deletion src/components/BottomBar/BottomBarTab.vue
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
Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  • generate colors from a fixed palette (e.g. COLORS = ['#FFAA00', '#4DA8DA', ...]) and assign them based on tab index or hash of the course ID
  • or use a seeded random function so the same course/tab always gets the same color
    that said, for a quick temporary solution this totally works - just maybe worth revisiting if it ends up looking chaotic in prod haha

@click="$emit('on-change-focus')"
>
<div class="bottombartab-wrapper">
Expand Down
3 changes: 2 additions & 1 deletion src/components/BottomBar/BottomBarTitle.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="bottombartitle" :style="{ background: `#${color}` }">
<div class="bottombar-square-title">{{ name }}</div>
<div class="bottombar-square-title">{{ code }} - {{ name }}</div>
<img
v-if="!isExpanded"
class="bottombartitle-arrow"
Expand All @@ -22,6 +22,7 @@ import { defineComponent } from 'vue';
export default defineComponent({
props: {
color: { type: String, required: true },
code: { type: String, required: true },
name: { type: String, required: true },
isExpanded: { type: Boolean, required: true },
},
Expand Down
27 changes: 27 additions & 0 deletions src/components/Course/Course.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
:course="courseObj"
:isCompactView="false"
/>
<span class="course-requirements">{{ requirementsString }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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`;
Expand Down Expand Up @@ -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;
Expand Down
23 changes: 23 additions & 0 deletions src/components/Requirements/RequirementSideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@
</div>
</template>
</draggable>
<div class="py-3">
<div class="see-all-pages" v-if="numPages > 1">
<span class="see-all-pageCount">{{ pageText }}</span>
<div class="see-all-buttonWrapper">
<button
class="see-all-button"
:class="{ 'see-all-button--disabled': !hasPrevPage }"
:disabled="!hasPrevPage"
@click="prevPage()"
>
<span class="see-all-button-text">Prev</span>
</button>
<button
class="see-all-button"
:class="{ 'see-all-button--disabled': !hasNextPage }"
:disabled="!hasNextPage"
@click="nextPage()"
>
<span class="see-all-button-text">Next</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
Expand Down
Loading