|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
const NotFoundAlert = (props) => {
|
|
const NotFoundAlert = (props) => {
|
|
|
- const { t } = props;
|
|
|
|
|
|
|
+ const { t, isForbidden, isNotCreatable } = props;
|
|
|
function clickHandler(viewType) {
|
|
function clickHandler(viewType) {
|
|
|
if (props.onPageCreateClicked === null) {
|
|
if (props.onPageCreateClicked === null) {
|
|
|
return;
|
|
return;
|
|
@@ -11,6 +11,10 @@ const NotFoundAlert = (props) => {
|
|
|
props.onPageCreateClicked(viewType);
|
|
props.onPageCreateClicked(viewType);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (isForbidden || isNotCreatable) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="border border-info m-4 p-3">
|
|
<div className="border border-info m-4 p-3">
|
|
|
<div className="col-md-12 p-0">
|
|
<div className="col-md-12 p-0">
|
|
@@ -35,6 +39,8 @@ const NotFoundAlert = (props) => {
|
|
|
NotFoundAlert.propTypes = {
|
|
NotFoundAlert.propTypes = {
|
|
|
t: PropTypes.func.isRequired, // i18next
|
|
t: PropTypes.func.isRequired, // i18next
|
|
|
onPageCreateClicked: PropTypes.func,
|
|
onPageCreateClicked: PropTypes.func,
|
|
|
|
|
+ isForbidden: PropTypes.bool.isRequired,
|
|
|
|
|
+ isNotCreatable: PropTypes.bool.isRequired,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default withTranslation()(NotFoundAlert);
|
|
export default withTranslation()(NotFoundAlert);
|