Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Conversation

@marwanaboudaoud
Copy link

No description provided.

Copy link
Contributor

@remarcmij remarcmij left a comment

Choose a reason for hiding this comment

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

Hi Marwan, there are some issues with HTML you generate that I would like you to fix. You also have a bit more CSS styling work to do. And please try to make your app responsive so that it looks good on mobile too.

@@ -0,0 +1,73 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you copy this file into the Week1/assets folder?

@@ -0,0 +1,23 @@
<!DOCTYPE html>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you copy this file into the Week1/assets folder?

@@ -0,0 +1,47 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you copy this file into the Week1/assets folder?

const header = createAndAppend('h1', div, { html: "HYF Repositories ", class: 'header' });
const select = createAndAppend('select', header, { class: "chose" });
const table = createAndAppend('table', div, { class: 'font' });
const tablebody = createAndAppend('tablebody', table);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no HTML element with the tag name tablebody. Did you mean tbody?

const select = createAndAppend('select', header, { class: "chose" });
const table = createAndAppend('table', div, { class: 'font' });
const tablebody = createAndAppend('tablebody', table);
const title = createAndAppend('a', tablebody);
Copy link
Contributor

Choose a reason for hiding this comment

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

A tbody element may only contain tr children.

select.addEventListener('change', (event) => {
const index = event.target.value;
const repository = repositories[index];
title.innerHTML = "Repository: " + repository.name;
Copy link
Contributor

Choose a reason for hiding this comment

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

The title variable is reference to an a tag. You are setting the innerHTML of that tag, but not the href attribute. Therefore it does not work as a link.

title.innerHTML = "Repository: " + repository.name;
title2.innerHTML = "Forks: " + repository.forks;
descripTitle.innerHTML = "Description: " + repository.description;
newTitle.innerHTML = "Updated: " + new Date(repository.updated_at).toLocaleString();
Copy link
Contributor

Choose a reason for hiding this comment

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

title2, descripTitle and newTitle (can you think of better names?) refer to tr elements. The only allowed content for tr elements are td and th elements. They cannot contain text or anything else. Therefore, first create a td element and append it to the tr. Then do whatever you like inside the td element.

Copy link
Contributor

Choose a reason for hiding this comment

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

You still did not address this issue: a tr element may only contain td and th elements. Nothing else, not even text.

});


select.addEventListener('change', (event) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not seeing information about the first selected repository when the page is first loaded. Only when we make a change, then we see the information. Can you make it so that the initial repo info is also displayed?


});
})
.catch((err) => console.log(err));
Copy link
Contributor

Choose a reason for hiding this comment

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

When there is an error fetching the contributors we can only see that error in the console which regular users do not have open. Can you render it to the HTML page instead?

Copy link
Contributor

@remarcmij remarcmij left a comment

Choose a reason for hiding this comment

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

It looks I forgot to finish my review. There were some changes I was planning to request. Can you implement them in your latest week 3 PR?

title.innerHTML = "Repository: " + repository.name;
title2.innerHTML = "Forks: " + repository.forks;
descripTitle.innerHTML = "Description: " + repository.description;
newTitle.innerHTML = "Updated: " + new Date(repository.updated_at).toLocaleString();
Copy link
Contributor

Choose a reason for hiding this comment

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

You still did not address this issue: a tr element may only contain td and th elements. Nothing else, not even text.

contributors.forEach(contributor => {
const avatar = createAndAppend('img', container, { class: 'avatar' });
avatar.setAttribute("src", contributor.avatar_url);
const list = createAndAppend('ul', container, { class: 'list' });
Copy link
Contributor

Choose a reason for hiding this comment

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

You should a single list (one ul only) of contributors. Here you are creating a new list for each contributor.

@@ -1,3 +1,99 @@
.alert-error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Your app is not responsive. This is what it looks like on a iPhone 6:

responsive

title.innerHTML = "Repository: " + repository.name;
titleFork.innerHTML = "Forks: " + repository.forks;
descripTitle.innerHTML = "Description: " + repository.description;
newTitle.innerHTML = "Updated: " + new Date(repository.updated_at).toLocaleString();
Copy link
Contributor

Choose a reason for hiding this comment

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

My comment from last homework is still not addressed: titleFork, descripTitle and newTitle refer to tr elements. A tr element may only contain td or th elements, nothing else, not even text.

@profxed profxed mentioned this pull request Sep 4, 2018
@remarcmij remarcmij closed this Oct 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants