mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Small fixes
This commit is contained in:
parent
212765c4d2
commit
dff56c4aaf
16
README.md
16
README.md
|
@ -1,5 +1,5 @@
|
|||
<div align="center">
|
||||
<a href="https://portal.acconcept.ru/">
|
||||
<a href="https://portal.acconcept.ru/" target="_blank">
|
||||
<img width="650" src="rsconcept/frontend/public/logo_full.svg" />
|
||||
</a>
|
||||
</div>
|
||||
|
@ -10,14 +10,14 @@
|
|||
React + Django based web portal for editing RSForm schemas.
|
||||
This readme file is used mostly to document project dependencies
|
||||
|
||||
# Contributing notes
|
||||
# ❤️ Contributing notes
|
||||
|
||||
!BEFORE PUSHING INTO MAIN!
|
||||
|
||||
- use Test config in VSCode to run tests before pushing commits / requests
|
||||
- cd rsconcept/frontend & npm run build
|
||||
|
||||
# Frontend stack & Tooling [Vite + React + Typescript]
|
||||
# ✨ Frontend stack & Tooling [Vite + React + Typescript]
|
||||
|
||||
<details>
|
||||
<summary>npm install</summary>
|
||||
|
@ -78,7 +78,7 @@ This readme file is used mostly to document project dependencies
|
|||
</pre>
|
||||
</details>
|
||||
|
||||
# Backend stack & Tooling [Django + PostgreSQL/SQLite]
|
||||
# ✨ Backend stack & Tooling [Django + PostgreSQL/SQLite]
|
||||
|
||||
- [ConceptCore](https://github.com/IRBorisov/ConceptCore)
|
||||
<details>
|
||||
|
@ -115,7 +115,7 @@ This readme file is used mostly to document project dependencies
|
|||
</pre>
|
||||
</details>
|
||||
|
||||
# DevOps
|
||||
# ✨ DevOps
|
||||
|
||||
- Docker compose
|
||||
- PowerShell
|
||||
|
@ -124,7 +124,7 @@ This readme file is used mostly to document project dependencies
|
|||
|
||||
# Developer Notes
|
||||
|
||||
## Local build (Windows 10+)
|
||||
## 🔭 Local build (Windows 10+)
|
||||
|
||||
- this is main developers build
|
||||
- Install Python 3.12, NodeJS, VSCode, Docker Desktop
|
||||
|
@ -132,7 +132,7 @@ This readme file is used mostly to document project dependencies
|
|||
- run rsconcept/backend/LocalEnvSetup.ps1
|
||||
- use VSCode configs in root folder to start development
|
||||
|
||||
## Development build
|
||||
## 🔭 Development build
|
||||
|
||||
- this build does not use HTTPS and nginx for networking
|
||||
- backend and frontend debugging is supported
|
||||
|
@ -146,7 +146,7 @@ This readme file is used mostly to document project dependencies
|
|||
- provide TLS certificate (can be self-signed) 'nginx/cert/local-cert.pem' and 'nginx/cert/local-key.pem'
|
||||
- run via 'docker compose -f "docker-compose-prod-local.yml" up --build -d'
|
||||
|
||||
## Production build
|
||||
## 📦 Production build
|
||||
|
||||
- provide proper pyconcept wheel (ConceptCore) at 'rsconcept/backend/import/\*.whl'
|
||||
- provide secrets: 'secrets/db_password.txt', 'django_key.txt', 'email_host.txt', 'email_password.txt', 'email_user.txt'
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
import clsx from 'clsx';
|
||||
import { AnimatePresence } from 'framer-motion';
|
||||
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
||||
import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import InfoConstituenta from '@/components/info/InfoConstituenta';
|
||||
import SelectedCounter from '@/components/info/SelectedCounter';
|
||||
import { GraphEdge, GraphLayout, GraphNode } from '@/components/ui/GraphUI';
|
||||
import { GraphCanvasRef, GraphEdge, GraphLayout, GraphNode } from '@/components/ui/GraphUI';
|
||||
import Overlay from '@/components/ui/Overlay';
|
||||
import { useConceptOptions } from '@/context/OptionsContext';
|
||||
import DlgGraphParams from '@/dialogs/DlgGraphParams';
|
||||
|
@ -51,6 +51,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
const [showParamsDialog, setShowParamsDialog] = useState(false);
|
||||
const filtered = useGraphFilter(controller.schema, filterParams);
|
||||
|
||||
const graphRef = useRef<GraphCanvasRef | null>(null);
|
||||
const [hidden, setHidden] = useState<ConstituentaID[]>([]);
|
||||
|
||||
const [layout, setLayout] = useLocalStorage<GraphLayout>(storage.rsgraphLayout, 'treeTd2d');
|
||||
|
@ -176,6 +177,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
const graph = useMemo(
|
||||
() => (
|
||||
<TermGraph
|
||||
graphRef={graphRef}
|
||||
nodes={nodes}
|
||||
edges={edges}
|
||||
selectedIDs={controller.selected}
|
||||
|
@ -190,6 +192,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
/>
|
||||
),
|
||||
[
|
||||
graphRef,
|
||||
edges,
|
||||
nodes,
|
||||
controller.selected,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
|
||||
import { RefObject, useCallback, useLayoutEffect, useMemo } from 'react';
|
||||
|
||||
import GraphUI, { GraphCanvasRef, GraphEdge, GraphLayout, GraphNode, useSelection } from '@/components/ui/GraphUI';
|
||||
import { useConceptOptions } from '@/context/OptionsContext';
|
||||
|
@ -9,6 +9,7 @@ import { graphDarkT, graphLightT } from '@/styling/color';
|
|||
import { PARAMETER, resources } from '@/utils/constants';
|
||||
|
||||
interface TermGraphProps {
|
||||
graphRef: RefObject<GraphCanvasRef>;
|
||||
nodes: GraphNode[];
|
||||
edges: GraphEdge[];
|
||||
selectedIDs: ConstituentaID[];
|
||||
|
@ -26,6 +27,7 @@ interface TermGraphProps {
|
|||
}
|
||||
|
||||
function TermGraph({
|
||||
graphRef,
|
||||
nodes,
|
||||
edges,
|
||||
selectedIDs,
|
||||
|
@ -39,7 +41,6 @@ function TermGraph({
|
|||
onDeselect
|
||||
}: TermGraphProps) {
|
||||
const { calculateHeight, darkMode } = useConceptOptions();
|
||||
const graphRef = useRef<GraphCanvasRef | null>(null);
|
||||
|
||||
const { selections, setSelections } = useSelection({
|
||||
ref: graphRef,
|
||||
|
@ -81,7 +82,7 @@ function TermGraph({
|
|||
useLayoutEffect(() => {
|
||||
graphRef.current?.resetControls(true);
|
||||
graphRef.current?.centerGraph();
|
||||
}, [toggleResetView]);
|
||||
}, [toggleResetView, graphRef]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const newSelections = nodes.filter(node => selectedIDs.includes(Number(node.id))).map(node => node.id);
|
||||
|
|
|
@ -62,7 +62,7 @@ interface IRSEditContext {
|
|||
toggleSelect: (target: ConstituentaID) => void;
|
||||
deselectAll: () => void;
|
||||
|
||||
viewVersion: (version?: number) => void;
|
||||
viewVersion: (version?: number, newTab?: boolean) => void;
|
||||
createVersion: () => void;
|
||||
editVersions: () => void;
|
||||
|
||||
|
@ -163,7 +163,7 @@ export const RSEditState = ({
|
|||
);
|
||||
|
||||
const viewVersion = useCallback(
|
||||
(version?: number) => router.push(urls.schema(model.schemaID, version)),
|
||||
(version?: number, newTab?: boolean) => router.push(urls.schema(model.schemaID, version), newTab),
|
||||
[router, model]
|
||||
);
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ function RSTabsMenu({ onDestroy }: RSTabsMenuProps) {
|
|||
hideTitle={accessMenu.isOpen}
|
||||
className='h-full px-2'
|
||||
icon={<LuArchive size='1.25rem' className='icon-primary' />}
|
||||
onClick={() => controller.viewVersion(undefined)}
|
||||
onClick={event => controller.viewVersion(undefined, event.ctrlKey)}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user