Bruno Predot

Merge branch 'hotfix/0.3.2'

... ... @@ -37,8 +37,12 @@ defineProps({
</div>
</div>
<div class="p-4">
<h2 class="text-lg font-bold mb-1 line-clamp-1">{{ movie.title }}</h2>
<p class="text-sm text-gray-400">{{ useDateFormat(movie.release_date, "DD-MM-YYYY") }}</p>
<h2 class="text-lg font-bold mb-1 line-clamp-1">
{{ movie.title }}
</h2>
<p class="text-sm text-gray-400">
{{ useDateFormat(movie.release_date, "DD-MM-YYYY") }}
</p>
</div>
</section>
</template>
... ...
... ... @@ -47,7 +47,9 @@ watch(
{{ comment.rating }}
</section>
</div>
<p :id="`message${index}`" class="text-gray-300">{{ comment.message }}</p>
<p :id="`message${index}`" class="text-gray-300">
{{ comment.message }}
</p>
</div>
</section>
<!-- Si aucun commentaire -->
... ...
<script lang="ts" setup>
//#region --Props--.
const props = defineProps({
defineProps({
score: {
type: Number,
required: true,
... ... @@ -35,7 +35,9 @@ const formatVoteCount = (count: number) => {
</section>
<section>
<p class="font-semibold">Note TMDB</p>
<div class="text-sm text-gray-400">{{ formatVoteCount(nbVote) }}</div>
<div class="text-sm text-gray-400">
{{ formatVoteCount(nbVote) }}
</div>
</section>
</section>
</template>
... ...
... ... @@ -56,9 +56,9 @@ const formData = reactive({
const v$ = useVuelidate(rules, formData);
//#endregion
const errormessages = computed(() => {
return v$.value.message.$errors.map((e) => e.$message);
});
// const errormessages = computed(() => {
// return v$.value.message.$errors.map((e) => e.$message);
// });
//#region --Function--.
async function submitComment() {
... ... @@ -129,7 +129,7 @@ function handleMessageEvent(event: string) {
</span>
<span v-else>Publier le commentaire</span>
</v-btn>
<v-btn class="mt-6 mr-4" color="primary" @click="clear"> effacer</v-btn>
<v-btn class="mt-6 mr-4" color="primary" @click="clear"> effacer </v-btn>
</VForm>
</section>
</template>
... ...
// @ts-check
import withNuxt from "./.nuxt/eslint.config.mjs";
import js from "@eslint/js";
import eslintPluginVue from "eslint-plugin-vue";
import ts from "typescript-eslint";
export default withNuxt();
// Your custom configs here
export default withNuxt(
// Your custom configs here
js.configs.recommended,
...ts.configs.recommended,
...eslintPluginVue.configs["flat/recommended"],
{
files: ["*.vue", "**/*.vue"],
languageOptions: {
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
rules: {
"vue/multi-word-component-names": "off",
},
},
// your custom flat configs go here, for example:
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {
// 'no-console': 'off' // allow console.log in TypeScript files
// }
// },
// {
// ...
// }
);
... ...
... ... @@ -9,8 +9,8 @@ export interface CreditInterface {
export type CreditsResponse = {
id: number;
cast: CreditInterface[],
crew: CreditInterface[],
cast: CreditInterface[];
crew: CreditInterface[];
movie_id: unknown;
movie: MovieInterface;
}
};
... ...
import type { CreditInterface, CreditsResponse } from "~/interfaces/credit";
import type { CreditsResponse } from "~/interfaces/credit";
export interface MovieInterface {
id: number;
... ... @@ -12,7 +12,7 @@ export interface MovieInterface {
popularity: number;
poster_path: string | null;
release_date: string;
runtime: number
runtime: number;
title: string;
video: boolean;
vote_average: number;
... ... @@ -21,6 +21,6 @@ export interface MovieInterface {
}
export type Genre = {
id: number,
name: string,
}
\ No newline at end of file
id: number;
name: string;
};
... ...
... ... @@ -22,10 +22,10 @@ export class MovieComment extends Model {
return {
// Attributs.
id: this.uid(),
createdAt: this.string(''),
username: this.string(''),
message: this.string(''),
rating: this.string(''),
createdAt: this.string(""),
username: this.string(""),
message: this.string(""),
rating: this.string(""),
// Relations.
movie_id: this.attr(null),
movie: this.belongsTo(Movie, "movie_id", "id"),
... ...
... ... @@ -9,7 +9,7 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint:js": "eslint --ext \".ts,.vue\" .",
"lint:js": "eslint --ext \".ts,.vue\" . --fix",
"lint:prettier": "prettier --write .",
"lint": "npm run lint:js && npm run lint:prettier",
"format": "prettier --write \"{components,pages,plugins,middleware,layouts,composables,assets}/**/*.{js,jsx,ts,tsx,vue,html,css,scss,json,md}\"",
... ...
... ... @@ -173,7 +173,9 @@ onMounted(() => {
<!-- Informations du film -->
<section class="w-full md:w-2/3 lg:w-3/4">
<h1 class="text-3xl md:text-4xl font-bold mb-2">{{ movie.title }}</h1>
<h1 class="text-3xl md:text-4xl font-bold mb-2">
{{ movie.title }}
</h1>
<p v-if="movie.release_date" class="text-gray-400 mb-4">
{{ useDateFormat(movie.release_date, "DD-MM-YYYY") }} • {{ formatRuntime(movie.runtime) }}
</p>
... ... @@ -187,7 +189,9 @@ onMounted(() => {
<!-- Synopsis -->
<div class="mb-6">
<h2 class="text-xl font-bold mb-2">Synopsis</h2>
<p class="text-gray-300">{{ movie.overview || "Aucun synopsis disponible." }}</p>
<p class="text-gray-300">
{{ movie.overview || "Aucun synopsis disponible." }}
</p>
</div>
<!-- Réalisateur et têtes d'affiche -->
... ...
export type Comment = {
username: string
message: string
rating: number
}
\ No newline at end of file
username: string;
message: string;
rating: number;
};
... ...
// vite.config.js
import vue from '@vitejs/plugin-vue'
import vue from "@vitejs/plugin-vue";
export default {
plugins: [vue()],
... ... @@ -8,4 +8,4 @@ export default {
environment: "happy-dom",
// Additional test configurations can be added here
},
}
\ No newline at end of file
};
... ...
import { defineVitestConfig } from '@nuxt/test-utils/config'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath } from 'node:url'
import { defineVitestConfig } from "@nuxt/test-utils/config";
import { fileURLToPath } from "node:url";
export default defineVitestConfig({
/**
... ... @@ -8,31 +7,31 @@ export default defineVitestConfig({
* any custom Vitest config you require
*/
test: {
environment: 'nuxt',
environment: "nuxt",
globals: true,
// you can optionally set Nuxt-specific environment options
environmentOptions: {
nuxt: {
rootDir: fileURLToPath(new URL('./', import.meta.url)),
domEnvironment: 'happy-dom', // 'happy-dom' (default) or 'jsdom'
rootDir: fileURLToPath(new URL("./", import.meta.url)),
domEnvironment: "happy-dom", // 'happy-dom' (default) or 'jsdom'
overrides: {
// other Nuxt config you want to pass
},
mock: {
intersectionObserver: true,
indexedDb: true,
}
},
},
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
}
provider: "v8",
reporter: ["text", "json", "html"],
},
},
resolve: {
alias: {
'~': fileURLToPath(new URL('./', import.meta.url)),
'@': fileURLToPath(new URL('./', import.meta.url)),
}
}
})
"~": fileURLToPath(new URL("./", import.meta.url)),
"@": fileURLToPath(new URL("./", import.meta.url)),
},
},
});
... ...