Skip to content

ITP Jan 25 | Katarzyna Kazimierczuk | Data Groups | Sprint 3 #505

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

katarzynakaz
Copy link

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@katarzynakaz katarzynakaz added the Needs Review Participant to add when requesting review label Apr 19, 2025
@shieldo
Copy link

shieldo commented Apr 20, 2025

This branch seems to be based on an existing piece of work and it isn't clear exactly which code is up for review here. Do be careful to base branches from upstream main so that it's really clear what work is being submitted, and also make sure that commit messages explain the intent of individual changes (rather than things like "sprint3").

Was this meant to be a separate PR?

@katarzynakaz katarzynakaz requested a review from shieldo April 21, 2025 17:07
@shieldo
Copy link

shieldo commented Apr 21, 2025

@katarzynakaz Hello - it's still unclear here whether this is meant to be a combined PR. In the changes here there is work in the 'quote-generator', 'slideshow', and 'todo-list' directories - is this correct?

@katarzynakaz
Copy link
Author

katarzynakaz commented Apr 21, 2025

@katarzynakaz Hello - it's still unclear here whether this is meant to be a combined PR. In the changes here there is work in the 'quote-generator', 'slideshow', and 'todo-list' directories - is this correct?

@shieldo Hello, sorry, I didn't see your comment from yesterday.
This is a general sprint 3 pr to cover '2 tasks - slideshow' and 'todo' from sprint 3.
The 'quote-generator' has been reviewed on a separate PR.
Apologies for not being clear.

Todo:
cdb1d37

Slideshow:
b7a0d56

@cjyuan
Copy link

cjyuan commented Apr 22, 2025

On separate note, it is a good practice, when submitting a PR, check the self checklist and give a brief description to the PR.

image

Copy link

@shieldo shieldo left a comment

Choose a reason for hiding this comment

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

There's some really good work here - writing code that updates aspects of the DOM based on user actions is quite a hard thing to manage, and you've taken the sensible approach of rendering either the image you are showing (in the slideshow) or the state of the todos (for the todo list) in a separate function, which is a scalable way of going about things that follows a similar approach to how web rendering libraries such as React work.

There's a couple of places here that don't quite work, but you've done well here.

<button type="button" id="backward-btn">Backwards</button>
<button type="button" id="forward-btn">Forward</button>
</div>
<button type="button" class="small" id="auto-forward-bt">
Copy link

Choose a reason for hiding this comment

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

It looks like there is a mistype here that is causing the JavaScript to fail. Can you spot it? Looking in the Console tab of your browser's dev tools might help!


//automated slideshow button event listeners
autoForwardBtn.addEventListener("click", () => setInterval(forward, 1500));
Copy link

Choose a reason for hiding this comment

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

This would probably work pretty well, but our forward function here just changes the index of the picture that would be shown if updatePicture were called. The idea of separately updating the picture is a pretty good one, and sometimes that pattern could be what you want, but maybe in this case it might be better to call updatePicture at the end of the forward and back functions? It seems that every time we call forward, for example, we're going to want to change the display of the image. If things were to get more complicated then maybe you'd want to call the updatePicture function separately.

checkbox.checked = todoObject.completed;

// clicked, toggle competed or not completed
checkbox.addEventListener("change", () => {
Copy link

Choose a reason for hiding this comment

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

Using a checkbox like this works pretty well here - and checking the box does have the effect of marking the todo as done!

The instructions do say to use

  <i class="fa fa-check" aria-hidden="true"></i>
  <i class="fa fa-trash" aria-hidden="true"></i>

here to show a checkbox and a trash symbol for deleting a todo.

document.getElementById("add").addEventListener("click", addNewTodo);

//ignore this part
// nope :) :)
Copy link

Choose a reason for hiding this comment

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

:)

@shieldo shieldo added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants