Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/DAG-UPB/HeatTransPlan
Browse files
frontend/src/components/process/ProcessGroupList.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import { useState } from 'react';
|
|
|
|
| 2 |
import type { ProcessNode } from '../../types/process';
|
| 3 |
import SubprocessCard from './SubprocessCard';
|
| 4 |
import './ProcessGroupList.css';
|
|
@@ -45,6 +46,7 @@ export default function ProcessGroupList({
|
|
| 45 |
expandedGroups = new Set(),
|
| 46 |
onExpandedGroupsChange,
|
| 47 |
}: Props) {
|
|
|
|
| 48 |
const [infoExpanded, setInfoExpanded] = useState<Set<number>>(new Set());
|
| 49 |
const [confirmDelete, setConfirmDelete] = useState<number | null>(null);
|
| 50 |
|
|
@@ -200,7 +202,7 @@ export default function ProcessGroupList({
|
|
| 200 |
{isPlacing ? 'Done' : 'Place'}
|
| 201 |
</button>
|
| 202 |
|
| 203 |
-
<span className="pgl-badge">{subIdxs.length}
|
| 204 |
|
| 205 |
{confirmDelete === gIdx ? (
|
| 206 |
<span className="pgl-confirm">
|
|
|
|
| 1 |
import { useState } from 'react';
|
| 2 |
+
import { useTranslation } from 'react-i18next';
|
| 3 |
import type { ProcessNode } from '../../types/process';
|
| 4 |
import SubprocessCard from './SubprocessCard';
|
| 5 |
import './ProcessGroupList.css';
|
|
|
|
| 46 |
expandedGroups = new Set(),
|
| 47 |
onExpandedGroupsChange,
|
| 48 |
}: Props) {
|
| 49 |
+
const { t } = useTranslation();
|
| 50 |
const [infoExpanded, setInfoExpanded] = useState<Set<number>>(new Set());
|
| 51 |
const [confirmDelete, setConfirmDelete] = useState<number | null>(null);
|
| 52 |
|
|
|
|
| 202 |
{isPlacing ? 'Done' : 'Place'}
|
| 203 |
</button>
|
| 204 |
|
| 205 |
+
<span className="pgl-badge">{subIdxs.length} {t('data_collection.sub_short')}</span>
|
| 206 |
|
| 207 |
{confirmDelete === gIdx ? (
|
| 208 |
<span className="pgl-confirm">
|
frontend/src/components/process/SubprocessCard.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import { useState } from 'react';
|
|
|
|
| 2 |
import type { ProcessNode } from '../../types/process';
|
| 3 |
import type { Stream } from '../../types/stream';
|
| 4 |
import StreamEditor from './StreamEditor';
|
|
@@ -35,6 +36,7 @@ export default function SubprocessCard({
|
|
| 35 |
onPlaceRequest,
|
| 36 |
placementTarget,
|
| 37 |
}: Props) {
|
|
|
|
| 38 |
const expanded = useUIStore((s) => s.expandedSubprocesses.has(subIdx));
|
| 39 |
const setExpanded = (v: boolean) => useUIStore.getState().setSubprocessExpanded(subIdx, v);
|
| 40 |
|
|
@@ -148,7 +150,7 @@ export default function SubprocessCard({
|
|
| 148 |
<div className="sp-tabs">
|
| 149 |
{[
|
| 150 |
{ key: 'relationships', label: 'Relationships', color: '#2980b9' },
|
| 151 |
-
{ key: 'streams', label: '
|
| 152 |
{ key: 'notes', label: 'Notes', color: '#f39c12' },
|
| 153 |
].map((tab) => (
|
| 154 |
<button
|
|
@@ -199,7 +201,7 @@ export default function SubprocessCard({
|
|
| 199 |
<div className="sp-section">
|
| 200 |
<div className="flex justify-between items-center mb-sm">
|
| 201 |
<span className="sp-section-title">
|
| 202 |
-
|
| 203 |
</span>
|
| 204 |
<button className="btn btn-sm btn-primary" onClick={addStream}>
|
| 205 |
➕ Add Stream
|
|
|
|
| 1 |
import { useState } from 'react';
|
| 2 |
+
import { useTranslation } from 'react-i18next';
|
| 3 |
import type { ProcessNode } from '../../types/process';
|
| 4 |
import type { Stream } from '../../types/stream';
|
| 5 |
import StreamEditor from './StreamEditor';
|
|
|
|
| 36 |
onPlaceRequest,
|
| 37 |
placementTarget,
|
| 38 |
}: Props) {
|
| 39 |
+
const { t } = useTranslation();
|
| 40 |
const expanded = useUIStore((s) => s.expandedSubprocesses.has(subIdx));
|
| 41 |
const setExpanded = (v: boolean) => useUIStore.getState().setSubprocessExpanded(subIdx, v);
|
| 42 |
|
|
|
|
| 150 |
<div className="sp-tabs">
|
| 151 |
{[
|
| 152 |
{ key: 'relationships', label: 'Relationships', color: '#2980b9' },
|
| 153 |
+
{ key: 'streams', label: t('data_collection.streams'), color: '#e74c3c' },
|
| 154 |
{ key: 'notes', label: 'Notes', color: '#f39c12' },
|
| 155 |
].map((tab) => (
|
| 156 |
<button
|
|
|
|
| 201 |
<div className="sp-section">
|
| 202 |
<div className="flex justify-between items-center mb-sm">
|
| 203 |
<span className="sp-section-title">
|
| 204 |
+
{t('data_collection.streams')} ({subprocess.streams?.length || 0})
|
| 205 |
</span>
|
| 206 |
<button className="btn btn-sm btn-primary" onClick={addStream}>
|
| 207 |
➕ Add Stream
|
frontend/src/locales/de.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
| 62 |
"title": "Stromauswahl",
|
| 63 |
"help_desc": "Wählen Sie aus, welche Ströme (Wärmequellen oder -senken) in die Pinch-Analyse einbezogen werden sollen. Deaktivieren Sie Ströme, die derzeit inaktiv sind oder ausgeschlossen werden sollen.",
|
| 64 |
"subprocess": "Sub",
|
| 65 |
-
"stream": "
|
| 66 |
"incomplete": "(unvollständige Daten)"
|
| 67 |
},
|
| 68 |
"energy_demands": {
|
|
@@ -77,5 +77,9 @@
|
|
| 77 |
"cold_selection": "Auswahl kalter Ströme",
|
| 78 |
"no_cold": "Keine kalten Ströme",
|
| 79 |
"add_supply": "Versorgung hinzufügen"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
}
|
|
|
|
| 62 |
"title": "Stromauswahl",
|
| 63 |
"help_desc": "Wählen Sie aus, welche Ströme (Wärmequellen oder -senken) in die Pinch-Analyse einbezogen werden sollen. Deaktivieren Sie Ströme, die derzeit inaktiv sind oder ausgeschlossen werden sollen.",
|
| 64 |
"subprocess": "Sub",
|
| 65 |
+
"stream": "Ströme",
|
| 66 |
"incomplete": "(unvollständige Daten)"
|
| 67 |
},
|
| 68 |
"energy_demands": {
|
|
|
|
| 77 |
"cold_selection": "Auswahl kalter Ströme",
|
| 78 |
"no_cold": "Keine kalten Ströme",
|
| 79 |
"add_supply": "Versorgung hinzufügen"
|
| 80 |
+
},
|
| 81 |
+
"data_collection": {
|
| 82 |
+
"sub_short": "sub",
|
| 83 |
+
"streams": "Ströme"
|
| 84 |
}
|
| 85 |
}
|
frontend/src/locales/en.json
CHANGED
|
@@ -77,5 +77,9 @@
|
|
| 77 |
"cold_selection": "Cold streams selection",
|
| 78 |
"no_cold": "No cold streams",
|
| 79 |
"add_supply": "Add Supply"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
}
|
|
|
|
| 77 |
"cold_selection": "Cold streams selection",
|
| 78 |
"no_cold": "No cold streams",
|
| 79 |
"add_supply": "Add Supply"
|
| 80 |
+
},
|
| 81 |
+
"data_collection": {
|
| 82 |
+
"sub_short": "sub",
|
| 83 |
+
"streams": "Streams"
|
| 84 |
}
|
| 85 |
}
|