This commit is contained in:
@@ -49,7 +49,7 @@ jobs:
|
||||
|
||||
# MyPy type checking
|
||||
echo "🏷️ Проверяем типы с помощью MyPy..."
|
||||
uv run mypy . --ignore-missing-imports
|
||||
uv run mypy . --ignore-missing-imports -v
|
||||
|
||||
- name: Install Node.js Dependencies
|
||||
run: |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
|
||||
"files": {
|
||||
"includes": [
|
||||
"**/*.tsx",
|
||||
|
||||
96
package-lock.json
generated
96
package-lock.json
generated
@@ -8,15 +8,15 @@
|
||||
"name": "publy-panel",
|
||||
"version": "0.9.20",
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.3",
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@graphql-codegen/cli": "^6.0.0",
|
||||
"@graphql-codegen/client-preset": "^5.0.0",
|
||||
"@graphql-codegen/client-preset": "^5.0.1",
|
||||
"@graphql-codegen/introspection": "^5.0.0",
|
||||
"@graphql-codegen/typescript": "^5.0.0",
|
||||
"@graphql-codegen/typescript-operations": "^5.0.0",
|
||||
"@graphql-codegen/typescript-resolvers": "^5.0.0",
|
||||
"@solidjs/router": "^0.15.3",
|
||||
"@types/node": "^24.3.1",
|
||||
"@types/node": "^24.5.0",
|
||||
"@types/prismjs": "^1.26.5",
|
||||
"graphql": "^16.11.0",
|
||||
"graphql-tag": "^2.12.6",
|
||||
@@ -361,9 +361,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.3.tgz",
|
||||
"integrity": "sha512-9w0uMTvPrIdvUrxazZ42Ib7t8Y2yoGLKLdNne93RLICmaHw7mcLv4PPb5LvZLJF3141gQHiCColOh/v6VWlWmg==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.4.tgz",
|
||||
"integrity": "sha512-TBHU5bUy/Ok6m8c0y3pZiuO/BZoY/OcGxoLlrfQof5s8ISVwbVBdFINPQZyFfKwil8XibYWb7JMwnT8wT4WVPg==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"bin": {
|
||||
@@ -377,20 +377,20 @@
|
||||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "2.2.3",
|
||||
"@biomejs/cli-darwin-x64": "2.2.3",
|
||||
"@biomejs/cli-linux-arm64": "2.2.3",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.2.3",
|
||||
"@biomejs/cli-linux-x64": "2.2.3",
|
||||
"@biomejs/cli-linux-x64-musl": "2.2.3",
|
||||
"@biomejs/cli-win32-arm64": "2.2.3",
|
||||
"@biomejs/cli-win32-x64": "2.2.3"
|
||||
"@biomejs/cli-darwin-arm64": "2.2.4",
|
||||
"@biomejs/cli-darwin-x64": "2.2.4",
|
||||
"@biomejs/cli-linux-arm64": "2.2.4",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.2.4",
|
||||
"@biomejs/cli-linux-x64": "2.2.4",
|
||||
"@biomejs/cli-linux-x64-musl": "2.2.4",
|
||||
"@biomejs/cli-win32-arm64": "2.2.4",
|
||||
"@biomejs/cli-win32-x64": "2.2.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.3.tgz",
|
||||
"integrity": "sha512-OrqQVBpadB5eqzinXN4+Q6honBz+tTlKVCsbEuEpljK8ASSItzIRZUA02mTikl3H/1nO2BMPFiJ0nkEZNy3B1w==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.4.tgz",
|
||||
"integrity": "sha512-RJe2uiyaloN4hne4d2+qVj3d3gFJFbmrr5PYtkkjei1O9c+BjGXgpUPVbi8Pl8syumhzJjFsSIYkcLt2VlVLMA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -405,9 +405,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.3.tgz",
|
||||
"integrity": "sha512-OCdBpb1TmyfsTgBAM1kPMXyYKTohQ48WpiN9tkt9xvU6gKVKHY4oVwteBebiOqyfyzCNaSiuKIPjmHjUZ2ZNMg==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.4.tgz",
|
||||
"integrity": "sha512-cFsdB4ePanVWfTnPVaUX+yr8qV8ifxjBKMkZwN7gKb20qXPxd/PmwqUH8mY5wnM9+U0QwM76CxFyBRJhC9tQwg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -422,9 +422,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.3.tgz",
|
||||
"integrity": "sha512-g/Uta2DqYpECxG+vUmTAmUKlVhnGEcY7DXWgKP8ruLRa8Si1QHsWknPY3B/wCo0KgYiFIOAZ9hjsHfNb9L85+g==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.4.tgz",
|
||||
"integrity": "sha512-M/Iz48p4NAzMXOuH+tsn5BvG/Jb07KOMTdSVwJpicmhN309BeEyRyQX+n1XDF0JVSlu28+hiTQ2L4rZPvu7nMw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -439,9 +439,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.3.tgz",
|
||||
"integrity": "sha512-q3w9jJ6JFPZPeqyvwwPeaiS/6NEszZ+pXKF+IczNo8Xj6fsii45a4gEEicKyKIytalV+s829ACZujQlXAiVLBQ==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.4.tgz",
|
||||
"integrity": "sha512-7TNPkMQEWfjvJDaZRSkDCPT/2r5ESFPKx+TEev+I2BXDGIjfCZk2+b88FOhnJNHtksbOZv8ZWnxrA5gyTYhSsQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -456,9 +456,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.3.tgz",
|
||||
"integrity": "sha512-LEtyYL1fJsvw35CxrbQ0gZoxOG3oZsAjzfRdvRBRHxOpQ91Q5doRVjvWW/wepgSdgk5hlaNzfeqpyGmfSD0Eyw==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.4.tgz",
|
||||
"integrity": "sha512-orr3nnf2Dpb2ssl6aihQtvcKtLySLta4E2UcXdp7+RTa7mfJjBgIsbS0B9GC8gVu0hjOu021aU8b3/I1tn+pVQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -473,9 +473,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.3.tgz",
|
||||
"integrity": "sha512-y76Dn4vkP1sMRGPFlNc+OTETBhGPJ90jY3il6jAfur8XWrYBQV3swZ1Jo0R2g+JpOeeoA0cOwM7mJG6svDz79w==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.4.tgz",
|
||||
"integrity": "sha512-m41nFDS0ksXK2gwXL6W6yZTYPMH0LughqbsxInSKetoH6morVj43szqKx79Iudkp8WRT5SxSh7qVb8KCUiewGg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -490,9 +490,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.3.tgz",
|
||||
"integrity": "sha512-Ms9zFYzjcJK7LV+AOMYnjN3pV3xL8Prxf9aWdDVL74onLn5kcvZ1ZMQswE5XHtnd/r/0bnUd928Rpbs14BzVmA==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.4.tgz",
|
||||
"integrity": "sha512-NXnfTeKHDFUWfxAefa57DiGmu9VyKi0cDqFpdI+1hJWQjGJhJutHPX0b5m+eXvTKOaf+brU+P0JrQAZMb5yYaQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -507,9 +507,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.3.tgz",
|
||||
"integrity": "sha512-gvCpewE7mBwBIpqk1YrUqNR4mCiyJm6UI3YWQQXkedSSEwzRdodRpaKhbdbHw1/hmTWOVXQ+Eih5Qctf4TCVOQ==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.4.tgz",
|
||||
"integrity": "sha512-3Y4V4zVRarVh/B/eSHczR4LYoSVyv3Dfuvm3cWs5w/HScccS0+Wt/lHOcDTRYeHjQmMYVC3rIRWqyN2EI52+zg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1129,9 +1129,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@graphql-codegen/client-preset": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-5.0.0.tgz",
|
||||
"integrity": "sha512-nVBgJDVahYm/uAVzm2v3tucdqk5iABke+boHPIofj3AzrYZnjTeTvEybqHo9RsEvKyTVKBi6NktkU9fKrOQMQw==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-5.0.1.tgz",
|
||||
"integrity": "sha512-3dXS7Sh/AkV+Ewq/HB1DSCb0tZBOIdTL8zkGQjRKWaf14x21h2f/xKl2zhRh6KlXjcCrIpX+AxHAhQxs6cXwVw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2768,13 +2768,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz",
|
||||
"integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==",
|
||||
"version": "24.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.0.tgz",
|
||||
"integrity": "sha512-y1dMvuvJspJiPSDZUQ+WMBvF7dpnEqN4x9DDC9ie5Fs/HUZJA3wFp7EhHoVaKX/iI0cRoECV8X2jL8zi0xrHCg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.10.0"
|
||||
"undici-types": "~7.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/prismjs": {
|
||||
@@ -6009,9 +6009,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz",
|
||||
"integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==",
|
||||
"version": "7.12.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
|
||||
"integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
"codegen": "graphql-codegen --config codegen.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.3",
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@graphql-codegen/cli": "^6.0.0",
|
||||
"@graphql-codegen/client-preset": "^5.0.0",
|
||||
"@graphql-codegen/client-preset": "^5.0.1",
|
||||
"@graphql-codegen/introspection": "^5.0.0",
|
||||
"@graphql-codegen/typescript": "^5.0.0",
|
||||
"@graphql-codegen/typescript-operations": "^5.0.0",
|
||||
"@graphql-codegen/typescript-resolvers": "^5.0.0",
|
||||
"@solidjs/router": "^0.15.3",
|
||||
"@types/node": "^24.3.1",
|
||||
"@types/node": "^24.5.0",
|
||||
"@types/prismjs": "^1.26.5",
|
||||
"graphql": "^16.11.0",
|
||||
"graphql-tag": "^2.12.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createEffect, createSignal, Show } from 'solid-js'
|
||||
import { useData } from '../context/data'
|
||||
import type { Role } from '../graphql/generated/schema'
|
||||
import type { Role } from '../graphql/generated/graphql'
|
||||
import {
|
||||
GET_COMMUNITY_ROLE_SETTINGS_QUERY,
|
||||
GET_COMMUNITY_ROLES_QUERY,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, createMemo, createSignal, Show } from 'solid-js'
|
||||
import { query } from '../graphql'
|
||||
import { EnvVariable } from '../graphql/generated/schema'
|
||||
import { EnvVariable } from '../graphql/generated/graphql'
|
||||
import { ADMIN_UPDATE_ENV_VARIABLE_MUTATION } from '../graphql/mutations'
|
||||
import formStyles from '../styles/Form.module.css'
|
||||
import Button from '../ui/Button'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, createEffect, createSignal, For, Show } from 'solid-js'
|
||||
import type { AdminUserInfo } from '../graphql/generated/schema'
|
||||
import type { AdminUserInfo } from '../graphql/generated/graphql'
|
||||
import formStyles from '../styles/Form.module.css'
|
||||
import Button from '../ui/Button'
|
||||
import Modal from '../ui/Modal'
|
||||
@@ -76,7 +76,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
|
||||
email: props.user.email || '',
|
||||
name: props.user.name || '',
|
||||
slug: props.user.slug || '',
|
||||
roles: (props.user.roles || []).map((roleName) => {
|
||||
roles: (props.user.roles || []).map((roleName: string) => {
|
||||
// Сначала пробуем найти по русскому названию (для обратной совместимости)
|
||||
const russianId = ROLE_NAME_TO_ID[roleName]
|
||||
if (russianId) return russianId
|
||||
@@ -119,7 +119,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
|
||||
email: props.user.email || '',
|
||||
name: props.user.name || '',
|
||||
slug: props.user.slug || '',
|
||||
roles: (props.user.roles || []).map((roleName) => {
|
||||
roles: (props.user.roles || []).map((roleName: string) => {
|
||||
// Сначала пробуем найти по русскому названию (для обратной совместимости)
|
||||
const russianId = ROLE_NAME_TO_ID[roleName]
|
||||
if (russianId) return russianId
|
||||
@@ -161,7 +161,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
|
||||
const isCurrentlySelected = currentRoles.includes(roleId)
|
||||
|
||||
const newRoles = isCurrentlySelected
|
||||
? currentRoles.filter((r) => r !== roleId) // Убираем роль
|
||||
? currentRoles.filter((r: string) => r !== roleId) // Убираем роль
|
||||
: [...currentRoles, roleId] // Добавляем роль
|
||||
|
||||
console.log('Current roles before:', currentRoles)
|
||||
@@ -215,7 +215,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
|
||||
await props.onSave({
|
||||
...formData(),
|
||||
// Конвертируем ID ролей обратно в названия для сервера
|
||||
roles: (formData().roles || []).map((roleId) => ROLE_ID_TO_NAME[roleId]).join(',')
|
||||
roles: (formData().roles || []).map((roleId: string) => ROLE_ID_TO_NAME[roleId]).join(',')
|
||||
})
|
||||
props.onClose()
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, For } from 'solid-js'
|
||||
import type { AdminShoutInfo, Maybe, Topic } from '../graphql/generated/schema'
|
||||
import { AdminShoutInfo, Maybe, Topic } from '~/graphql/generated/graphql'
|
||||
import styles from '../styles/Modal.module.css'
|
||||
import CodePreview from '../ui/CodePreview'
|
||||
import Modal from '../ui/Modal'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, createSignal, For, onMount, Show } from 'solid-js'
|
||||
import type { AuthorsSortField } from '../context/sort'
|
||||
import { AUTHORS_SORT_CONFIG } from '../context/sortConfig'
|
||||
import { query } from '../graphql'
|
||||
import type { Query, AdminUserInfo as User } from '../graphql/generated/schema'
|
||||
import type { Query, AdminUserInfo as User } from '../graphql/generated/graphql'
|
||||
import { ADMIN_UPDATE_USER_MUTATION } from '../graphql/mutations'
|
||||
import { ADMIN_GET_USERS_QUERY } from '../graphql/queries'
|
||||
import UserEditModal from '../modals/RolesModal'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useData } from '../context/data'
|
||||
import { useTableSort } from '../context/sort'
|
||||
import { SHOUTS_SORT_CONFIG } from '../context/sortConfig'
|
||||
import { query } from '../graphql'
|
||||
import type { Query, AdminShoutInfo as Shout } from '../graphql/generated/schema'
|
||||
import type { Query, AdminShoutInfo as Shout } from '../graphql/generated/graphql'
|
||||
import { ADMIN_GET_SHOUTS_QUERY } from '../graphql/queries'
|
||||
import styles from '../styles/Admin.module.css'
|
||||
import HTMLEditor from '../ui/HTMLEditor'
|
||||
|
||||
@@ -33,7 +33,7 @@ const HTMLEditor = (props: HTMLEditorProps) => {
|
||||
const attemptHighlight = (attempts = 0) => {
|
||||
if (attempts > 3) return // Максимум 3 попытки
|
||||
|
||||
if (typeof window !== 'undefined' && window.Prism && element) {
|
||||
if (window?.Prism && element) {
|
||||
try {
|
||||
Prism.highlightElement(element)
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user