Skip to content

Commit

Permalink
After QA
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Apr 11, 2024
1 parent 0d13629 commit 3b7dae2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const PaginationButton = ({ label, disabled, additionalClasses, buttonAdditional
return (
<li className={className}>
<button className={`page-link ${buttonAdditionalClasses}`} onClick={handleClick} type="button">
{label}
{label && label}
</button>
</li>
);
};

PaginationButton.propTypes = {
label: PropTypes.string.isRequired,
label: PropTypes.string,
disabled: PropTypes.bool,
onPageChange: PropTypes.func,
pageIndex: PropTypes.number.isRequired,
Expand All @@ -31,6 +31,7 @@ PaginationButton.propTypes = {
};

PaginationButton.defaultProps = {
label: '',
disabled: false,
additionalClasses: '',
buttonAdditionalClasses: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TooltipPopupComponent = ({
</button>
)}
{closeLabel && (
<button className="btn ibexa-btn ibexa-btn--tertiary" type="button" onClick={onClose} {...closeBtnAttrs}>
<button className="btn ibexa-btn ibexa-btn--ghost" type="button" onClick={onClose} {...closeBtnAttrs}>
{closeLabel}
</button>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default class DropAreaComponent extends Component {
}

DropAreaComponent.propTypes = {
maxFileSizes: PropTypes.objectOf(PropTypes.number).isRequired,
maxFileSizes: PropTypes.arrayOf(PropTypes.object).isRequired,
processUploadedFiles: PropTypes.func.isRequired,
preventDefaultAction: PropTypes.func.isRequired,
addItemsToUpload: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,30 +463,28 @@ export default class UploadItemComponent extends Component {

UploadItemComponent.propTypes = {
item: PropTypes.object.isRequired,
onAfterUpload: PropTypes.func.isRequired,
onAfterAbort: PropTypes.func.isRequired,
onAfterDelete: PropTypes.func.isRequired,
createFileStruct: PropTypes.func.isRequired,
publishFile: PropTypes.func.isRequired,
deleteFile: PropTypes.func.isRequired,
checkCanUpload: PropTypes.func.isRequired,
adminUiConfig: PropTypes.shape({
multiFileUpload: PropTypes.shape({
defaultMappings: PropTypes.arrayOf(PropTypes.object).isRequired,
fallbackContentType: PropTypes.object.isRequired,
locationMappings: PropTypes.arrayOf(PropTypes.object).isRequired,
maxFileSize: PropTypes.number.isRequired,
}).isRequired,
token: PropTypes.string.isRequired,
siteaccess: PropTypes.string.isRequired,
}).isRequired,
parentInfo: PropTypes.shape({
contentTypeIdentifier: PropTypes.string.isRequired,
locationPath: PropTypes.string.isRequired,
language: PropTypes.string.isRequired,
}).isRequired,
contentCreatePermissionsConfig: PropTypes.object,
contentTypesMap: PropTypes.object.isRequired,
onAfterUpload: PropTypes.func,
onAfterAbort: PropTypes.func,
onAfterDelete: PropTypes.func,
createFileStruct: PropTypes.func,
publishFile: PropTypes.func,
deleteFile: PropTypes.func,
checkCanUpload: PropTypes.func,
contentCreatePermissionsConfig: PropTypes.object,
currentLanguage: PropTypes.string,
isUploaded: PropTypes.bool,
isFailed: PropTypes.bool,
Expand All @@ -496,6 +494,13 @@ UploadItemComponent.propTypes = {
};

UploadItemComponent.defaultProps = {
onAfterUpload: () => {},
onAfterAbort: () => {},
onAfterDelete: () => {},
createFileStruct: () => {},
publishFile: () => {},
deleteFile: () => {},
checkCanUpload: () => {},
isUploaded: false,
isFailed: false,
currentLanguage: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ UploadListComponent.propTypes = {
locationMappings: PropTypes.arrayOf(PropTypes.object).isRequired,
maxFileSize: PropTypes.number.isRequired,
}).isRequired,
token: PropTypes.string.isRequired,
siteaccess: PropTypes.string.isRequired,
}).isRequired,
parentInfo: PropTypes.shape({
contentTypeIdentifier: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ UploadPopupModule.propTypes = {
locationMappings: PropTypes.arrayOf(PropTypes.object).isRequired,
maxFileSize: PropTypes.number.isRequired,
}).isRequired,
token: PropTypes.string.isRequired,
siteaccess: PropTypes.string.isRequired,
}).isRequired,
parentInfo: PropTypes.shape({
contentTypeIdentifier: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export default class MultiFileUploadModule extends Component {
confirmPopup() {
this.setState((state) => ({ ...state, popupVisible: false, allowDropOnWindow: true }));
this.props.onPopupConfirm(this._itemsUploaded);

if (this.props.triggerId === SUBITEMS_TRIGGER_ID && !!this._itemsUploaded.length) {
window.location.reload();
}

this._itemsUploaded = [];
}

Expand All @@ -96,7 +101,7 @@ export default class MultiFileUploadModule extends Component {
}

handleAfterUpload(itemsUploaded) {
this._itemsUploaded = [...this._itemsUploaded, ...itemsUploaded];
this._itemsUploaded = itemsUploaded;
}

handleAfterDelete(deletedItem) {
Expand Down Expand Up @@ -242,9 +247,6 @@ MultiFileUploadModule.propTypes = {
locationMappings: PropTypes.arrayOf(PropTypes.object).isRequired,
maxFileSize: PropTypes.number.isRequired,
}).isRequired,
token: PropTypes.string,
siteaccess: PropTypes.string,
accessToken: PropTypes.string,
}).isRequired,
parentInfo: PropTypes.shape({
contentTypeIdentifier: PropTypes.string.isRequired,
Expand Down

0 comments on commit 3b7dae2

Please sign in to comment.