Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
NetworkModificationsTable,
NotificationsUrlKeys,
removeNullFields,
setModificationMetadata,

Check failure on line 24 in src/components/graph/menus/network-modifications/network-modification-node-editor.tsx

View workflow job for this annotation

GitHub Actions / build / build

'"@gridsuite/commons-ui"' has no exported member named 'setModificationMetadata'. Did you mean 'NetworkModificationMetadata'?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

@gridsuite/commons-ui npm package latest version exports

💡 Result:

Latest version (as of today, 2026-05-20) of the NPM package @gridsuite/commons-ui is 0.210.0 [1]. Exports The package’s top-level entry is index.js / index.d.ts under the package root (i.e., you import from “@gridsuite/commons-ui” to get its main public API) [2]. From the published package contents, the library also ships compiled modules under dist/, including: - dist/hooks/* (e.g., dist/hooks/index.{js,d.ts} and individual hook files) [2] - dist/components/* including dist/components/icons/* [2] Note: the sources retrieved here show the published file structure for the latest version, but they do not explicitly display the package.json “exports” map itself. Therefore, I can’t quote the exact “exports” field mappings without fetching the package.json for 0.210.0 from the registry tarball/metadata.

Citations:


🏁 Script executed:

#!/bin/bash
# Fetch the package.json for the published version to see what's exported
curl -s "https://registry.npmjs.org/@gridsuite/commons-ui/0.210.0" | jq '.dist.tarball' 2>/dev/null || echo "Unable to fetch tarball URL"

# Also try to get metadata about exports
curl -s "https://registry.npmjs.org/@gridsuite/commons-ui/latest" | jq '.exports // .main // empty' 2>/dev/null | head -50

Repository: gridsuite/gridstudy-app

Length of output: 161


🏁 Script executed:

#!/bin/bash
# Check the local codebase for the import statement and file context
if [ -f "src/components/graph/menus/network-modifications/network-modification-node-editor.tsx" ]; then
  echo "=== Import section of the file ==="
  head -40 "src/components/graph/menus/network-modifications/network-modification-node-editor.tsx" | cat -n
  echo ""
  echo "=== Checking for setModificationMetadata usage ==="
  grep -n "setModificationMetadata" "src/components/graph/menus/network-modifications/network-modification-node-editor.tsx" | head -20
fi

Repository: gridsuite/gridstudy-app

Length of output: 2111


🌐 Web query:

setModificationMetadata @gridsuite/commons-ui export

💡 Result:

I can’t find any authoritative source (within the searched repositories/docs) that documents what “setModificationMetadata” in “@gridsuite/commons-ui” does, nor any exported symbol named setModificationMetadata in that package. The results I located for @gridsuite/commons-ui are limited to the package listing/metadata and a generic repository README, without showing that specific export or function usage [1][2][3][4]. What I can conclude from evidence: there is a @gridsuite/commons-ui npm package and a gridsuite/commons-ui GitHub repo, but the web-visible excerpts from those pages do not mention setModificationMetadata or “export” for that symbol [1][2][3][4]. If you paste the relevant file(s) or the exact import line you’re using (e.g., the code around “setModificationMetadata … export” or where the compilation error points), I can pinpoint the correct export/function name and the intended usage pattern in commons-ui.

Citations:


🏁 Script executed:

#!/bin/bash
# Check the package.json to see the commons-ui dependency version
if [ -f "package.json" ]; then
  echo "=== Dependencies for `@gridsuite/commons-ui` ==="
  cat package.json | jq '.dependencies["`@gridsuite/commons-ui`"] // .devDependencies["`@gridsuite/commons-ui`"] // "Not found"'
fi

Repository: gridsuite/gridstudy-app

Length of output: 124


🏁 Script executed:

#!/bin/bash
# Look for setModificationMetadata in the node_modules or any local reference
echo "=== Searching for setModificationMetadata in codebase ==="
rg "export.*setModificationMetadata" --type ts --type tsx --type js 2>/dev/null | head -20

echo ""
echo "=== Checking if commons-ui is available locally and searching there ==="
if [ -d "node_modules/@gridsuite/commons-ui" ]; then
  echo "Commons-ui found in node_modules, checking exports..."
  rg "export.*setModificationMetadata" node_modules/@gridsuite/commons-ui --type ts --type js 2>/dev/null | head -20
fi

Repository: gridsuite/gridstudy-app

Length of output: 198


🌐 Web query:

site:github.com gridsuite/commons-ui setModificationMetadata export

💡 Result:

Based on the available documentation and public repositories for the GridSuite project, there is no evidence of a method named setModificationMetadata within the gridsuite/commons-ui library [1][2]. The commons-ui library is primarily a collection of shared components for GridSuite applications [1], and the associated repositories indicate that applications like gridmerge-app, gridexplore-app, and gridstudy-app use this library [2][3][4]. It is possible that the method you are inquiring about may be related to: 1. Custom local implementation within specific GridSuite applications that use commons-ui [2][3][4]. 2. A misunderstanding of library function naming, as setMetadata is a common pattern in various SDKs (such as Google Cloud Storage or general PDF metadata manipulation tools) for managing object properties [5][6][7]. If you are a developer looking to enhance or update components within the GridSuite ecosystem, you may refer to the contribution instructions typically found in the main repository or the specific application repositories [1][2][3][4]. If you have access to the source code for gridsuite/commons-ui, you can verify the existence of specific methods by searching the src directory within the repository directly [1].

Citations:


🏁 Script executed:

#!/bin/bash
# Check if commons-ui version 0.212.0 exists on npm
curl -s "https://registry.npmjs.org/@gridsuite/commons-ui/0.212.0" 2>/dev/null | jq '.version // "Version not found"'

Repository: gridsuite/gridstudy-app

Length of output: 77


🌐 Web query:

site:github.com/gridsuite/commons-ui setModificationMetadata

💡 Result:

There is no widely recognized standard library, public API, or language feature named setModificationMetadata. It appears to be a specific identifier, likely a function or method name used within a private codebase or a niche software project (such as a specific internal library, for example, gridsuite/commons-ui). Because it is not a standard or publicly documented API, it does not have a general definition. If you encountered this in specific source code, it is recommended to search for the definition within that project's repository.

Citations:


🌐 Web query:

@gridsuite/commons-ui 0.212.0 npm release

💡 Result:

As of May 20, 2026, there is no npm release for @gridsuite/commons-ui version 0.212.0 [1]. The most recent recorded release for this package is version 0.210.0, which was published on May 13, 2026 [1].

Citations:


Build failure: setModificationMetadata is not exported from @gridsuite/commons-ui.

The import on line 24 will cause a TS2724 compilation error because the setModificationMetadata function does not exist in the currently published versions of @gridsuite/commons-ui (latest is 0.210.0). Ensure the companion PR in commons-ui is merged and version 0.212.0 (specified in package.json) is published before this PR can be merged.

🧰 Tools
🪛 GitHub Actions: CI / 1_build _ build.txt

[error] 24-24: TypeScript error TS2724: "@gridsuite/commons-ui" has no exported member named 'setModificationMetadata'. Did you mean 'NetworkModificationMetadata'?

🪛 GitHub Actions: CI / build _ build

[error] 24-24: TypeScript error TS2724: "@gridsuite/commons-ui" has no exported member named 'setModificationMetadata' (suggests 'NetworkModificationMetadata').

🪛 GitHub Check: build / build

[failure] 24-24:
'"@gridsuite/commons-ui"' has no exported member named 'setModificationMetadata'. Did you mean 'NetworkModificationMetadata'?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/graph/menus/network-modifications/network-modification-node-editor.tsx`
at line 24, The import of setModificationMetadata in
network-modification-node-editor.tsx fails because that symbol is not exported
from `@gridsuite/commons-ui` in published v0.210.0; either remove the import and
any references to setModificationMetadata (or replace them with the existing
alternative API) or ensure the companion PR adding setModificationMetadata is
merged and `@gridsuite/commons-ui` v0.212.0 is published, then update/install
dependencies so the new export is available before merging this PR.

snackWithFallback,
useNotificationsListener,
usePrevious,
Expand Down Expand Up @@ -84,7 +85,6 @@
import {
fetchExcludedNetworkModifications,
fetchNetworkModifications,
setModificationMetadata,
stashModifications,
} from '../../../../services/study/network-modifications';
import {
Expand All @@ -102,6 +102,7 @@
import { LccCreationDialog } from '../../../dialogs/network-modifications/hvdc-line/lcc/creation/lcc-creation-dialog';
import { styles } from './network-modification-node-editor-utils';
import {
CommonStudyEventData,
isModificationsDeleteFinishedNotification,
isModificationsUpdateFinishedNotification,
isNodeDeletedNotification,
Expand All @@ -113,7 +114,6 @@
ModificationsUpdatingInProgressEventData,
NotificationType,
parseEventData,
CommonStudyEventData,
} from 'types/notification-types';
import { LccModificationDialog } from '../../../dialogs/network-modifications/hvdc-line/lcc/modification/lcc-modification-dialog';
import VoltageLevelTopologyModificationDialog from '../../../dialogs/network-modifications/voltage-level/topology-modification/voltage-level-topology-modification-dialog';
Expand Down Expand Up @@ -809,47 +809,15 @@
modificationsToExclude,
]);

const updateModification = useCallback(
async (modif: ComposedModificationMetadata, newName: string) => {
return setModificationMetadata(studyUuid, currentNode?.id, modif.uuid, {
const handleNameChange = useCallback(
(modification: ComposedModificationMetadata, newName: string) =>
setModificationMetadata(studyUuid, currentNode?.id, modification.uuid, {
name: newName,
type: modif?.type,
});
},
type: modification.type,
}),
[studyUuid, currentNode?.id]
);
const handleCellEdit = useCallback(
async (modification: ComposedModificationMetadata, newName?: string) => {
if (!newName || newName.trim() === '') {
return;
}
const trimmed = newName.trim();

// Optimistic immediate update
setModifications((prev) =>
prev.map((m) => {
if (m.uuid !== modification.uuid) return m;
try {
const parsed = JSON.parse(m.messageValues);
return {
...m,
messageValues: JSON.stringify({ ...parsed, name: trimmed }),
};
} catch {
return m;
}
})
);

try {
await updateModification(modification, trimmed);
} catch {
// Rollback in case of an error
setModifications((prev) => prev.map((m) => (m.uuid !== modification.uuid ? m : modification)));
}
},
[updateModification]
);
const handleEvent = useCallback(
(event: MessageEvent) => {
const eventData = parseEventData<CommonStudyEventData>(event);
Expand Down Expand Up @@ -1130,17 +1098,10 @@

const columns = useMemo<ColumnDef<ComposedModificationMetadata>[]>(
() => [
...createBaseColumns(handleCellEdit),
...(isMonoRootStudy
? []
: createRootNetworksColumns(
rootNetworks,
currentRootNetworkUuid!,
modificationsToExclude,
setModificationsToExclude
)),
...createBaseColumns(handleNameChange),
...(isMonoRootStudy ? [] : createRootNetworksColumns(rootNetworks)),
],
[handleCellEdit, isMonoRootStudy, rootNetworks, currentRootNetworkUuid, modificationsToExclude]
[handleNameChange, isMonoRootStudy, rootNetworks]
);

const renderNetworkModificationsTable = () => {
Expand Down Expand Up @@ -1170,6 +1131,11 @@
highlightedModificationUuid={highlightedModificationUuid}
studyUuid={studyUuid}
currentNodeId={currentNode?.id}
currentRootNetworkUuid={currentRootNetworkUuid ?? undefined}

Check failure on line 1134 in src/components/graph/menus/network-modifications/network-modification-node-editor.tsx

View workflow job for this annotation

GitHub Actions / build / build

Type '{ handleCellClick: (modification: NetworkModificationMetadata) => void; modifications: NetworkModificationMetadata[]; ... 16 more ...; isDisabled: boolean; }' is not assignable to type 'IntrinsicAttributes & Readonly<NetworkModificationsTableProps>'.
rootNetworks={isMonoRootStudy ? undefined : rootNetworks}
modificationsToExclude={modificationsToExclude}
setModificationsToExclude={setModificationsToExclude}
isDisabled={isAnyNodeBuilding || mapDataLoading}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@
BASE_MODIFICATION_TABLE_COLUMNS,
ComposedModificationMetadata,
computeTagMinSize,
ExcludedNetworkModifications,
networkModificationTableStyles,
} from '@gridsuite/commons-ui';
import React, { SetStateAction } from 'react';
import { ColumnDef } from '@tanstack/react-table';
import { RootNetworkMetadata } from '../network-modification-menu.type';
import {
DescriptionCellRenderer,

Check failure on line 11 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'DescriptionCellRenderer'.
DragHandleRenderer,

Check failure on line 12 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'DragHandleRenderer'.
NameCellRenderer,

Check failure on line 13 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

'"@gridsuite/commons-ui"' has no exported member named 'NameCellRenderer'. Did you mean 'NumericCellRenderer'?
NameHeaderRenderer,

Check failure on line 14 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'NameHeaderRenderer'.
networkModificationTableStyles,
RootNetworkCellRenderer,

Check failure on line 16 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'RootNetworkCellRenderer'.
RootNetworkHeaderRenderer,

Check failure on line 17 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'RootNetworkHeaderRenderer'.
SelectCellRenderer,

Check failure on line 18 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

'"@gridsuite/commons-ui"' has no exported member named 'SelectCellRenderer'. Did you mean 'DefaultCellRenderer'?
SelectHeaderRenderer,

Check failure on line 19 in src/components/graph/menus/network-modifications/network-modification-table/createColumns.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'SelectHeaderRenderer'.
SwitchCellRenderer,
} from './renderers/cell-renderers';
} from '@gridsuite/commons-ui';
import { ColumnDef } from '@tanstack/react-table';
import { RootNetworkMetadata } from '../network-modification-menu.type';

/**
* Column definition is broken up in 2 parts : base columns which are always on display and root networks columns.
Expand All @@ -33,7 +29,7 @@
*/

export const createBaseColumns = (
onEditNameCell: (modification: ComposedModificationMetadata, newName?: string) => void
onNameChange: (modification: ComposedModificationMetadata, newName: string) => Promise<unknown>
): ColumnDef<ComposedModificationMetadata>[] => [
{
id: BASE_MODIFICATION_TABLE_COLUMNS.DRAG_HANDLE.id,
Expand Down Expand Up @@ -62,7 +58,7 @@
cell: NameCellRenderer,
meta: {
cellStyle: networkModificationTableStyles.columnCell.modificationName,
onEditNameCell,
onChange: onNameChange,
},
minSize: 160,
},
Expand All @@ -86,14 +82,10 @@
];

export const createRootNetworksColumns = (
rootNetworks: RootNetworkMetadata[],
currentRootNetworkUuid: string,
modificationsToExclude: ExcludedNetworkModifications[],
setModificationsToExclude: React.Dispatch<SetStateAction<ExcludedNetworkModifications[]>>
rootNetworks: RootNetworkMetadata[]
): ColumnDef<ComposedModificationMetadata>[] => {
const tagMinSizes = rootNetworks.map((rootNetwork) => computeTagMinSize(rootNetwork.tag ?? ''));
const sharedSize = Math.max(Math.min(...tagMinSizes), 56);
const currentRootNetworkTag = rootNetworks.find((item) => item.rootNetworkUuid === currentRootNetworkUuid)?.tag;

return rootNetworks.map((rootNetwork, index) => ({
id: rootNetwork.rootNetworkUuid,
Expand All @@ -103,11 +95,6 @@
minSize: tagMinSizes[index],
meta: {
cellStyle: networkModificationTableStyles.columnCell.rootNetworkChip,
rootNetwork,
modificationsToExclude,
setModificationsToExclude,
isCurrentRootNetwork: rootNetwork.rootNetworkUuid === currentRootNetworkUuid,
currentRootNetworkTag,
},
}));
};

This file was deleted.

This file was deleted.

Loading
Loading