-
Notifications
You must be signed in to change notification settings - Fork 888
[Feature:TAGrading] 3 panel mode #5759
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5759 +/- ##
=========================================
Coverage 22.40% 22.40%
Complexity 6231 6231
=========================================
Files 157 157
Lines 20405 20405
=========================================
Hits 4571 4571
Misses 15834 15834
Flags with carried forward coverage won't be shown. Click here to find out more. |
isFullScreenMode: false, | ||
isFullLeftColumnMode: false, | ||
currentOpenPanel: panelElements[0].str, | ||
currentTwoPanels: { | ||
left: null, | ||
right: null, | ||
leftTop: null, |
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.
Since the values in here are supposed to be strings can you wrap them with quotes so its explicit that these keys are not variables.
// otherwise just toggle it | ||
if (isPanelOpen || !(taLayoutDet.isTwoPanelsEnabled && !isMobileView)) { | ||
if (isPanelOpen || +taLayoutDet.numOfPanelsEnabled === 1) { |
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.
What is the +
doing here?
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.
Because of using LocalStorage for saving/ retrieving the variable, it can be converted to a string. So I used it to convert the type of numOfPanelsEnabled from string to number... it's just the alternative of like number(taLayoutDet.numOfPanelsEnabled)
site/public/js/ta-grading-v2.js
Outdated
$(".grade-panel .panel-position-cont").change(function() { | ||
let panelSpanId = $(this).parent().attr('id'); | ||
let position = $(this).val(); | ||
console.log(position); |
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.
is this console.log
needed?
site/public/js/ta-grading-v2.js
Outdated
taLayoutDet.panelsBucket.leftSelector = ".two-panel-item.two-panel-left"; | ||
taLayoutDet.panelsBucket.dragBarSelector = ".two-panel-drag-bar"; | ||
// taLayoutDet.leftSelector = ".two-panel-item.two-panel-left"; | ||
// taLayoutDet.dragBarSelector = ".two-panel-drag-bar"; |
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.
is this still needed or can it be deleted?
site/public/js/ta-grading-v2.js
Outdated
} | ||
// current open panel will be either left or right panel from two-panel-mode | ||
// passing forceVisible = true, otherwise this method will just toggle it and it will get hidden | ||
setPanelsVisibilities(taLayoutDet.currentOpenPanel, true); | ||
initializeTwoPanelDrag(); | ||
// initializeTwoPanelDrag(); |
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.
same comment as above
} | ||
else { | ||
// taLayoutDet.numOfPanelsEnabled is 1 | ||
alert("Exchange works only when there are two panels..."); |
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.
I don't think this error message makes sense in this context, something like "Cannot swap left and right panels outside of two pannel mode" would be more descriptive
@@ -63,7 +63,7 @@ | |||
<button title="Toggle the two panel mode" | |||
class="invisible-btn key_to_click" |
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.
native HTML buttons will trigger the onclick
even if they are clicked on with a mouse or with the keyboard, the key_to_click
class is not required in this case
if (panelSpanId) { | ||
const panelId = panelSpanId.split('_btn')[0]; | ||
setPanelsVisibilities(panelId, null, position); | ||
$('select#' + panelId + '_select').hide(); |
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.
Submitty CSS Id's should use dashes instead of underscores
https://submitty.org/developer/coding_style_guide/css
However, when I was implementing the notebook code I started using dashes before I realized how much of the logic depended on the specific naming scheme. If it's too difficult to remove for now it can be refactored/made a future issue later.
I began modifying some of the logic to use -
instead on #5681 so there will be some overlap and merge conflicts most likely
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.
Its actually depended on _
for the DOM manipulation and is also used in the tests the same way... also I'm working on some other issue for TA-grading page, so, I will refactor(-
over _
) these in that PR.
Let's not worry about the merge conflicts I will update the logics which you are mentioning, thanks:)
site/public/js/ta-grading-v2.js
Outdated
const panelCont = leftPanel.parentElement; | ||
const dragbar = document.querySelector(taLayoutDet.panelsBucket.dragBarSelector); | ||
const leftPanel = document.querySelector(taLayoutDet.leftSelector); | ||
// const rightPanel = document.querySelector(taLayoutDet.panelsBucket.rightSelector); |
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.
is this needed still?
site/public/js/ta-grading-v2.js
Outdated
? taLayoutDet.panelsBucket.rightBottomSelector | ||
: taLayoutDet.panelsBucket.leftBottomSelector | ||
); | ||
// const rightPanel = document.querySelector(taLayoutDet.panelsBucket.rightSelector); |
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.
same comment as above
23d1ef5
to
7dc0848
Compare
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.
Works pretty well. I think there are some small bugs with the horizontal slider in 3 panel mode, when combined with full height left and/or hide sidebar & topbar. But I think this will be revised as you switch to the panel layout modal, so I will merge this now :)
Please check if the PR fulfills these requirements:
What is the current behavior?
Currently, the new TA grading interface only supports a maximum of two panels to be shown.
What is the new behavior?
Introduce the third panel in the ta-grading interface.
Steps to Use/this new panel
tags
icon in the panel-header to enter new interfaceOther information?
If you previously have opened this new TA grading interface you will need to clear out your localstorage... or paste this
localstorage.clear()
in your JS console.