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

Added Table View #163

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Added Table View #163

wants to merge 8 commits into from

Conversation

jewang25
Copy link
Contributor

@jewang25 jewang25 commented Mar 27, 2023

Summary

  • added an alternate table view to the dashboard to make it easier to view the many classes and the groups all at once.
  • can switch back and forth between views
  • added styling to table
  • added preserving state so that the view selection could be saved as the user navigates back and forth using the icon or back button

Test Plan

  • tested by forming groups and moving back and forth between classes
  • tested different scenarios for matching
  • tested sorting
  • tested switching between views
  • tested switching between views using back and icon button and seeing if the selected view stayed the same
  • made sure that the other options were also saved
tableView.mov

Notes

@jewang25 jewang25 requested a review from a team as a code owner March 27, 2023 14:24
@dti-github-bot
Copy link
Member

dti-github-bot commented Mar 27, 2023

[diff-counting] Significant lines: 312.

@github-actions
Copy link

github-actions bot commented Mar 27, 2023

Visit the preview URL for this PR (updated for commit fc2ad6f):

https://zing-lsc--pr163-alternate-table-view-n75p410i.web.app

(expires Fri, 12 May 2023 16:07:21 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1fc18307b178c916e2663810a6932f60b173c01b

Copy link
Collaborator

@mluo24 mluo24 left a comment

Choose a reason for hiding this comment

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

Hi Jessica, thank you for getting this in so quickly! The table looks pretty nice!

I'm not approving this for now because there are some changes that I think are necessary/need to clarify with LSC. Also, the mockup in the task shows highlighting on the text with how many new students similar to dashboard; I think it's worth also implementing that.

Otherwise, great work!

frontend/src/modules/Dashboard/Components/CourseTable.tsx Outdated Show resolved Hide resolved
frontend/src/modules/Dashboard/Components/CourseTable.tsx Outdated Show resolved Hide resolved
frontend/src/modules/Dashboard/Components/CourseTable.tsx Outdated Show resolved Hide resolved
frontend/src/modules/Dashboard/Components/Dashboard.tsx Outdated Show resolved Hide resolved
frontend/src/modules/Dashboard/Components/Dashboard.tsx Outdated Show resolved Hide resolved
@jewang25 jewang25 requested a review from mluo24 May 5, 2023 16:09
Copy link
Collaborator

@mluo24 mluo24 left a comment

Choose a reason for hiding this comment

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

Good job Jessica! The table looks great! Thanks for working hard to incorporate the feedback :)

There was a slight bug with reloading the page and the icons being disabled, but I put a fix in the comments for each line that should be changed. I think the issue was the lack of usage of the actual state and reliance on the default and what's in history. Other than that, this should be good to go.

Make sure to test that it works again after the changes! Thanks again, Jessica :)

<IconButton
onClick={handleClickTable}
disabled={
state?.tableView || state?.tableView === undefined ? false : true
Copy link
Collaborator

Choose a reason for hiding this comment

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

change this to state?.tableView !== undefined ? !state.tableView : !tableView

}
const [sortedOrder, setSortedOrder] = useState<SortOrder>(() =>
state?.sortedOrder ? state.sortedOrder : defaultSortingOrder
)
const [filteredOption, setFilteredOption] = useState<FilterOption>(() =>
state?.filterOption ? state.filterOption : defaultFilterOption
)
const [tableView, setTableView] = useState(() =>
state?.tableView === undefined || state?.tableView ? true : defaultView
Copy link
Collaborator

Choose a reason for hiding this comment

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

change this line to state?.tableView === undefined ? defaultView : state?.tableView

@@ -160,6 +168,7 @@ export const Dashboard = () => {
state: {
sortedOrder: event.target.value as SortOrder,
filterOption: state?.filterOption ? state.filterOption : 'no-filter',
tableView: state?.tableView ? state.tableView : defaultView,
Copy link
Collaborator

Choose a reason for hiding this comment

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

change this line to tableView: state?.tableView !== undefined ? state.tableView : defaultView,

//helper function to change view
const handleClickTable = () => {
setTableView(
state?.tableView === undefined || state?.tableView ? false : !defaultView
Copy link
Collaborator

Choose a reason for hiding this comment

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

change this line to !tableView

@@ -171,6 +180,28 @@ export const Dashboard = () => {
? state.sortedOrder
: 'newest-requests-first',
filterOption: event.target.value as FilterOption,
tableView: state?.tableView ? state.tableView : defaultView,
Copy link
Collaborator

Choose a reason for hiding this comment

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

tableView: state?.tableView !== undefined ? state.tableView : defaultView,

Comment on lines +202 to +204
state?.tableView === undefined || state?.tableView
? false
: !defaultView,
Copy link
Collaborator

Choose a reason for hiding this comment

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

!tableView (these are just toggles)

<IconButton
onClick={handleClickTable}
disabled={
state?.tableView || state?.tableView === undefined ? true : false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to state?.tableView !== undefined ? state.tableView : tableView

</IconButton>
</Box>

{(state?.tableView ? state.tableView : defaultView) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

state?.tableView !== undefined ? state.tableView : tableView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants