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">
|
<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" />
|
<img width="650" src="rsconcept/frontend/public/logo_full.svg" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,14 +10,14 @@
|
||||||
React + Django based web portal for editing RSForm schemas.
|
React + Django based web portal for editing RSForm schemas.
|
||||||
This readme file is used mostly to document project dependencies
|
This readme file is used mostly to document project dependencies
|
||||||
|
|
||||||
# Contributing notes
|
# ❤️ Contributing notes
|
||||||
|
|
||||||
!BEFORE PUSHING INTO MAIN!
|
!BEFORE PUSHING INTO MAIN!
|
||||||
|
|
||||||
- use Test config in VSCode to run tests before pushing commits / requests
|
- use Test config in VSCode to run tests before pushing commits / requests
|
||||||
- cd rsconcept/frontend & npm run build
|
- cd rsconcept/frontend & npm run build
|
||||||
|
|
||||||
# Frontend stack & Tooling [Vite + React + Typescript]
|
# ✨ Frontend stack & Tooling [Vite + React + Typescript]
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>npm install</summary>
|
<summary>npm install</summary>
|
||||||
|
@ -78,7 +78,7 @@ This readme file is used mostly to document project dependencies
|
||||||
</pre>
|
</pre>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
# Backend stack & Tooling [Django + PostgreSQL/SQLite]
|
# ✨ Backend stack & Tooling [Django + PostgreSQL/SQLite]
|
||||||
|
|
||||||
- [ConceptCore](https://github.com/IRBorisov/ConceptCore)
|
- [ConceptCore](https://github.com/IRBorisov/ConceptCore)
|
||||||
<details>
|
<details>
|
||||||
|
@ -115,7 +115,7 @@ This readme file is used mostly to document project dependencies
|
||||||
</pre>
|
</pre>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
# DevOps
|
# ✨ DevOps
|
||||||
|
|
||||||
- Docker compose
|
- Docker compose
|
||||||
- PowerShell
|
- PowerShell
|
||||||
|
@ -124,7 +124,7 @@ This readme file is used mostly to document project dependencies
|
||||||
|
|
||||||
# Developer Notes
|
# Developer Notes
|
||||||
|
|
||||||
## Local build (Windows 10+)
|
## 🔭 Local build (Windows 10+)
|
||||||
|
|
||||||
- this is main developers build
|
- this is main developers build
|
||||||
- Install Python 3.12, NodeJS, VSCode, Docker Desktop
|
- 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
|
- run rsconcept/backend/LocalEnvSetup.ps1
|
||||||
- use VSCode configs in root folder to start development
|
- use VSCode configs in root folder to start development
|
||||||
|
|
||||||
## Development build
|
## 🔭 Development build
|
||||||
|
|
||||||
- this build does not use HTTPS and nginx for networking
|
- this build does not use HTTPS and nginx for networking
|
||||||
- backend and frontend debugging is supported
|
- 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'
|
- 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'
|
- 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 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'
|
- 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 clsx from 'clsx';
|
||||||
import { AnimatePresence } from 'framer-motion';
|
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 InfoConstituenta from '@/components/info/InfoConstituenta';
|
||||||
import SelectedCounter from '@/components/info/SelectedCounter';
|
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 Overlay from '@/components/ui/Overlay';
|
||||||
import { useConceptOptions } from '@/context/OptionsContext';
|
import { useConceptOptions } from '@/context/OptionsContext';
|
||||||
import DlgGraphParams from '@/dialogs/DlgGraphParams';
|
import DlgGraphParams from '@/dialogs/DlgGraphParams';
|
||||||
|
@ -51,6 +51,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
||||||
const [showParamsDialog, setShowParamsDialog] = useState(false);
|
const [showParamsDialog, setShowParamsDialog] = useState(false);
|
||||||
const filtered = useGraphFilter(controller.schema, filterParams);
|
const filtered = useGraphFilter(controller.schema, filterParams);
|
||||||
|
|
||||||
|
const graphRef = useRef<GraphCanvasRef | null>(null);
|
||||||
const [hidden, setHidden] = useState<ConstituentaID[]>([]);
|
const [hidden, setHidden] = useState<ConstituentaID[]>([]);
|
||||||
|
|
||||||
const [layout, setLayout] = useLocalStorage<GraphLayout>(storage.rsgraphLayout, 'treeTd2d');
|
const [layout, setLayout] = useLocalStorage<GraphLayout>(storage.rsgraphLayout, 'treeTd2d');
|
||||||
|
@ -176,6 +177,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
||||||
const graph = useMemo(
|
const graph = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<TermGraph
|
<TermGraph
|
||||||
|
graphRef={graphRef}
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
edges={edges}
|
edges={edges}
|
||||||
selectedIDs={controller.selected}
|
selectedIDs={controller.selected}
|
||||||
|
@ -190,6 +192,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
|
graphRef,
|
||||||
edges,
|
edges,
|
||||||
nodes,
|
nodes,
|
||||||
controller.selected,
|
controller.selected,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use client';
|
'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 GraphUI, { GraphCanvasRef, GraphEdge, GraphLayout, GraphNode, useSelection } from '@/components/ui/GraphUI';
|
||||||
import { useConceptOptions } from '@/context/OptionsContext';
|
import { useConceptOptions } from '@/context/OptionsContext';
|
||||||
|
@ -9,6 +9,7 @@ import { graphDarkT, graphLightT } from '@/styling/color';
|
||||||
import { PARAMETER, resources } from '@/utils/constants';
|
import { PARAMETER, resources } from '@/utils/constants';
|
||||||
|
|
||||||
interface TermGraphProps {
|
interface TermGraphProps {
|
||||||
|
graphRef: RefObject<GraphCanvasRef>;
|
||||||
nodes: GraphNode[];
|
nodes: GraphNode[];
|
||||||
edges: GraphEdge[];
|
edges: GraphEdge[];
|
||||||
selectedIDs: ConstituentaID[];
|
selectedIDs: ConstituentaID[];
|
||||||
|
@ -26,6 +27,7 @@ interface TermGraphProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
function TermGraph({
|
function TermGraph({
|
||||||
|
graphRef,
|
||||||
nodes,
|
nodes,
|
||||||
edges,
|
edges,
|
||||||
selectedIDs,
|
selectedIDs,
|
||||||
|
@ -39,7 +41,6 @@ function TermGraph({
|
||||||
onDeselect
|
onDeselect
|
||||||
}: TermGraphProps) {
|
}: TermGraphProps) {
|
||||||
const { calculateHeight, darkMode } = useConceptOptions();
|
const { calculateHeight, darkMode } = useConceptOptions();
|
||||||
const graphRef = useRef<GraphCanvasRef | null>(null);
|
|
||||||
|
|
||||||
const { selections, setSelections } = useSelection({
|
const { selections, setSelections } = useSelection({
|
||||||
ref: graphRef,
|
ref: graphRef,
|
||||||
|
@ -81,7 +82,7 @@ function TermGraph({
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
graphRef.current?.resetControls(true);
|
graphRef.current?.resetControls(true);
|
||||||
graphRef.current?.centerGraph();
|
graphRef.current?.centerGraph();
|
||||||
}, [toggleResetView]);
|
}, [toggleResetView, graphRef]);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const newSelections = nodes.filter(node => selectedIDs.includes(Number(node.id))).map(node => node.id);
|
const newSelections = nodes.filter(node => selectedIDs.includes(Number(node.id))).map(node => node.id);
|
||||||
|
|
|
@ -62,7 +62,7 @@ interface IRSEditContext {
|
||||||
toggleSelect: (target: ConstituentaID) => void;
|
toggleSelect: (target: ConstituentaID) => void;
|
||||||
deselectAll: () => void;
|
deselectAll: () => void;
|
||||||
|
|
||||||
viewVersion: (version?: number) => void;
|
viewVersion: (version?: number, newTab?: boolean) => void;
|
||||||
createVersion: () => void;
|
createVersion: () => void;
|
||||||
editVersions: () => void;
|
editVersions: () => void;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ export const RSEditState = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
const viewVersion = useCallback(
|
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]
|
[router, model]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ function RSTabsMenu({ onDestroy }: RSTabsMenuProps) {
|
||||||
hideTitle={accessMenu.isOpen}
|
hideTitle={accessMenu.isOpen}
|
||||||
className='h-full px-2'
|
className='h-full px-2'
|
||||||
icon={<LuArchive size='1.25rem' className='icon-primary' />}
|
icon={<LuArchive size='1.25rem' className='icon-primary' />}
|
||||||
onClick={() => controller.viewVersion(undefined)}
|
onClick={event => controller.viewVersion(undefined, event.ctrlKey)}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user