diff --git a/invenio_communities/assets/semantic-ui/js/invenio_communities/subcommunity/new.js b/invenio_communities/assets/semantic-ui/js/invenio_communities/subcommunity/new.js
index 802734443..6b90ca1ce 100644
--- a/invenio_communities/assets/semantic-ui/js/invenio_communities/subcommunity/new.js
+++ b/invenio_communities/assets/semantic-ui/js/invenio_communities/subcommunity/new.js
@@ -25,6 +25,7 @@ import {
import { Button, Divider, Form, Grid, Header, Icon, Message } from "semantic-ui-react";
import { CommunityApi } from "../api";
import { communityErrorSerializer } from "../api/serializers";
+import Overridable, { OverridableContext, overrideStore } from "react-overridable";
const IdentifierField = ({ formConfig }) => {
const { values } = useFormikContext();
@@ -150,163 +151,174 @@ class CommunityCreateForm extends Component {
};
render() {
- const { formConfig, canCreateRestricted } = this.props;
+ const { formConfig, canCreateRestricted, customFields, communityId } = this.props;
const { hasCommunity, communities, error } = this.state;
return (
-
+ )}
+ {!hasCommunity && (
+ <>
+ {
+ e.key === "Enter" && e.preventDefault();
+ }}
+ label={
+
+ }
+ />
+
+ >
+ )}
+ {!_isEmpty(customFields.ui) && (
+ import(`@templates/custom_fields/${widget}.js`),
+ (widget) => import(`react-invenio-forms`),
+ ]}
+ fieldPathPrefix="custom_fields"
+ />
+ )}
+ {canCreateRestricted && (
+ <>
+ {i18next.t("Community visibility")}
+ {formConfig.access.visibility.map((item) => (
+
+ {
+ formikProps.form.setFieldValue(
+ "access.visibility",
+ item.value
+ );
+ }}
+ />
+
+
+ ))}
+ >
+ )}
+
+
+
+
+
+
+
+
+
+ )}
+
+
);
}
}
@@ -315,6 +327,7 @@ CommunityCreateForm.propTypes = {
formConfig: PropTypes.object.isRequired,
canCreateRestricted: PropTypes.bool.isRequired,
communityId: PropTypes.string.isRequired,
+ customFields: PropTypes.object,
};
const domContainer = document.getElementById("app");
@@ -323,13 +336,16 @@ const customFields = JSON.parse(domContainer.dataset.customFields);
const canCreateRestricted = JSON.parse(domContainer.dataset.canCreateRestricted);
const communityId = domContainer.dataset.communityId;
+const overriddenComponents = overrideStore.getAll();
ReactDOM.render(
- ,
+
+
+ ,
domContainer
);
export default CommunityCreateForm;