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

[CM-16] Create plug-and-chuggable embedded CM #14

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

naveen-nathan
Copy link
Contributor

@naveen-nathan naveen-nathan commented Nov 1, 2024

Jira Ticket

Jira Ticket

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Changes

Testing

Checklist

  • My branch name matches the format: <ticket-id>/<brief-description-of-change>
  • My PR name matches the format: [<ticket-id>] <brief-description-of-change>
  • I have added doc-comments to all new functions (JSDoc for JS and Docstrings for Python)
  • I have reviewed all of my code
  • My code only contains major changes related to my ticket

Screenshots/Video

Additional Notes


// Check if the current URL matches the target page URL
if (currentUrl === targetPageUrl || currentUrl === alternateTargetPageUrl) {
const accessToken = '26530~etwvNZ2z3WXDxP9CXDeDNCmKN3MCWEKtDaYrQ7JRVGJ6nkBUcR8V4VURDVMBuLeW';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally forgot to remove this. I have disabled this access token.

Copy link
Member

Choose a reason for hiding this comment

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

Please make sure to review all code before committing. I get it, mistakes happen, but in industry, committing a private key would be a major issue and you'd have a full retro meeting just for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted!

Comment on lines +9 to +10
const courseId = '141';
const studentId = ENV.current_user_id; // Replace with the actual student ID
Copy link
Member

Choose a reason for hiding this comment

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

How are these going to be sourced?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The courseId will be entered as a constant

I meant to remove the in-line comment on line 10. Sorry about that! Please disregard the comment. The studentId can be accessed by by ENV.current_user_id, which is the user id of the user for whom the page is being generated.

const targetPageUrl = 'https://ucberkeleysandbox.instructure.com/courses/141/pages/concept-map?module_item_id=418';
const alternateTargetPageUrl = 'https://ucberkeleysandbox.instructure.com/courses/141/pages/concept-map';
// Paste Canvas API key here
const accessToken = '';
Copy link
Member

Choose a reason for hiding this comment

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

Whose access token is this?

Copy link
Member

Choose a reason for hiding this comment

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

We discussed not using student access tokens, so if this is a service account access token, that's fine, but only if the students cannot see this js. How is this handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a service account access token. Students will not be able to see this js; the Canvas Theme Editor allows this code to be run server-side.

@Connor-Bernard Connor-Bernard marked this pull request as draft November 2, 2024 04:21
@naveen-nathan naveen-nathan changed the title Add embedded CM generated from test data Create plug-and-chuggable embedded CM Nov 19, 2024
@naveen-nathan naveen-nathan changed the title Create plug-and-chuggable embedded CM [CM-29] Create plug-and-chuggable embedded CM Nov 19, 2024
@naveen-nathan naveen-nathan changed the title [CM-29] Create plug-and-chuggable embedded CM [CM-16] Create plug-and-chuggable embedded CM Nov 19, 2024
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.

2 participants