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

Add delete events feature #18

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

macdeath-AA
Copy link
Collaborator

No description provided.

src/App.js Outdated
Comment on lines 91 to 102
jsonObj.forEach((delEvent) => {
console.log(startTime, delEvent.title);

if (
delEvent.title === eventName
&& delEvent.start === startTime
&& delEvent.end === endTime
) {
return;
}
newCustomList.push(delEvent);
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be replaced by a filter method, but it probably won't impact performance anyways

Copy link
Collaborator

@tarun-menta tarun-menta left a comment

Choose a reason for hiding this comment

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

Course events are not getting deleted. This is because course events are stored in both masterkey and aimskey in localStorage. Simple fix is to iterate through the JSON stored in aimskey too, and repeat the same deletion code there too

return;
}
newCustomList.push(delEvent);
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Get rid of the unnecessary console logs. Variables like jsonObj need to be changed to more meaningful names.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. Variable names like delEvent can be improved. Especially because delEvent is actually the event which stays and is not being deleted!

A generic name for the function argument like event might suffice.

src/pages/TimeTable.js Outdated Show resolved Hide resolved
src/pages/TimeTable.js Outdated Show resolved Hide resolved
@macdeath-AA
Copy link
Collaborator Author

macdeath-AA commented Apr 11, 2022 via email

- Windows error popup when trying to delete AIMS event
- Changed variable names
- Removed console logs and unnecessary comments
Copy link
Contributor

@RachitKeertiDas RachitKeertiDas left a comment

Choose a reason for hiding this comment

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

It seems that the eslint and prettier hooks were not run, again.
There is also an eslint issue (react/forbid-prop-types) causing some issues atm.

Also, the AIMS Error mesages sdoes not show up if you're using the newer extension, in which the title also contains the course names.

clickInfo.event.remove();
handleDeleteEvent(

const aimsTitle = aimsCourse.identifiedCourses.find(course => course === clickInfo.event.title)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not going to work in the newer version of the extension, where the course title also includes the course name.

if (aimsTitle !== undefined){
window.alert('AIMS courses cannot be deleted.');
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation Error

@RachitKeertiDas
Copy link
Contributor

The latest pushed commit is not related to this PR.

Please make a new pull request with the corresponding topic, and with only the latest commit and not the earlier commit.

Thanks!

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