@@ -76,29 +63,27 @@ function ConstituentsSearch({ schema, activeID, activeExpression, dense, onChang
);
}
-export default ConstituentsSearch;
-
// ====== Internals =========
/**
* Filter list of {@link ILibraryItem} to a given graph query.
*/
-export function applyGraphQuery(target: IRSForm, start: number, mode: DependencyMode): IConstituenta[] {
+function applyGraphQuery(target: IRSForm, pivot: number, mode: DependencyMode): IConstituenta[] {
if (mode === DependencyMode.ALL) {
return target.items;
}
const ids: number[] | undefined = (() => {
switch (mode) {
case DependencyMode.OUTPUTS: {
- return target.graph.nodes.get(start)?.outputs;
+ return target.graph.nodes.get(pivot)?.outputs;
}
case DependencyMode.INPUTS: {
- return target.graph.nodes.get(start)?.inputs;
+ return target.graph.nodes.get(pivot)?.inputs;
}
case DependencyMode.EXPAND_OUTPUTS: {
- return target.graph.expandAllOutputs([start]);
+ return target.graph.expandAllOutputs([pivot]);
}
case DependencyMode.EXPAND_INPUTS: {
- return target.graph.expandAllInputs([start]);
+ return target.graph.expandAllInputs([pivot]);
}
}
return undefined;
diff --git a/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx b/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx
index 9b1da02d..bf128697 100644
--- a/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx
+++ b/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx
@@ -12,19 +12,18 @@ import { PARAMETER } from '@/utils/constants';
import { IConstituenta } from '../../../models/rsform';
import { useRSEdit } from '../RSEditContext';
-import ConstituentsSearch from './ConstituentsSearch';
+import { ConstituentsSearch } from './ConstituentsSearch';
import TableSideConstituents from './TableSideConstituents';
// Window width cutoff for dense search bar
const COLUMN_DENSE_SEARCH_THRESHOLD = 1100;
interface ViewConstituentsProps {
- expression: string;
isBottom?: boolean;
isMounted: boolean;
}
-function ViewConstituents({ expression, isBottom, isMounted }: ViewConstituentsProps) {
+export function ViewConstituents({ isBottom, isMounted }: ViewConstituentsProps) {
const windowSize = useWindowSize();
const role = useRoleStore(state => state.role);
const listHeight = useFitHeight(!isBottom ? '8.2rem' : role !== UserRole.READER ? '42rem' : '35rem', '10rem');
@@ -53,7 +52,6 @@ function ViewConstituents({ expression, isBottom, isMounted }: ViewConstituentsP
dense={windowSize.width && windowSize.width < COLUMN_DENSE_SEARCH_THRESHOLD ? true : undefined}
schema={schema}
activeID={activeCst?.id}
- activeExpression={expression}
onChange={setFilteredData}
/>
);
}
-
-export default ViewConstituents;
diff --git a/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/index.tsx b/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/index.tsx
index 7032726d..731c47b9 100644
--- a/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/index.tsx
+++ b/rsconcept/frontend/src/features/rsform/pages/RSFormPage/ViewConstituents/index.tsx
@@ -1 +1 @@
-export { default } from './ViewConstituents';
+export { ViewConstituents } from './ViewConstituents';
diff --git a/rsconcept/frontend/src/hooks/usePartialUpdate.ts b/rsconcept/frontend/src/hooks/usePartialUpdate.ts
deleted file mode 100644
index f5bb7139..00000000
--- a/rsconcept/frontend/src/hooks/usePartialUpdate.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-'use client';
-
-import { useReducer } from 'react';
-
-function usePartialUpdate(initialValue: ValueType) {
- const [value, updateValue] = useReducer(
- (data: ValueType, newData: Partial) => ({
- ...data,
- ...newData
- }),
- initialValue
- );
-
- return [value, updateValue] as [ValueType, typeof updateValue];
-}
-
-export default usePartialUpdate;