Skip to content

[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

Merged
merged 22 commits into from
Aug 20, 2020
Merged

[Feature:TAGrading] 3 panel mode #5759

merged 22 commits into from
Aug 20, 2020

Conversation

mukul-kmr-jha
Copy link
Contributor

Please check if the PR fulfills these requirements:

  • The PR title and message follows our guidelines
  • Tests for the changes have been added/updated (if possible)
  • Documentation has been updated/added if relevant

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.

image

Steps to Use/this new panel

  1. Navigate to the ta-grading page
  2. Click on the tags icon in the panel-header to enter new interface
  3. Click on columns (panels) icon to switch between all the panel mode

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

@codecov
Copy link

codecov bot commented Jul 31, 2020

Codecov Report

Merging #5759 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5759   +/-   ##
=========================================
  Coverage     22.40%   22.40%           
  Complexity     6231     6231           
=========================================
  Files           157      157           
  Lines         20405    20405           
=========================================
  Hits           4571     4571           
  Misses        15834    15834           
Flag Coverage Δ Complexity Δ
#autograder 9.72% <ø> (ø) 0.00 <ø> (ø)
#migrator 99.10% <ø> (ø) 0.00 <ø> (ø)
#php 21.43% <ø> (ø) 6231.00 <ø> (ø)
#python_submitty_utils 82.32% <ø> (ø) 0.00 <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@bmcutler bmcutler requested a review from elihschiff August 5, 2020 05:14
@emaicus emaicus self-requested a review August 7, 2020 17:46
isFullScreenMode: false,
isFullLeftColumnMode: false,
currentOpenPanel: panelElements[0].str,
currentTwoPanels: {
left: null,
right: null,
leftTop: null,
Copy link
Member

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) {
Copy link
Member

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?

Copy link
Contributor Author

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)

$(".grade-panel .panel-position-cont").change(function() {
let panelSpanId = $(this).parent().attr('id');
let position = $(this).val();
console.log(position);
Copy link
Member

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?

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";
Copy link
Member

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?

}
// 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();
Copy link
Member

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...");
Copy link
Member

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"
Copy link
Member

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();
Copy link
Member

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

Copy link
Contributor Author

@mukul-kmr-jha mukul-kmr-jha Aug 11, 2020

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

const panelCont = leftPanel.parentElement;
const dragbar = document.querySelector(taLayoutDet.panelsBucket.dragBarSelector);
const leftPanel = document.querySelector(taLayoutDet.leftSelector);
// const rightPanel = document.querySelector(taLayoutDet.panelsBucket.rightSelector);
Copy link
Member

Choose a reason for hiding this comment

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

is this needed still?

? taLayoutDet.panelsBucket.rightBottomSelector
: taLayoutDet.panelsBucket.leftBottomSelector
);
// const rightPanel = document.querySelector(taLayoutDet.panelsBucket.rightSelector);
Copy link
Member

Choose a reason for hiding this comment

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

same comment as above

@elihschiff
Copy link
Member

Just a small comment. When you hover over the vertical blue bar between the 2 panels it fades/blurs however when you hover over the horizontal blue bar it does not. I think it should be consistent.

Screenshot taken when my mouse is over the blue bar even though it does not show up in screenshot
image

Same here but it does not blur while the other one does
image

@bmcutler bmcutler self-requested a review August 20, 2020 05:36
Copy link
Member

@bmcutler bmcutler left a 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 :)

@bmcutler bmcutler changed the title [Feature: InstructorUI] Introduce third panel mode in the ta-grading page [Feature:TAGrading] 3 panel mode Aug 20, 2020
@bmcutler bmcutler merged commit 84e930c into master Aug 20, 2020
@bmcutler bmcutler deleted the 3-panel-mode-ta-grading branch August 20, 2020 05:39
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