diff --git a/package.json b/package.json index 9299c0d..36358e8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@mdi/font": "^7.4.47", "@profcomff/api-uilib": "^2024.10.22", "@types/eslint__js": "^8.42.3", + "@types/node": "^22.9.0", "@typescript-eslint/eslint-plugin": "^8.13.0", "@typescript-eslint/parser": "^8.13.0", "@vitejs/plugin-vue": "^4.6.2", @@ -36,7 +37,6 @@ "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-vue": "^9.30.0", "globals": "^15.12.0", - "markdown-it": "^14.1.0", "openapi-typescript": "^7.4.2", "postcss-html": "^1.7.0", "postcss-preset-env": "^9.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc2d096..afb29a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,6 +42,9 @@ importers: '@types/eslint__js': specifier: ^8.42.3 version: 8.42.3 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 '@typescript-eslint/eslint-plugin': specifier: ^8.13.0 version: 8.13.0(@typescript-eslint/parser@8.13.0(eslint@9.14.0)(typescript@5.6.3))(eslint@9.14.0)(typescript@5.6.3) @@ -50,7 +53,7 @@ importers: version: 8.13.0(eslint@9.14.0)(typescript@5.6.3) '@vitejs/plugin-vue': specifier: ^4.6.2 - version: 4.6.2(vite@4.5.5)(vue@3.5.12(typescript@5.6.3)) + version: 4.6.2(vite@4.5.5(@types/node@22.9.0))(vue@3.5.12(typescript@5.6.3)) '@vue/eslint-config-typescript': specifier: ^12.0.0 version: 12.0.0(eslint-plugin-vue@9.30.0(eslint@9.14.0))(eslint@9.14.0)(typescript@5.6.3) @@ -66,9 +69,6 @@ importers: globals: specifier: ^15.12.0 version: 15.12.0 - markdown-it: - specifier: ^14.1.0 - version: 14.1.0 openapi-typescript: specifier: ^7.4.2 version: 7.4.2(typescript@5.6.3) @@ -104,13 +104,13 @@ importers: version: 8.13.0(eslint@9.14.0)(typescript@5.6.3) vite: specifier: ^4.5.5 - version: 4.5.5 + version: 4.5.5(@types/node@22.9.0) vite-plugin-stylelint: specifier: ^5.3.1 - version: 5.3.1(postcss@8.4.47)(rollup@3.29.5)(stylelint@15.11.0(typescript@5.6.3))(vite@4.5.5) + version: 5.3.1(postcss@8.4.47)(rollup@3.29.5)(stylelint@15.11.0(typescript@5.6.3))(vite@4.5.5(@types/node@22.9.0)) vite-plugin-vuetify: specifier: ^2.0.4 - version: 2.0.4(vite@4.5.5)(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4) + version: 2.0.4(vite@4.5.5(@types/node@22.9.0))(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4) vite-svg-loader: specifier: ^5.1.0 version: 5.1.0(vue@3.5.12(typescript@5.6.3)) @@ -633,6 +633,9 @@ packages: '@types/minimist@1.2.5': resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} + '@types/node@22.9.0': + resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1472,9 +1475,6 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - linkify-it@5.0.0: - resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} - locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -1506,10 +1506,6 @@ packages: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} - markdown-it@14.1.0: - resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} - hasBin: true - mathml-tag-names@2.1.3: resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==} @@ -1519,9 +1515,6 @@ packages: mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - mdurl@2.0.0: - resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} - meow@10.1.5: resolution: {integrity: sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1884,10 +1877,6 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - punycode.js@2.3.1: - resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} - engines: {node: '>=6'} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -2130,8 +2119,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - uc.micro@2.1.0: - resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} upath@2.0.1: resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} @@ -2766,6 +2755,10 @@ snapshots: '@types/minimist@1.2.5': {} + '@types/node@22.9.0': + dependencies: + undici-types: 6.19.8 + '@types/normalize-package-data@2.4.4': {} '@types/semver@7.5.8': {} @@ -2937,9 +2930,9 @@ snapshots: '@typescript-eslint/types': 8.13.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@4.6.2(vite@4.5.5)(vue@3.5.12(typescript@5.6.3))': + '@vitejs/plugin-vue@4.6.2(vite@4.5.5(@types/node@22.9.0))(vue@3.5.12(typescript@5.6.3))': dependencies: - vite: 4.5.5 + vite: 4.5.5(@types/node@22.9.0) vue: 3.5.12(typescript@5.6.3) '@volar/language-core@2.4.10': @@ -3684,10 +3677,6 @@ snapshots: lines-and-columns@1.2.4: {} - linkify-it@5.0.0: - dependencies: - uc.micro: 2.1.0 - locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -3712,23 +3701,12 @@ snapshots: map-obj@4.3.0: {} - markdown-it@14.1.0: - dependencies: - argparse: 2.0.1 - entities: 4.5.0 - linkify-it: 5.0.0 - mdurl: 2.0.0 - punycode.js: 2.3.1 - uc.micro: 2.1.0 - mathml-tag-names@2.1.3: {} mdn-data@2.0.28: {} mdn-data@2.0.30: {} - mdurl@2.0.0: {} - meow@10.1.5: dependencies: '@types/minimist': 1.2.5 @@ -4138,8 +4116,6 @@ snapshots: proxy-from-env@1.1.0: {} - punycode.js@2.3.1: {} - punycode@2.3.1: {} query-string@8.2.0: @@ -4395,7 +4371,7 @@ snapshots: typescript@5.6.3: {} - uc.micro@2.1.0: {} + undici-types@6.19.8: {} upath@2.0.1: {} @@ -4418,25 +4394,25 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite-plugin-stylelint@5.3.1(postcss@8.4.47)(rollup@3.29.5)(stylelint@15.11.0(typescript@5.6.3))(vite@4.5.5): + vite-plugin-stylelint@5.3.1(postcss@8.4.47)(rollup@3.29.5)(stylelint@15.11.0(typescript@5.6.3))(vite@4.5.5(@types/node@22.9.0)): dependencies: '@rollup/pluginutils': 5.1.3(rollup@3.29.5) chokidar: 3.6.0 debug: 4.3.7(supports-color@9.4.0) stylelint: 15.11.0(typescript@5.6.3) - vite: 4.5.5 + vite: 4.5.5(@types/node@22.9.0) optionalDependencies: postcss: 8.4.47 rollup: 3.29.5 transitivePeerDependencies: - supports-color - vite-plugin-vuetify@2.0.4(vite@4.5.5)(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4): + vite-plugin-vuetify@2.0.4(vite@4.5.5(@types/node@22.9.0))(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4): dependencies: '@vuetify/loader-shared': 2.0.3(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4) debug: 4.3.7(supports-color@9.4.0) upath: 2.0.1 - vite: 4.5.5 + vite: 4.5.5(@types/node@22.9.0) vue: 3.5.12(typescript@5.6.3) vuetify: 3.7.4(typescript@5.6.3)(vite-plugin-vuetify@2.0.4)(vue@3.5.12(typescript@5.6.3)) transitivePeerDependencies: @@ -4447,12 +4423,13 @@ snapshots: svgo: 3.3.2 vue: 3.5.12(typescript@5.6.3) - vite@4.5.5: + vite@4.5.5(@types/node@22.9.0): dependencies: esbuild: 0.18.20 postcss: 8.4.47 rollup: 3.29.5 optionalDependencies: + '@types/node': 22.9.0 fsevents: 2.3.3 vscode-uri@3.0.8: {} @@ -4501,7 +4478,7 @@ snapshots: vue: 3.5.12(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 - vite-plugin-vuetify: 2.0.4(vite@4.5.5)(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4) + vite-plugin-vuetify: 2.0.4(vite@4.5.5(@types/node@22.9.0))(vue@3.5.12(typescript@5.6.3))(vuetify@3.7.4) webidl-conversions@3.0.1: {} diff --git a/src/App.vue b/src/App.vue index 5d0ee7f..5c160d6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,8 @@ - + + + + + + + + + + + + + Нет комментариев + + diff --git a/src/pages/LecturerPage.vue b/src/pages/LecturerPage.vue index 17fbdca..f09dcf9 100644 --- a/src/pages/LecturerPage.vue +++ b/src/pages/LecturerPage.vue @@ -2,13 +2,12 @@ import { useRouter } from 'vue-router'; import { useDisplay } from 'vuetify'; import { ref } from 'vue'; -import { PHOTO_BASE_PATH } from '../constants'; -// import Markdown from '../components/AppMarkdownRenderer.vue'; -import apiClient from '../api'; -import Placeholder from '../assets/profile_image_placeholder.webp'; -import AppRatingBar from '../components/AppRatingBar.vue'; -import TheReviewCard from '../components/TheReviewCard.vue'; -import LecturerHeaderCard from '../components/LecturerHeaderCard.vue'; +import apiClient from '@/api'; +import Placeholder from '@/assets/profile_image_placeholder.webp'; +import AppRatingBar from '@/components/AppRatingBar.vue'; +import TheReviewCard from '@/components/TheReviewCard.vue'; +import LecturerHeaderCard from '@/components/LecturerHeaderCard.vue'; +import { adaptNumeral, getPhoto } from '@/utils'; const { mobile } = useDisplay(); @@ -25,7 +24,6 @@ const firstName = ref(lecturer?.first_name); const lastName = ref(lecturer?.last_name); const middleName = ref(lecturer?.middle_name); const avatarLink = ref(lecturer?.avatar_link); -// const description = ref(null); // ref(lecturer?.description); async function loadLecturer() { const res = await apiClient.GET(`/rating/lecturer/{id}`, { @@ -45,8 +43,7 @@ let howKind = lecturer?.mark_kindness ?? 0; let howFree = lecturer?.mark_freebie ?? 0; let howClear = lecturer?.mark_clarity ?? 0; -const lecturerPhoto = avatarLink.value ? `${PHOTO_BASE_PATH}${avatarLink.value}` : Placeholder; -// const lecturerInfo = description.value ?? 'Информации нет'; +const lecturerPhoto = getPhoto(avatarLink.value); @@ -71,7 +68,10 @@ const lecturerPhoto = avatarLink.value ? `${PHOTO_BASE_PATH}${avatarLink.value}` {{ lecturer?.mark_general?.toFixed(2) ?? 'нет оценки' }} - {{ lecturer?.comments?.length ?? 'нет' }} отзыва + {{ lecturer?.comments?.length ?? 'нет' }} + {{ adaptNumeral(lecturer?.comments?.length, 'отзыв', 'отзыва', 'отзывов') }} @@ -83,10 +83,6 @@ const lecturerPhoto = avatarLink.value ? `${PHOTO_BASE_PATH}${avatarLink.value}` - diff --git a/src/pages/MainPage.vue b/src/pages/MainPage.vue index 829bb08..f47c3b1 100644 --- a/src/pages/MainPage.vue +++ b/src/pages/MainPage.vue @@ -1,19 +1,18 @@ + + + + + + + + + + + + + + + + + Общая оценка: {{ Number(generalReview) > 0 ? '+' + generalReview : generalReview }} + + + + + + + +