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

feat: open instructor tool in new tab #14

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

varshamenon4
Copy link
Member

@varshamenon4 varshamenon4 commented Oct 12, 2023

MST-2074

Rather than viewing the instructor tool in an iframe from the review dashboard, there is now a button that links to the tool and opens it in a new window.

Screenshot 2023-10-19 at 1 05 41 PM

Copy link
Member Author

@varshamenon4 varshamenon4 left a comment

Choose a reason for hiding this comment

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

Still need to figure out issue with my local dev environment so I can test and need to add unit tests but just wanted to put out for review to make sure I'm making the changes in the right place/understand the ticket! Thanks.

.env Outdated Show resolved Hide resolved
<div data-testid="review_dash">
{exam && <iframe title="lti_tool" src={getLaunchUrlByExamId(exam.id)} width="100%" height="1100" style={{ border: 'none' }} />}
<div>
{!process.env.LTI_INSTRUCTOR_EMBED && exam && window.open(getLaunchUrlByExamId(exam.id), '_blank')}
Copy link
Member Author

Choose a reason for hiding this comment

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

defaults to opening in new tab (based on env settings) and keeps logic below to embed as iframe.

@varshamenon4 varshamenon4 force-pushed the varshamenon4/instructor-tool-new-tab branch from 5642df3 to b4ab396 Compare October 18, 2023 18:47
Copy link
Member Author

@varshamenon4 varshamenon4 left a comment

Choose a reason for hiding this comment

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

Created a button as discussed in slack. Added some questions.

<div data-testid="review_dash">
<div>
{!ltiToolEmbed && exam && (
// todo: add spacing
Copy link
Member Author

Choose a reason for hiding this comment

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

Right now, there is no spacing/padding around the button (see screenshot). I tried by adding classname='p-0' to the button based on similar examples, but I'm now wondering whether this spacing should be added to the component above (i.e. exams page or just the review dashboard)

Copy link
Member

Choose a reason for hiding this comment

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

I'd look at paragon for layout options and/or a containing element for the button. Maybe https://paragon-openedx.netlify.app/components/actionrow/?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added some padding.

src/pages/ExamsPage/components/ExternalReviewDashboard.jsx Outdated Show resolved Hide resolved
src/pages/ExamsPage/messages.js Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2023

Codecov Report

Merging #14 (bae1d12) into main (e041d07) will increase coverage by 0.34%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   74.73%   75.08%   +0.34%     
==========================================
  Files          22       22              
  Lines         285      289       +4     
  Branches       27       29       +2     
==========================================
+ Hits          213      217       +4     
  Misses         69       69              
  Partials        3        3              
Files Coverage Δ
...s/ExamsPage/components/ExternalReviewDashboard.jsx 100.00% <100.00%> (ø)
src/pages/ExamsPage/messages.js 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

// By default, launch instructor tool in a new tab. Otherwise, embed in dashboard as iframe.
return (
<div data-testid="review_dash">
<div style={{ padding: 10 }}>
Copy link
Member Author

Choose a reason for hiding this comment

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

Figured out how to add some padding here without needing to use the Container (the behavior is the same). The only thing I'm unsure about from a best practice standpoint is whether there is a better way to not "hard code" the padding and have it be flexible.

Copy link
Member Author

Choose a reason for hiding this comment

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

I reached out to Gabe to see if he could point me to the right place but also okay with leaving it as is as it does work! I don't know if it's overkill and better to just merge/adjust later if needed.

Copy link
Member

Choose a reason for hiding this comment

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

in general I'd say avoid inline styling if possible but this is pretty small, let's just get this in since Proctorio devs can't launch this page w/o the fix.

@varshamenon4 varshamenon4 force-pushed the varshamenon4/instructor-tool-new-tab branch from a03a365 to bae1d12 Compare October 19, 2023 17:05
@varshamenon4 varshamenon4 marked this pull request as ready for review October 19, 2023 17:07
Copy link
Member

@ilee2u ilee2u left a comment

Choose a reason for hiding this comment

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

I think we'll also need the link in the ReviewExamAttemptButton to open in a new tab as well, which I think may be easily done by setting the "target" param in the button (relevant doc: https://paragon-openedx.netlify.app/components/hyperlink/#props-api)

@varshamenon4 varshamenon4 merged commit 3288715 into main Oct 23, 2023
3 checks passed
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