-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Franck ALARY
committed
Feb 23, 2024
1 parent
1b3ccb4
commit 009d98a
Showing
16 changed files
with
271 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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 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 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,8 @@ | ||
import { stringNormalizeFileName, stringSlugify } from '../../Helpers/Strings.js' | ||
|
||
const | ||
generateDirNameStory = (title, uuid, age, category) => { | ||
return stringNormalizeFileName(category || '').substring(0, 32) + '_' + ((age || '') + '').substring(0, 32) + '_' + stringNormalizeFileName(title).substring(0, 32) + '_' + stringSlugify(uuid).substring(0, 36) | ||
} | ||
|
||
export { generateDirNameStory } |
This file contains 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 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 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 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 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 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
65 changes: 65 additions & 0 deletions
65
src/App/Modules/Synchronize/Stories/ModalStoriesFormUpdate.js
This file contains 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,65 @@ | ||
import { useRef } from 'react' | ||
import { useLocale } from '../../../Components/Locale/LocaleHooks.js' | ||
import ModalLayoutPadded from '../../../Components/Modal/ModalLayoutPadded.js' | ||
import ButtonsContainer from '../../../Components/Buttons/ButtonsContainer.js' | ||
import ButtonIconTextCheck from '../../../Components/Buttons/IconsTexts/ButtonIconTextCheck.js' | ||
import InputText from '../../../Components/Form/Input/InputText.js' | ||
import ModalTitle from '../../../Components/Modal/ModalTitle.js' | ||
import ModalContent from '../../../Components/Modal/ModalContent.js' | ||
import Form from '../../../Components/Form/Form.js' | ||
|
||
function ModalStoryFormUpdate ({stories, onValidate, onClose}) { | ||
const | ||
{getLocale} = useLocale(), | ||
inputAgeRef = useRef(), | ||
inputCategoryRef = useRef() | ||
|
||
return <ModalLayoutPadded isClosable={true} | ||
onClose={onClose}> | ||
<ModalTitle>{getLocale('stories-edit')} :</ModalTitle> | ||
<Form>{ | ||
(validation) => { | ||
return <> | ||
<ModalContent> | ||
<InputText label={getLocale('age')} | ||
type="number" | ||
step="1" | ||
min="0" | ||
max="99" | ||
defaultValue={stories[0].age || 0} | ||
required={false} | ||
ref={inputAgeRef}/> | ||
<InputText label={getLocale('category')} | ||
defaultValue={stories[0].category || ''} | ||
required={false} | ||
ref={inputCategoryRef}/> | ||
</ModalContent> | ||
<ButtonsContainer> | ||
<ButtonIconTextCheck text={getLocale('save')} | ||
rounded={true} | ||
onClick={() => { | ||
validation( | ||
[ | ||
inputAgeRef, | ||
inputCategoryRef | ||
], | ||
(values) => { | ||
onValidate(stories.map( | ||
(story) => ({ | ||
...story, | ||
age: values[0], | ||
category: values[1] | ||
}) | ||
)) | ||
onClose() | ||
} | ||
) | ||
}}/> | ||
</ButtonsContainer> | ||
</> | ||
} | ||
}</Form> | ||
</ModalLayoutPadded> | ||
} | ||
|
||
export default ModalStoryFormUpdate |
This file contains 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.