Add revisions dialog (#485)

* Add mock files

Note that revisions-list needs to be called revisions in the reality to be confirm with the API spec, but our mocking solution doesn't allow that...

* Add revisions API calls

* Fix line endings in mock files

* Extend CommonModal to accept size and additionalClasses

* Clarify variable name in API request

* Add react-diff-viewer as dependency

* Add revision chooser modal

* Fix type of route params

* Added and updated mock files

* Added user-icon list per revision

* Added translation to alt text of avatars

* Updated mock file to remove inconsistencies

* Add caching for revisions

* Sort mock file revisions-list descending by timestamp

* Pre-select first/newest revision on first modal open

* Regenerated yarn.lock file from scratch

* Applied requested changes in variable names and line lengths

* User UserAvatar component instead of manually set image

* Move revision-modal-list-entry to own component

* Removed unnecessary return statements
This commit is contained in:
Erik Michelson 2020-09-02 22:57:44 +02:00 committed by GitHub
parent 0fecda027c
commit d597438c42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 455 additions and 29 deletions

View file

@ -11,13 +11,15 @@ export interface CommonModalProps {
titleI18nKey: string
closeButton?: boolean
icon?: IconName
size?: 'lg' | 'sm' | 'xl'
additionalClasses?: string
}
export const CommonModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, closeButton, icon, children }) => {
export const CommonModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, closeButton, icon, additionalClasses, size, children }) => {
useTranslation()
return (
<Modal show={show} onHide={onHide} animation={true} className="text-dark">
<Modal show={show} onHide={onHide} animation={true} dialogClassName={`text-dark ${additionalClasses ?? ''}`} size={size}>
<Modal.Header closeButton={!!closeButton}>
<Modal.Title>
<ShowIf condition={!!icon}>