-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from EmmanuelDemey/master
maxOccurs=unbounded
- Loading branch information
Showing
32 changed files
with
1,225 additions
and
355 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,5 @@ cypress/screenshots | |
|
||
coverage | ||
build | ||
|
||
*.mp4 |
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
33 changes: 15 additions & 18 deletions
33
app/src/js/applications/concepts/edition-creation/links/search-concepts-by-label.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
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
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
61 changes: 61 additions & 0 deletions
61
app/src/js/applications/operations/msd/pages/sims-creation/sims-document-field.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,61 @@ | ||
import React, { useCallback } from 'react'; | ||
import { isLink, isDocument } from 'js/applications/operations/document/utils'; | ||
import DocumentsBloc from '../../documents/documents-bloc'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export const SimsDocumentField = ({ handleChange, msd, currentSection }) => { | ||
const handleDeleteDocument = useCallback( | ||
uri => { | ||
const objects = currentSection.documents || []; | ||
handleChange({ | ||
id: msd.idMas, | ||
override: { | ||
documents: objects.filter(doc => doc.uri !== uri), | ||
}, | ||
}); | ||
}, | ||
[handleChange, currentSection.documents, msd.idMas] | ||
); | ||
|
||
const handleAddDocument = useCallback( | ||
newObject => { | ||
const objects = currentSection.documents || []; | ||
handleChange({ | ||
id: msd.idMas, | ||
override: { | ||
documents: [...objects, newObject], | ||
}, | ||
}); | ||
}, | ||
[handleChange, msd.idMas, currentSection.documents] | ||
); | ||
|
||
return ( | ||
<div className="bauhaus-document-field"> | ||
<DocumentsBloc | ||
documents={(currentSection.documents || []).filter(isDocument)} | ||
localPrefix={'Lg1'} | ||
editMode={true} | ||
deleteHandler={handleDeleteDocument} | ||
addHandler={handleAddDocument} | ||
objectType="documents" | ||
/> | ||
<DocumentsBloc | ||
documents={(currentSection.documents || []).filter(isLink)} | ||
localPrefix={'Lg1'} | ||
editMode={true} | ||
deleteHandler={handleDeleteDocument} | ||
addHandler={handleAddDocument} | ||
objectType="links" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
SimsDocumentField.propTypes = { | ||
msd: PropTypes.object.isRequired, | ||
currentSection: PropTypes.object, | ||
handleChange: PropTypes.func, | ||
}; | ||
|
||
export default SimsDocumentField; |
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.