mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
npm packages update, build fix
This commit is contained in:
parent
1446a57c28
commit
b9abbbf03c
10 changed files with 5423 additions and 16122 deletions
3
.babelrc
Normal file
3
.babelrc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"presets": ["@babel/preset-react"]
|
||||||
|
}
|
35
.eslintrc.js
35
.eslintrc.js
|
@ -1,11 +1,22 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es6: true,
|
es2021: true,
|
||||||
node: true,
|
|
||||||
},
|
},
|
||||||
parser: 'babel-eslint',
|
parser: '@babel/eslint-parser',
|
||||||
extends: ['eslint:recommended', 'plugin:react/recommended'],
|
parserOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: 'detect',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
'plugin:react/recommended',
|
||||||
|
'plugin:react/jsx-runtime',
|
||||||
|
'plugin:@next/next/recommended',
|
||||||
|
],
|
||||||
globals: {
|
globals: {
|
||||||
Atomics: 'readonly',
|
Atomics: 'readonly',
|
||||||
SharedArrayBuffer: 'readonly',
|
SharedArrayBuffer: 'readonly',
|
||||||
|
@ -18,7 +29,21 @@ module.exports = {
|
||||||
'no-prototype-builtins': 'off',
|
'no-prototype-builtins': 'off',
|
||||||
'id-length': [
|
'id-length': [
|
||||||
'warn',
|
'warn',
|
||||||
{ exceptions: ['x', 'i', 'j', 't', 'Q', 'A', 'C', 'q', 'a', 'b', 'e'] },
|
{
|
||||||
|
exceptions: [
|
||||||
|
'x',
|
||||||
|
'i',
|
||||||
|
'j',
|
||||||
|
't',
|
||||||
|
'Q',
|
||||||
|
'A',
|
||||||
|
'C',
|
||||||
|
'q',
|
||||||
|
'a',
|
||||||
|
'b',
|
||||||
|
'e',
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
root: true,
|
root: true,
|
||||||
|
|
16706
package-lock.json
generated
16706
package-lock.json
generated
File diff suppressed because it is too large
Load diff
13
package.json
13
package.json
|
@ -13,10 +13,15 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/eslint-parser": "^7.21.3",
|
||||||
|
"@next/eslint-plugin-next": "^13.2.4",
|
||||||
"eslint-plugin-react": "^7.22.0",
|
"eslint-plugin-react": "^7.22.0",
|
||||||
"next": "^9.3.1",
|
"next": "^13.2.4",
|
||||||
"react": "^16.13.1",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^16.13.1",
|
"react-dom": "^18.2.0",
|
||||||
"unfetch": "^4.1.0"
|
"unfetch": "^5.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/preset-react": "^7.18.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ export default function Question({ question, onChange, index }) {
|
||||||
// {"text":"a. Kétismeretlenes egyenletrendszert használunk.",
|
// {"text":"a. Kétismeretlenes egyenletrendszert használunk.",
|
||||||
// "selectedByUser":true}
|
// "selectedByUser":true}
|
||||||
|
|
||||||
console.log(possibleAnswer)
|
|
||||||
const pa =
|
const pa =
|
||||||
typeof possibleAnswer === 'string'
|
typeof possibleAnswer === 'string'
|
||||||
? possibleAnswer
|
? possibleAnswer
|
||||||
|
|
|
@ -60,6 +60,8 @@ export default function QuestionSearchResult(props) {
|
||||||
results = data.reduce(countReducer, 0)
|
results = data.reduce(countReducer, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(subjs)
|
||||||
|
|
||||||
const renderCount = () => {
|
const renderCount = () => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -65,8 +65,8 @@ export default function questionView(props) {
|
||||||
|
|
||||||
const updateEdits = (e) => {
|
const updateEdits = (e) => {
|
||||||
setEdits(
|
setEdits(
|
||||||
edits.map((edit, i) => {
|
edits.map((edit) => {
|
||||||
if (i === e.index) {
|
if (edit.index === e.index) {
|
||||||
return e
|
return e
|
||||||
} else {
|
} else {
|
||||||
return edit
|
return edit
|
||||||
|
@ -95,7 +95,7 @@ export default function questionView(props) {
|
||||||
}
|
}
|
||||||
if (e.type === 'delete') {
|
if (e.type === 'delete') {
|
||||||
rmQuestion(e, selectedDb).then((res) => {
|
rmQuestion(e, selectedDb).then((res) => {
|
||||||
if (res.status === 'OK') {
|
if (res.success) {
|
||||||
alert('Sikeres törlés')
|
alert('Sikeres törlés')
|
||||||
} else {
|
} else {
|
||||||
alert('Hiba mentés közben :/')
|
alert('Hiba mentés közben :/')
|
||||||
|
@ -152,7 +152,7 @@ export default function questionView(props) {
|
||||||
}),
|
}),
|
||||||
selectedDb
|
selectedDb
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
if (res.status === 'OK') {
|
if (res.success) {
|
||||||
alert('Sikeres mentés')
|
alert('Sikeres mentés')
|
||||||
} else {
|
} else {
|
||||||
alert('Hiba mentés közben :/')
|
alert('Hiba mentés közben :/')
|
||||||
|
|
|
@ -153,7 +153,7 @@ export default function SubjectView(props) {
|
||||||
const deletedQuestions = deletedIndexes
|
const deletedQuestions = deletedIndexes
|
||||||
onSave(subj.Name, changedQuestions, deletedQuestions, selectedDb).then(
|
onSave(subj.Name, changedQuestions, deletedQuestions, selectedDb).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
if (res.status === 'OK') {
|
if (res.success) {
|
||||||
alert('Sikeres mentés')
|
alert('Sikeres mentés')
|
||||||
} else {
|
} else {
|
||||||
alert('Hiba mentés közben :/')
|
alert('Hiba mentés közben :/')
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from 'react'
|
||||||
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
||||||
|
|
||||||
class MyDocument extends Document {
|
class MyDocument extends Document {
|
||||||
|
@ -10,7 +11,7 @@ class MyDocument extends Document {
|
||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head />
|
<Head />
|
||||||
<body bgcolor='#222426'>
|
<body style={{ backgroundColor: '#222426' }}>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -48,12 +48,12 @@ const Infos = ({ onClick, renderOKButton }) => {
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Ha akármi kérdés van,{' '}
|
Ha akármi kérdés van{' '}
|
||||||
<a href={`${constants.siteUrl}irc`}>
|
<a
|
||||||
itt lehet chatszobában kérdezni
|
href={`${constants.siteUrl}contact`}
|
||||||
</a>
|
target={'_blank'}
|
||||||
, vagy{' '}
|
rel={'noreferrer'}
|
||||||
<a href={`${constants.siteUrl}feedback`}>
|
>
|
||||||
itt lehet üzenetet küldeni
|
itt lehet üzenetet küldeni
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
@ -162,7 +162,6 @@ export default function Index({ router }) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const renderView = () => {
|
const renderView = () => {
|
||||||
if (view === views.subject) {
|
if (view === views.subject) {
|
||||||
return (
|
return (
|
||||||
|
@ -189,12 +188,7 @@ export default function Index({ router }) {
|
||||||
selectedDb={selectedDb}
|
selectedDb={selectedDb}
|
||||||
onChange={setSelectedDb}
|
onChange={setSelectedDb}
|
||||||
/>
|
/>
|
||||||
{data && (
|
{data && <QuestionView selectedDb={selectedDb} data={data} />}
|
||||||
<QuestionView
|
|
||||||
selectedDb={selectedDb}
|
|
||||||
data={data}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
} else if (view === views.questionAdder) {
|
} else if (view === views.questionAdder) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue