Skip to content

Commit

Permalink
fix: propTypes warning
Browse files Browse the repository at this point in the history
* the canRestrictRecord property is optional in
  ProtectionButtonsComponent but required in ProtectionButtons.

* Since it is working without a problem, because of the default value in
  ProtectionButtonsComponent, the required has been removed from
  ProtectionButtons and replaced by a defaultProps definition to be
  consistent with the ProtectionButtonsComponent definition.
  • Loading branch information
utnapischtim authored and kpsherva committed Oct 3, 2024
1 parent f343176 commit 40d6999
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is part of Invenio-RDM-Records
// Copyright (C) 2020-2023 CERN.
// Copyright (C) 2020-2022 Northwestern University.
// Copyright (C) 2021 Graz University of Technology.
// Copyright (C) 2021-2024 Graz University of Technology.
//
// Invenio-RDM-Records is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -109,7 +109,11 @@ export class ProtectionButtons extends Component {
}
}

ProtectionButtons.defaultProps = {
canRestrictRecord: true,
};

ProtectionButtons.propTypes = {
canRestrictRecord: PropTypes.bool.isRequired,
canRestrictRecord: PropTypes.bool,
fieldPath: PropTypes.string.isRequired,
};

0 comments on commit 40d6999

Please sign in to comment.