Skip to content

Commit

Permalink
#24 - code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak committed Aug 19, 2024
1 parent 802bdbd commit 7222f26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"debug" => (bool)env("APP_DEBUG", false),
"url" => env("APP_URL", "http://localhost"),
"asset_url" => env("ASSET_URL"),
"timezone" => env("APP_TIMEZONE", "UTC"),
"timezone" => env("APP_TIMEZONE", "Europe/Warsaw"),
"locale" => "pl",
"fallback_locale" => "en",
"faker_locale" => "pl",
Expand Down
1 change: 1 addition & 0 deletions lang/pl/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"university_name" => "nazwa uczelni",
"department_name" => "nazwa wydziału",
"title" => "tytuł",
"content" => "treść",
"value" => "opis",
],
];
13 changes: 9 additions & 4 deletions resources/js/Pages/Public/News/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import BackgroundGrid from '../../../Components/BackgroundGrid.vue'
import SectionHeader from '../../../Components/SectionHeader.vue'
import Pagination from '../../../Components/Pagination.vue'
import { NoSymbolIcon } from '@heroicons/vue/24/outline'
defineProps({
paginator: Object,
})
Expand Down Expand Up @@ -37,14 +39,17 @@ defineProps({
{{ post.title }}
</a>
</h3>
<p class="mt-5 line-clamp-3 text-sm leading-6 text-gray-600">
{{ post.content }}
</p>
<p class="mt-5 line-clamp-3 text-sm leading-6 text-gray-600" v-html="post.content"></p>

Check warning on line 42 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Require self-closing on HTML elements (<p>)

Check warning on line 42 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

'v-html' directive can lead to XSS attack
</div>
</article>
</div>

<div class="mt-24 flex justify-center">
<div class="text-center" v-if="paginator.data.length === 0">

Check warning on line 47 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Attribute "v-if" should go before "class"
<NoSymbolIcon class="mx-auto h-12 w-12 text-gray-400"></NoSymbolIcon>

Check warning on line 48 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Require self-closing on Vue.js custom components (<NoSymbolIcon>)

Check warning on line 48 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Classnames 'h-12, w-12' could be replaced by the 'size-12' shorthand!
<h3 class="mt-2 text-sm font-semibold text-gray-900">Brak aktualności</h3>

Check warning on line 49 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Expected 1 line break after opening tag (`<h3>`), but no line breaks found

Check warning on line 49 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Expected 1 line break before closing tag (`</h3>`), but no line breaks found
</div>

<div class="mt-24 flex justify-center" v-if="paginator.data.length > 0">

Check warning on line 52 in resources/js/Pages/Public/News/Index.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Attribute "v-if" should go before "class"
<Pagination :pagination="paginator" />
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/Pages/Public/News/News.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ defineProps({
{{ news.title }}
</template>
<template #subheader>
wiadomość z dnia {{ news.published_at_formatted }}
wiadomość z dnia {{ news.published_at }}
</template>
</SectionHeader>

<div class="mt-10">
<p>Faucibus commodo massa rhoncus, volutpat. Dignissim sed eget risus enim. Mattis mauris semper sed amet vitae sed turpis id. Id dolor praesent donec est. Odio penatibus risus viverra tellus varius sit neque erat velit. Faucibus commodo massa rhoncus, volutpat. Dignissim sed eget risus enim. Mattis mauris semper sed amet vitae sed turpis id.</p>
</div>
<div class="mt-10" v-html="news.content"></div>

Check warning on line 26 in resources/js/Pages/Public/News/News.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Require self-closing on HTML elements (<div>)

Check warning on line 26 in resources/js/Pages/Public/News/News.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

'v-html' directive can lead to XSS attack
</div>
</div>
</div>
Expand Down

0 comments on commit 7222f26

Please sign in to comment.