-
Notifications
You must be signed in to change notification settings - Fork 6
Import shared modification #3986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Mathieu-Deharbe
wants to merge
38
commits into
main
Choose a base branch
from
import-shared-modification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
5927d3e
import modification dialog : composite selection
cdc7d4d
Merge branch 'main' into composite-selection
souissimai 96a019c
fixes
6c48bc9
adjust css
235ddf0
Merge branch 'main' into composite-selection
Mathieu-Deharbe 74ab417
Merge branch 'main' into composite-selection
souissimai 7a27fff
fixes
5365298
Merge branch 'main' into composite-selection
souissimai aaefbcf
resolve conflicts
55bf819
Merge branch 'main' into composite-selection
souissimai ec4ea6d
Merge branch 'main' into composite-selection
souissimai 00e32cb
Merge branch 'main' into composite-selection
Mathieu-Deharbe a095b5a
Merge branch 'main' into composite-selection
Mathieu-Deharbe f008614
Merge branch 'main' into composite-selection
Mathieu-Deharbe 7ce4492
import shared modification
Mathieu-Deharbe 08b7268
IS_SHARED as constant + cleaning
Mathieu-Deharbe 43f4be6
disable sharing in INSERT mode
Mathieu-Deharbe 7e291d1
InsertNameCell + non editable name when shared
Mathieu-Deharbe f94fa7e
CompositesToBeInserted
Mathieu-Deharbe 6f66892
updates CompositesToBeInserted
Mathieu-Deharbe ab43bd0
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe 5d77ff6
conflicts
Mathieu-Deharbe b116ba1
selectionContainsShared
Mathieu-Deharbe 3deb8ac
comment
Mathieu-Deharbe 67ac0fc
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe f25a7ed
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe 15019e7
Merge branch 'main' into import-shared-modification
souissimai d72d30c
temp move back import-shared-modification to import-composite
Mathieu-Deharbe cecc28b
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe be0981e
Merge branch 'main' into import-shared-modification
souissimai 59ead2c
post merge
Mathieu-Deharbe 0807ad4
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe b73aea2
Merge branch 'main' into import-shared-modification
souissimai 9df75b6
move back component file
Mathieu-Deharbe d00e737
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe c91032a
comments
Mathieu-Deharbe 6011fd5
Merge branch 'main' into import-shared-modification
souissimai 5158dc0
Merge branch 'main' into import-shared-modification
Mathieu-Deharbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/components/dialogs/import-composite/insert-name-cell.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /** | ||
| * Copyright (c) 2026, RTE (http://www.rte-france.com) | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
| import { IS_SHARED, SELECTED_MODIFICATIONS } from '../../utils/field-constants'; | ||
| import { Box, FormHelperText, TextField, Typography } from '@mui/material'; | ||
| import { Controller, useFormContext, useWatch } from 'react-hook-form'; | ||
| import { JSX } from 'react'; | ||
|
|
||
| interface InsertNameCellProps { | ||
| rowIndex: number; | ||
| } | ||
|
|
||
| const InsertNameCell = ({ rowIndex }: Readonly<InsertNameCellProps>): JSX.Element => { | ||
| const { control } = useFormContext(); | ||
| const originalName: string = useWatch({ | ||
| name: `${SELECTED_MODIFICATIONS}.${rowIndex}.originalName`, | ||
| }); | ||
| const isShared: boolean = useWatch({ | ||
| name: `${SELECTED_MODIFICATIONS}.${rowIndex}.${IS_SHARED}`, | ||
| }); | ||
|
|
||
| return ( | ||
| <Box sx={{ display: 'flex', flexDirection: 'column', width: '100%' }}> | ||
| {isShared ? ( | ||
| <Typography m={1} component="span" variant="body1"> | ||
| {originalName} | ||
| </Typography> | ||
| ) : ( | ||
| <> | ||
| <Controller | ||
| name={`${SELECTED_MODIFICATIONS}.${rowIndex}.name`} | ||
| control={control} | ||
| render={({ field, fieldState }) => ( | ||
| <TextField {...field} size="small" fullWidth error={!!fieldState.error} /> | ||
| )} | ||
| /> | ||
| <FormHelperText sx={{ px: 1, mt: 0.25 }}> {originalName}</FormHelperText> | ||
| </> | ||
| )} | ||
| </Box> | ||
| ); | ||
| }; | ||
|
|
||
| export default InsertNameCell; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.