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

fixes powerschool showing icons next to every assignment #276

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

Suhas-13
Copy link
Member

@Suhas-13 Suhas-13 commented Apr 25, 2021

accounts for recent PowerSchool change where some courses have the missing icon in the HTML hidden.

fixes #275

Signed-off-by: Suhas Hariharan hariharan774531@sas.edu.sg

Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
@Suhas-13
Copy link
Member Author

@ARtheboss this should fix the issue, can you test as well?

@Suhas-13 Suhas-13 linked an issue Apr 25, 2021 that may be closed by this pull request
Copy link
Member

@gary-kim gary-kim left a comment

Choose a reason for hiding this comment

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

Just a few things that could be changed.

src/js/helpers.js Outdated Show resolved Hide resolved
@@ -203,7 +203,8 @@ function assignments (node) {
[...node.querySelector('table[align=center').querySelectorAll('tr')].slice(1, -1).forEach((e, i) => {
const curr = e.querySelectorAll('td');
const assignment = new Assignment(curr[2]?.innerText || "", curr[curr.length - 1]?.innerText || "", i);
if (e.querySelector('img[src="/images/icon_missing.gif"]')) {
const missingIcon = e.querySelector('img[src="/images/icon_missing.gif"]');
if (missingIcon && missingIcon.style.display !== 'none') {
Copy link
Member

Choose a reason for hiding this comment

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

You can simply this to the following, actually:

Suggested change
if (missingIcon && missingIcon.style.display !== 'none') {
if (missingIcon?.style.display !== 'none') {

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 don't think this actually works here as for some classes this will be null due to inconsistent CSS(some classes don't contain the missingicon gif and some do), and as such it should be counted as not missing if it doesn't exist.

@gary-kim gary-kim added the bug Something isn't working label Apr 26, 2021
Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
@Suhas-13 Suhas-13 requested a review from gary-kim April 27, 2021 12:08
Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
@Suhas-13 Suhas-13 merged commit efc87fa into master Apr 28, 2021
@megagames-me megagames-me deleted the fix-missing-indicator branch January 9, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

some classes are showing missing/exempt logo next to every assignment
3 participants