Skip to content

Conversation

@jobegrabber
Copy link
Collaborator

No description provided.

Use TailwindCSS 2 for webapp (requires move to yarn)
@jobegrabber jobegrabber changed the base branch from main to exercise7 February 1, 2021 00:42
Copy link
Collaborator Author

@jobegrabber jobegrabber left a comment

Choose a reason for hiding this comment

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

Flex ALL the thins

Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

thumbs up

Hey @Systems-Development-and-Frameworks/dojo you received all 5/5 ⭐ in this exercise. The result doesn't look as visually appealing to what I saw already. But I'm not good in design and visuals myself 😞

The sidebar menu is always open in my browser (Firefox, Chromium). Is this a bug or not yet implemented?

⭐ For a header and it's responsiveness (direct links vs. hamburger menu)

⭐ For a content section and it's content items

⭐ For a responsive content section (3-column vs 1-column layout)

⭐ For responsive content items (1-column vs. 2-column layout)

⭐ For a footer

Swappshot Tue Feb 16 13:39:50 2021

Swappshot Tue Feb 16 13:40:03 2021

Here's a security advice: You shouldn't distinguish between "E-Mail not found" and "Password incorrect" to prevent an attacker from doing a user listing.

Swappshot Tue Feb 16 13:40:33 2021

In total you received all 70/70 ⭐ during the entire course - outstanding!

:href="href"
class="inline-flex m-1.5 px-2.5 py-2 rounded-lg shadow-md text-white text-center
cursor-pointer justify-center items-center"
:class="(!disabled ? `bg-${color}-500 hover:bg-${color}-600` : `bg-gray-500`) + (bold ? ' font-semibold' : '')">
Copy link
Contributor

Choose a reason for hiding this comment

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

PurgeCSS will not be able to pick up the class names here. Don't use string interpolation like that in tailwind, instead, enumerate the classes.

</nav>
<div
class="absolute z-20 w-full h-full bg-gray-50 opacity-50"
:class="sidebarOpen ? '' : 'hidden'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:class="sidebarOpen ? '' : 'hidden'"
:class="{sidebarOpen : 'hidden'}"

DojoNews
</section>
<section class="hidden lg:block lg:flex lg:justify-between lg:bg-transparent">
<NavMenu :is-authenticated="isAuthenticated" @logout="logout()"></NavMenu>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<NavMenu :is-authenticated="isAuthenticated" @logout="logout()"></NavMenu>
<NavMenu :is-authenticated="isAuthenticated" @logout="logout"></NavMenu>

:class="sidebarOpen ? 'left-0' : '-left-1/2 md:-left-1/3'"
>
<button class="self-end" @click="sidebarOpen = false">[x]</button>
<NavMenu :vertical="true" :is-authenticated="isAuthenticated" @logout="logout(); sidebarOpen = false"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use a dedicated method when you have to split commands with ;.

async logout() {
this.unsetToken()
await this.$apolloHelpers.onLogout()
await this.$nuxt.refresh()
Copy link
Contributor

Choose a reason for hiding this comment

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

Components should be reactive. Refetching data manually shouldn't be necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It shouldn't, but somehow the tests fail otherwise 🤷‍♂️

Comment on lines +27 to +29
<style scoped>
</style> No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<style scoped>
</style>

@@ -0,0 +1,30 @@
<template>
<nuxt-link @click.native="$emit('click')" :to="this.to" tag="div" class="flex">
<BasicButton :color="this.color" class="flex-grow" :href="this.href">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? 😕

},
computed: {
sortedNewsListItems () {
sortedNewsListItems() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you change your lint configurations? 🤔

Having these changes creates noise and distracts from relevant changes. You probably want to exclude those changes from the PR being reviewed.

<main>
<LoginForm/>
</div>
</main>
Copy link
Contributor

Choose a reason for hiding this comment

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

I like.

@jobegrabber
Copy link
Collaborator Author

Thanks for the review @roschaefer !

The sidebar menu is always open in my browser (Firefox, Chromium). Is this a bug or not yet implemented?

How do you run the app? To use Tailwind 2 I had to switch to yarn on the webapp side.
With yarn run dev the sidebar works as expected for me.

Swappshot Tue Feb 16 13:39:50 2021

Swappshot Tue Feb 16 13:40:03 2021

Here's a security advice: You shouldn't distinguish between "E-Mail not found" and "Password incorrect" to prevent an attacker from doing a user listing.

For this toy application, yes, that would prevent an attacker from listing user email addresses.
But for pretty much any proper application (which allows open registration of new users) this won't help really; the attacker can probe for user email addresses during registration.

I think rate-limits and captchas for both login and registration are better for providing security.

@roschaefer
Copy link
Contributor

Thanks for the review @roschaefer !

The sidebar menu is always open in my browser (Firefox, Chromium). Is this a bug or not yet implemented?

How do you run the app? To use Tailwind 2 I had to switch to yarn on the webapp side.
With yarn run dev the sidebar works as expected for me.

Swappshot Tue Feb 16 13:39:50 2021
Swappshot Tue Feb 16 13:40:03 2021
Here's a security advice: You shouldn't distinguish between "E-Mail not found" and "Password incorrect" to prevent an attacker from doing a user listing.

For this toy application, yes, that would prevent an attacker from listing user email addresses.
But for pretty much any proper application (which allows open registration of new users) this won't help really; the attacker can probe for user email addresses during registration.

I think rate-limits and captchas for both login and registration are better for providing security.

I'm pretty sure I used npm because you have it in your README.md and you have package-lock.json and no yarn.lock in your webapp/.

Both for password reset and signup you don't have to expose user information. E.g. if the email address exists or not, you can send "We have sent an email with further instructions to ". There are best practices for that on the internet.

@jobegrabber
Copy link
Collaborator Author

I'm pretty sure I used npm because you have it in your README.md and you have package-lock.json and no yarn.lock in your webapp/.

yarn.lock is there, but I did forget to update the README, thanks!! 😄

Both for password reset and signup you don't have to expose user information. E.g. if the email address exists or not, you can send "We have sent an email with further instructions to ". There are best practices for that on the internet.

Ah yes, that's a nice way to get around that issue, 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.

3 participants