Small fixes

This commit is contained in:
IRBorisov 2023-09-11 17:56:32 +03:00
parent 38507e37e6
commit 67eff6c9fc
13 changed files with 34 additions and 31 deletions

View File

@ -96,7 +96,6 @@ This readme file is used mostly to document project dependencies
- Install Python 3.9, NodeJS, VSCode, Docker Desktop
- copy import wheels from ConceptCore to rsconcept/backend/import
- run rsconcept/backend/LocalEnvSetup.ps1
- run 'npm install' in rsconcept/frontend
- use VSCode configs in root folder to start developement
## Developement build

View File

@ -52,7 +52,7 @@ class Migration(migrations.Migration):
('schema', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rsform.libraryitem', verbose_name='Концептуальная схема')),
],
options={
'verbose_name': 'Конституета',
'verbose_name': 'Конституента',
'verbose_name_plural': 'Конституенты',
},
),

View File

@ -236,7 +236,7 @@ class Constituenta(Model):
class Meta:
''' Model metadata. '''
verbose_name = 'Конституета'
verbose_name = 'Конституента'
verbose_name_plural = 'Конституенты'
def get_absolute_url(self):

View File

@ -3,7 +3,7 @@ import { useRef } from 'react';
import useEscapeKey from '../../hooks/useEscapeKey';
import Button from './Button';
interface ModalProps {
export interface ModalProps {
title?: string
submitText?: string
submitInvalidTooltip?: string
@ -46,7 +46,7 @@ function Modal({
<div className='max-h-[calc(100vh-8rem)]'>
{children}
</div>
<div className='flex justify-center w-full gap-4 pt-4 mt-2 border-t-2 z-modal-top'>
<div className='flex justify-center w-full gap-4 pt-4 mt-2 border-t-2 z-modal-controls'>
{!readonly &&
<Button
text={submitText}

View File

@ -44,7 +44,9 @@ const editorSetup: BasicSetupOptions = {
};
interface RSInputProps
extends Omit<ReactCodeMirrorProps, 'onChange'| 'onKeyDown'> {
extends Pick<ReactCodeMirrorProps,
'id'| 'editable' | 'height' | 'value' | 'className' | 'onFocus' | 'onBlur'
> {
label?: string
innerref?: RefObject<ReactCodeMirrorRef> | undefined
onChange?: (newValue: string) => void

View File

@ -74,9 +74,12 @@
.z-modal {
z-index: 60;
}
.z-modal-top {
.z-modal-controls {
z-index: 70;
}
.z-modal-top {
z-index: 80;
}
:root {
@ -199,8 +202,7 @@
:is(.clr-hover,
.clr-tab,
.clr-btn-nav,
.clr-btn-default,
.clr-btn-clear
.clr-btn-default
):hover:not(:disabled) {
color: var(--cl-fg-100);
background-color: var(--cl-prim-bg-60);

View File

@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import Checkbox from '../../components/Common/Checkbox';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import TextArea from '../../components/Common/TextArea';
import TextInput from '../../components/Common/TextInput';
import { useLibrary } from '../../context/LibraryContext';
@ -11,9 +11,8 @@ import { useRSForm } from '../../context/RSFormContext';
import { IRSFormCreateData } from '../../utils/models';
import { getCloneTitle } from '../../utils/staticUI';
interface DlgCloneRSFormProps {
hideWindow: () => void
}
interface DlgCloneRSFormProps
extends Pick<ModalProps, 'hideWindow'> {}
function DlgCloneRSForm({ hideWindow }: DlgCloneRSFormProps) {
const { navigateTo } = useConceptNavigation();

View File

@ -1,14 +1,14 @@
import { useEffect, useState } from 'react';
import ConceptSelectSingle from '../../components/Common/ConceptSelectSingle';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import TextArea from '../../components/Common/TextArea';
import RSInput from '../../components/RSInput';
import { CstType,ICstCreateData } from '../../utils/models';
import { CstTypeSelector, getCstTypeLabel } from '../../utils/staticUI';
interface DlgCreateCstProps {
hideWindow: () => void
interface DlgCreateCstProps
extends Pick<ModalProps, 'hideWindow'> {
initial?: ICstCreateData
onCreate: (data: ICstCreateData) => void
}
@ -31,7 +31,7 @@ function DlgCreateCst({ hideWindow, initial, onCreate }: DlgCreateCstProps) {
definition_formal: expression,
definition_raw: textDefinition,
term_raw: term
}
};
}
const handleSubmit = () => onCreate(getData());

View File

@ -1,12 +1,12 @@
import { useMemo, useState } from 'react';
import Checkbox from '../../components/Common/Checkbox';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import { useRSForm } from '../../context/RSFormContext';
import { getCstLabel } from '../../utils/staticUI';
interface DlgDeleteCstProps {
hideWindow: () => void
interface DlgDeleteCstProps
extends Pick<ModalProps, 'hideWindow'> {
selected: number[]
onDelete: (items: number[]) => void
}

View File

@ -1,13 +1,13 @@
import { useLayoutEffect, useState } from 'react';
import Checkbox from '../../components/Common/Checkbox';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import { CstType } from '../../utils/models';
import { getCstTypeLabel } from '../../utils/staticUI';
import { GraphEditorParams } from './EditorTermGraph';
interface DlgGraphOptionsProps {
hideWindow: () => void
interface DlgGraphOptionsProps
extends Pick<ModalProps, 'hideWindow'> {
initial: GraphEditorParams
onConfirm: (params: GraphEditorParams) => void
}

View File

@ -1,14 +1,14 @@
import { useLayoutEffect, useState } from 'react';
import ConceptSelectSingle from '../../components/Common/ConceptSelectSingle';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import TextInput from '../../components/Common/TextInput';
import { useRSForm } from '../../context/RSFormContext';
import { CstType, ICstRenameData } from '../../utils/models';
import { createAliasFor, CstTypeSelector, getCstTypeLabel, getCstTypePrefix } from '../../utils/staticUI';
interface DlgRenameCstProps {
hideWindow: () => void
interface DlgRenameCstProps
extends Pick<ModalProps, 'hideWindow'> {
initial?: ICstRenameData
onRename: (data: ICstRenameData) => void
}
@ -63,12 +63,12 @@ function DlgRenameCst({ hideWindow, initial, onRename }: DlgRenameCstProps) {
hideWindow={hideWindow}
canSubmit={validated}
onSubmit={handleSubmit}
submitInvalidTooltip={'Введите имя, соответствующее типу и отсутствующее в схеме'}
submitInvalidTooltip={'Введите незанятое имя, соответствующее типу'}
submitText='Переименовать'
>
<div className='flex items-center gap-4 px-2 my-2 h-fit min-w-[25rem]'>
<ConceptSelectSingle
className='min-w-[14rem] self-center'
className='min-w-[14rem] self-center z-modal-top'
options={CstTypeSelector}
placeholder='Выберите тип'
value={cstType ? { value: cstType, label: getCstTypeLabel(cstType) } : null}

View File

@ -1,15 +1,15 @@
import { useCallback, useMemo, useState } from 'react';
import { GraphCanvas,GraphEdge, GraphNode } from 'reagraph';
import Modal from '../../components/Common/Modal';
import Modal, { ModalProps } from '../../components/Common/Modal';
import { useConceptTheme } from '../../context/ThemeContext';
import { graphDarkT, graphLightT } from '../../utils/color';
import { resources } from '../../utils/constants';
import { SyntaxTree } from '../../utils/models';
import { getASTNodeColor, getASTNodeLabel } from '../../utils/staticUI';
interface DlgShowASTProps {
hideWindow: () => void
interface DlgShowASTProps
extends Pick<ModalProps, 'hideWindow'> {
syntaxTree: SyntaxTree
expression: string
}

View File

@ -10,6 +10,7 @@ function BackendLint() {
$mypy = "$backend\venv\Scripts\mypy.exe"
Set-Location $backend
$env:DJANGO_SETTINGS_MODULE = "project.settings"
& $pylint cctext project apps
& $mypy cctext project apps
}