-
Notifications
You must be signed in to change notification settings - Fork 1
Correction for case base name #592
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
base: main
Are you sure you want to change the base?
Conversation
The problem with this fix that :
|
|
||
const activeDirectory = useSelector((state: AppState) => state.activeDirectory); | ||
const userId = useSelector((state: AppState) => state.user?.profile.sub); | ||
const [modifiedByUser, setModifiedByUser] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [modifiedByUser, setModifiedByUser] = useState(false); | |
const [nameModifiedByUser, setNameModifiedByUser] = useState(false); |
const MAX_FILE_SIZE_IN_BYTES = MAX_FILE_SIZE_IN_MO * 1024 * 1024; | ||
|
||
export default function UploadNewCase({ | ||
modifiedByUser = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modifiedByUser = false, | |
nameModifiedByUser = false, |
|
getBaseName(currentCaseFileName) | ||
.then((response) => { | ||
setValue(name, response, { | ||
shouldValidate: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not use shouldValidate : true, it will removes check on duplicate name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldValidate: true will remove check on file name unicity and should not be used
const selectedDirectory = useSelector((state: AppState) => state.selectedDirectory); | ||
const userId = useSelector((state: AppState) => state.user?.profile.sub); | ||
|
||
const [modifiedByUser, setModifiedByUser] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not a good thing to put the state of the child here, you render the whole form when the state of the child changes !
suggestion to fix this PR