panel minor fixes
Some checks failed
Deploy on push / deploy (push) Failing after 4m20s

This commit is contained in:
2025-09-16 11:48:19 +03:00
parent 78bc110685
commit 4ea32e3b83
11 changed files with 64 additions and 64 deletions

View File

@@ -49,7 +49,7 @@ jobs:
# MyPy type checking # MyPy type checking
echo "🏷️ Проверяем типы с помощью MyPy..." echo "🏷️ Проверяем типы с помощью MyPy..."
uv run mypy . --ignore-missing-imports uv run mypy . --ignore-missing-imports -v
- name: Install Node.js Dependencies - name: Install Node.js Dependencies
run: | run: |

View File

@@ -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": { "files": {
"includes": [ "includes": [
"**/*.tsx", "**/*.tsx",

96
package-lock.json generated
View File

@@ -8,15 +8,15 @@
"name": "publy-panel", "name": "publy-panel",
"version": "0.9.20", "version": "0.9.20",
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.2.3", "@biomejs/biome": "^2.2.4",
"@graphql-codegen/cli": "^6.0.0", "@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/introspection": "^5.0.0",
"@graphql-codegen/typescript": "^5.0.0", "@graphql-codegen/typescript": "^5.0.0",
"@graphql-codegen/typescript-operations": "^5.0.0", "@graphql-codegen/typescript-operations": "^5.0.0",
"@graphql-codegen/typescript-resolvers": "^5.0.0", "@graphql-codegen/typescript-resolvers": "^5.0.0",
"@solidjs/router": "^0.15.3", "@solidjs/router": "^0.15.3",
"@types/node": "^24.3.1", "@types/node": "^24.5.0",
"@types/prismjs": "^1.26.5", "@types/prismjs": "^1.26.5",
"graphql": "^16.11.0", "graphql": "^16.11.0",
"graphql-tag": "^2.12.6", "graphql-tag": "^2.12.6",
@@ -361,9 +361,9 @@
} }
}, },
"node_modules/@biomejs/biome": { "node_modules/@biomejs/biome": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.4.tgz",
"integrity": "sha512-9w0uMTvPrIdvUrxazZ42Ib7t8Y2yoGLKLdNne93RLICmaHw7mcLv4PPb5LvZLJF3141gQHiCColOh/v6VWlWmg==", "integrity": "sha512-TBHU5bUy/Ok6m8c0y3pZiuO/BZoY/OcGxoLlrfQof5s8ISVwbVBdFINPQZyFfKwil8XibYWb7JMwnT8wT4WVPg==",
"dev": true, "dev": true,
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"bin": { "bin": {
@@ -377,20 +377,20 @@
"url": "https://opencollective.com/biome" "url": "https://opencollective.com/biome"
}, },
"optionalDependencies": { "optionalDependencies": {
"@biomejs/cli-darwin-arm64": "2.2.3", "@biomejs/cli-darwin-arm64": "2.2.4",
"@biomejs/cli-darwin-x64": "2.2.3", "@biomejs/cli-darwin-x64": "2.2.4",
"@biomejs/cli-linux-arm64": "2.2.3", "@biomejs/cli-linux-arm64": "2.2.4",
"@biomejs/cli-linux-arm64-musl": "2.2.3", "@biomejs/cli-linux-arm64-musl": "2.2.4",
"@biomejs/cli-linux-x64": "2.2.3", "@biomejs/cli-linux-x64": "2.2.4",
"@biomejs/cli-linux-x64-musl": "2.2.3", "@biomejs/cli-linux-x64-musl": "2.2.4",
"@biomejs/cli-win32-arm64": "2.2.3", "@biomejs/cli-win32-arm64": "2.2.4",
"@biomejs/cli-win32-x64": "2.2.3" "@biomejs/cli-win32-x64": "2.2.4"
} }
}, },
"node_modules/@biomejs/cli-darwin-arm64": { "node_modules/@biomejs/cli-darwin-arm64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.4.tgz",
"integrity": "sha512-OrqQVBpadB5eqzinXN4+Q6honBz+tTlKVCsbEuEpljK8ASSItzIRZUA02mTikl3H/1nO2BMPFiJ0nkEZNy3B1w==", "integrity": "sha512-RJe2uiyaloN4hne4d2+qVj3d3gFJFbmrr5PYtkkjei1O9c+BjGXgpUPVbi8Pl8syumhzJjFsSIYkcLt2VlVLMA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -405,9 +405,9 @@
} }
}, },
"node_modules/@biomejs/cli-darwin-x64": { "node_modules/@biomejs/cli-darwin-x64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.4.tgz",
"integrity": "sha512-OCdBpb1TmyfsTgBAM1kPMXyYKTohQ48WpiN9tkt9xvU6gKVKHY4oVwteBebiOqyfyzCNaSiuKIPjmHjUZ2ZNMg==", "integrity": "sha512-cFsdB4ePanVWfTnPVaUX+yr8qV8ifxjBKMkZwN7gKb20qXPxd/PmwqUH8mY5wnM9+U0QwM76CxFyBRJhC9tQwg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -422,9 +422,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-arm64": { "node_modules/@biomejs/cli-linux-arm64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.4.tgz",
"integrity": "sha512-g/Uta2DqYpECxG+vUmTAmUKlVhnGEcY7DXWgKP8ruLRa8Si1QHsWknPY3B/wCo0KgYiFIOAZ9hjsHfNb9L85+g==", "integrity": "sha512-M/Iz48p4NAzMXOuH+tsn5BvG/Jb07KOMTdSVwJpicmhN309BeEyRyQX+n1XDF0JVSlu28+hiTQ2L4rZPvu7nMw==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -439,9 +439,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-arm64-musl": { "node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.4.tgz",
"integrity": "sha512-q3w9jJ6JFPZPeqyvwwPeaiS/6NEszZ+pXKF+IczNo8Xj6fsii45a4gEEicKyKIytalV+s829ACZujQlXAiVLBQ==", "integrity": "sha512-7TNPkMQEWfjvJDaZRSkDCPT/2r5ESFPKx+TEev+I2BXDGIjfCZk2+b88FOhnJNHtksbOZv8ZWnxrA5gyTYhSsQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -456,9 +456,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-x64": { "node_modules/@biomejs/cli-linux-x64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.4.tgz",
"integrity": "sha512-LEtyYL1fJsvw35CxrbQ0gZoxOG3oZsAjzfRdvRBRHxOpQ91Q5doRVjvWW/wepgSdgk5hlaNzfeqpyGmfSD0Eyw==", "integrity": "sha512-orr3nnf2Dpb2ssl6aihQtvcKtLySLta4E2UcXdp7+RTa7mfJjBgIsbS0B9GC8gVu0hjOu021aU8b3/I1tn+pVQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -473,9 +473,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-x64-musl": { "node_modules/@biomejs/cli-linux-x64-musl": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.4.tgz",
"integrity": "sha512-y76Dn4vkP1sMRGPFlNc+OTETBhGPJ90jY3il6jAfur8XWrYBQV3swZ1Jo0R2g+JpOeeoA0cOwM7mJG6svDz79w==", "integrity": "sha512-m41nFDS0ksXK2gwXL6W6yZTYPMH0LughqbsxInSKetoH6morVj43szqKx79Iudkp8WRT5SxSh7qVb8KCUiewGg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -490,9 +490,9 @@
} }
}, },
"node_modules/@biomejs/cli-win32-arm64": { "node_modules/@biomejs/cli-win32-arm64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.4.tgz",
"integrity": "sha512-Ms9zFYzjcJK7LV+AOMYnjN3pV3xL8Prxf9aWdDVL74onLn5kcvZ1ZMQswE5XHtnd/r/0bnUd928Rpbs14BzVmA==", "integrity": "sha512-NXnfTeKHDFUWfxAefa57DiGmu9VyKi0cDqFpdI+1hJWQjGJhJutHPX0b5m+eXvTKOaf+brU+P0JrQAZMb5yYaQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -507,9 +507,9 @@
} }
}, },
"node_modules/@biomejs/cli-win32-x64": { "node_modules/@biomejs/cli-win32-x64": {
"version": "2.2.3", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.4.tgz",
"integrity": "sha512-gvCpewE7mBwBIpqk1YrUqNR4mCiyJm6UI3YWQQXkedSSEwzRdodRpaKhbdbHw1/hmTWOVXQ+Eih5Qctf4TCVOQ==", "integrity": "sha512-3Y4V4zVRarVh/B/eSHczR4LYoSVyv3Dfuvm3cWs5w/HScccS0+Wt/lHOcDTRYeHjQmMYVC3rIRWqyN2EI52+zg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -1129,9 +1129,9 @@
} }
}, },
"node_modules/@graphql-codegen/client-preset": { "node_modules/@graphql-codegen/client-preset": {
"version": "5.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-5.0.1.tgz",
"integrity": "sha512-nVBgJDVahYm/uAVzm2v3tucdqk5iABke+boHPIofj3AzrYZnjTeTvEybqHo9RsEvKyTVKBi6NktkU9fKrOQMQw==", "integrity": "sha512-3dXS7Sh/AkV+Ewq/HB1DSCb0tZBOIdTL8zkGQjRKWaf14x21h2f/xKl2zhRh6KlXjcCrIpX+AxHAhQxs6cXwVw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -2768,13 +2768,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.3.1", "version": "24.5.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.0.tgz",
"integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", "integrity": "sha512-y1dMvuvJspJiPSDZUQ+WMBvF7dpnEqN4x9DDC9ie5Fs/HUZJA3wFp7EhHoVaKX/iI0cRoECV8X2jL8zi0xrHCg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~7.10.0" "undici-types": "~7.12.0"
} }
}, },
"node_modules/@types/prismjs": { "node_modules/@types/prismjs": {
@@ -6009,9 +6009,9 @@
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "7.10.0", "version": "7.12.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
"integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },

View File

@@ -13,15 +13,15 @@
"codegen": "graphql-codegen --config codegen.ts" "codegen": "graphql-codegen --config codegen.ts"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.2.3", "@biomejs/biome": "^2.2.4",
"@graphql-codegen/cli": "^6.0.0", "@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/introspection": "^5.0.0",
"@graphql-codegen/typescript": "^5.0.0", "@graphql-codegen/typescript": "^5.0.0",
"@graphql-codegen/typescript-operations": "^5.0.0", "@graphql-codegen/typescript-operations": "^5.0.0",
"@graphql-codegen/typescript-resolvers": "^5.0.0", "@graphql-codegen/typescript-resolvers": "^5.0.0",
"@solidjs/router": "^0.15.3", "@solidjs/router": "^0.15.3",
"@types/node": "^24.3.1", "@types/node": "^24.5.0",
"@types/prismjs": "^1.26.5", "@types/prismjs": "^1.26.5",
"graphql": "^16.11.0", "graphql": "^16.11.0",
"graphql-tag": "^2.12.6", "graphql-tag": "^2.12.6",

View File

@@ -1,6 +1,6 @@
import { createEffect, createSignal, Show } from 'solid-js' import { createEffect, createSignal, Show } from 'solid-js'
import { useData } from '../context/data' import { useData } from '../context/data'
import type { Role } from '../graphql/generated/schema' import type { Role } from '../graphql/generated/graphql'
import { import {
GET_COMMUNITY_ROLE_SETTINGS_QUERY, GET_COMMUNITY_ROLE_SETTINGS_QUERY,
GET_COMMUNITY_ROLES_QUERY, GET_COMMUNITY_ROLES_QUERY,

View File

@@ -1,6 +1,6 @@
import { Component, createMemo, createSignal, Show } from 'solid-js' import { Component, createMemo, createSignal, Show } from 'solid-js'
import { query } from '../graphql' 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 { ADMIN_UPDATE_ENV_VARIABLE_MUTATION } from '../graphql/mutations'
import formStyles from '../styles/Form.module.css' import formStyles from '../styles/Form.module.css'
import Button from '../ui/Button' import Button from '../ui/Button'

View File

@@ -1,5 +1,5 @@
import { Component, createEffect, createSignal, For, Show } from 'solid-js' 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 formStyles from '../styles/Form.module.css'
import Button from '../ui/Button' import Button from '../ui/Button'
import Modal from '../ui/Modal' import Modal from '../ui/Modal'
@@ -76,7 +76,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
email: props.user.email || '', email: props.user.email || '',
name: props.user.name || '', name: props.user.name || '',
slug: props.user.slug || '', slug: props.user.slug || '',
roles: (props.user.roles || []).map((roleName) => { roles: (props.user.roles || []).map((roleName: string) => {
// Сначала пробуем найти по русскому названию (для обратной совместимости) // Сначала пробуем найти по русскому названию (для обратной совместимости)
const russianId = ROLE_NAME_TO_ID[roleName] const russianId = ROLE_NAME_TO_ID[roleName]
if (russianId) return russianId if (russianId) return russianId
@@ -119,7 +119,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
email: props.user.email || '', email: props.user.email || '',
name: props.user.name || '', name: props.user.name || '',
slug: props.user.slug || '', slug: props.user.slug || '',
roles: (props.user.roles || []).map((roleName) => { roles: (props.user.roles || []).map((roleName: string) => {
// Сначала пробуем найти по русскому названию (для обратной совместимости) // Сначала пробуем найти по русскому названию (для обратной совместимости)
const russianId = ROLE_NAME_TO_ID[roleName] const russianId = ROLE_NAME_TO_ID[roleName]
if (russianId) return russianId if (russianId) return russianId
@@ -161,7 +161,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
const isCurrentlySelected = currentRoles.includes(roleId) const isCurrentlySelected = currentRoles.includes(roleId)
const newRoles = isCurrentlySelected const newRoles = isCurrentlySelected
? currentRoles.filter((r) => r !== roleId) // Убираем роль ? currentRoles.filter((r: string) => r !== roleId) // Убираем роль
: [...currentRoles, roleId] // Добавляем роль : [...currentRoles, roleId] // Добавляем роль
console.log('Current roles before:', currentRoles) console.log('Current roles before:', currentRoles)
@@ -215,7 +215,7 @@ const UserEditModal: Component<UserEditModalProps> = (props) => {
await props.onSave({ await props.onSave({
...formData(), ...formData(),
// Конвертируем ID ролей обратно в названия для сервера // Конвертируем 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() props.onClose()
} catch (error) { } catch (error) {

View File

@@ -1,5 +1,5 @@
import { Component, For } from 'solid-js' 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 styles from '../styles/Modal.module.css'
import CodePreview from '../ui/CodePreview' import CodePreview from '../ui/CodePreview'
import Modal from '../ui/Modal' import Modal from '../ui/Modal'

View File

@@ -2,7 +2,7 @@ import { Component, createSignal, For, onMount, Show } from 'solid-js'
import type { AuthorsSortField } from '../context/sort' import type { AuthorsSortField } from '../context/sort'
import { AUTHORS_SORT_CONFIG } from '../context/sortConfig' import { AUTHORS_SORT_CONFIG } from '../context/sortConfig'
import { query } from '../graphql' 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_UPDATE_USER_MUTATION } from '../graphql/mutations'
import { ADMIN_GET_USERS_QUERY } from '../graphql/queries' import { ADMIN_GET_USERS_QUERY } from '../graphql/queries'
import UserEditModal from '../modals/RolesModal' import UserEditModal from '../modals/RolesModal'

View File

@@ -3,7 +3,7 @@ import { useData } from '../context/data'
import { useTableSort } from '../context/sort' import { useTableSort } from '../context/sort'
import { SHOUTS_SORT_CONFIG } from '../context/sortConfig' import { SHOUTS_SORT_CONFIG } from '../context/sortConfig'
import { query } from '../graphql' 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 { ADMIN_GET_SHOUTS_QUERY } from '../graphql/queries'
import styles from '../styles/Admin.module.css' import styles from '../styles/Admin.module.css'
import HTMLEditor from '../ui/HTMLEditor' import HTMLEditor from '../ui/HTMLEditor'

View File

@@ -33,7 +33,7 @@ const HTMLEditor = (props: HTMLEditorProps) => {
const attemptHighlight = (attempts = 0) => { const attemptHighlight = (attempts = 0) => {
if (attempts > 3) return // Максимум 3 попытки if (attempts > 3) return // Максимум 3 попытки
if (typeof window !== 'undefined' && window.Prism && element) { if (window?.Prism && element) {
try { try {
Prism.highlightElement(element) Prism.highlightElement(element)
} catch (error) { } catch (error) {