@@ -85,14 +85,19 @@ function EditorContainer(props) {
Collections
-
-
- External Services
-
-
+ {
+ user && user.id === editor.id ?
+ (
+
+
+ External Services
+
+
+ ) : null
+ }
@@ -109,7 +114,11 @@ EditorContainer.propTypes = {
name: PropTypes.string,
title: PropTypes.object
}).isRequired,
- tabActive: PropTypes.number.isRequired
+ tabActive: PropTypes.number.isRequired,
+ user: PropTypes.object
+};
+EditorContainer.defaultProps = {
+ user: null
};
export default EditorContainer;
diff --git a/src/client/controllers/editor/achievement.js b/src/client/controllers/editor/achievement.js
index 591cdc4e04..81af8d623b 100644
--- a/src/client/controllers/editor/achievement.js
+++ b/src/client/controllers/editor/achievement.js
@@ -41,6 +41,7 @@ ReactDOM.hydrate(
>
diff --git a/src/client/entity-editor/entity-editor.tsx b/src/client/entity-editor/entity-editor.tsx
index 82ca154209..317b6e32ba 100644
--- a/src/client/entity-editor/entity-editor.tsx
+++ b/src/client/entity-editor/entity-editor.tsx
@@ -27,6 +27,7 @@ import NameSection from './name-section/name-section';
import RelationshipSection from './relationship-editor/relationship-section';
import SubmissionSection from './submission-section/submission-section';
import _ from 'lodash';
+import {getEntityUrl} from '../helpers/entity';
import {submit} from './submission-section/actions';
@@ -34,6 +35,7 @@ type OwnProps = {
children: React.ReactElement
,
heading: string,
intitialState:Record,
+ entity: any
};
type StateProps = {
@@ -67,9 +69,11 @@ const EntityEditor = (props: Props) => {
children,
heading,
identifierEditorVisible,
- onSubmit
+ onSubmit,
+ entity
} = props;
const currentState = (useSelector((state) => state) as any).toJS();
+ let entityURL;
// eslint-disable-next-line consistent-return
const handleUrlChange = React.useCallback(() => {
if (!_.isEqual(currentState, props.intitialState) && !currentState.submissionSection.submitted) {
@@ -80,11 +84,17 @@ const EntityEditor = (props: Props) => {
window.onbeforeunload = handleUrlChange;
}, [handleUrlChange]);
+ if(entity){
+ entityURL = getEntityUrl(entity);
+ }
+
return (