Skip to content

Conversation

@RespectableRuessel
Copy link
Collaborator

@RespectableRuessel RespectableRuessel commented Jan 25, 2021

Pull request for exercise 7.
Switched the frontend to nuxtjs and connected the front- and backend via graphql.

Review can be found here.

PWA Report:
Lighthouse

@RespectableRuessel RespectableRuessel requested a review from a team January 25, 2021 19:39
Copy link

@SarahLM SarahLM left a comment

Choose a reason for hiding this comment

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

Another star found for Lighthouse reporting that your production website is installable as PWA (except HTTPS)
and one for instructions in the README.md on how to build your webapp for production

<button @click="updateNews(1)">Upvote</button>
<button @click="updateNews(-1)">Downvote</button>
<button @click="deleteNews">Remove</button>
<button v-if="token" @click="updateNews(1)">Upvote</button>
Copy link

Choose a reason for hiding this comment

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

star For an upvote button that behaves according to the authentication state of your user

Comment on lines +7 to +8
<button v-if="authorId === news.author.id" @click="deleteNews">Delete</button>
<button v-if="authorId === news.author.id">Edit</button>
Copy link

Choose a reason for hiding this comment

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

star For a delete and edit button that is only visible to the author of the post.

Comment on lines 54 to 69
methods: {
vote() {
async setupNewsList() {
this.token = this.$apolloHelpers.getToken();
if (this.token) {
this.authorId = jwtDecode(this.token).userId;
}
const { data } = await this.$apollo.query({ query: FETCH_ITEMS });
this.newsItems = data.posts;
},
async vote(item) {
const { data } = await this.$apollo.mutate({ mutation: UPVOTE_MUTATION, variables: { id: item.id } });
if (data.upvote) {
this.newsItems = this.newsItems.filter((elem) => elem.id !== item.id);
this.newsItems.push(data.upvote);
}
Copy link

Choose a reason for hiding this comment

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

great finish for linking to backend

Copy link
Contributor

@medizinmensch medizinmensch left a comment

Choose a reason for hiding this comment

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

Hi @Systems-Development-and-Frameworks/pls-no-js !

Looks very good! Always fun to read your little easter eggs ("ichbingesetzt", "no-nuxt-pls").
Your tests could be more extensive though. You barely did the minimum.
Also, remember to delete test files and things you don't need (like "content/hello.md").

⭐ For instructions in the README.md on how to build your webapp for production.
⭐ For no changes in "Files Changed" tab of the refactoring from vue-cli to create-nuxt-app. (See #1 in instructions)
⭐ ⭐ For the API connection between your front- and backend.
⭐ For your previous frontend tests still passing. Requests to the backend are mocked.
⭐ ⭐ For a login feature in your webapp including a Vue component and its software tests.
⭐ ⭐ For a menu component which shows a login or logout button and its software tests.
⭐ For an upvote button that behaves according to the authentication state of your user
⭐ For a delete and edit button that is only visible to the author of the post.
⭐ For Lighthouse reporting that your production website is installable as PWA (except HTTPS).
⭐ For requesting a review and reviewing another team's PR.

That makes 13/13 ⭐

Good job

Comment on lines +6 to +7
describe('Menu.vue', () => {
test('renders login when user is not logged in', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

A little strange that you test Menu.vue in your Login.spec.js

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.

5 participants