diff --git a/demo/Page/components/Edit/index.js b/demo/Page/components/Edit/index.js
index f700cde98e..73b2e84e7a 100644
--- a/demo/Page/components/Edit/index.js
+++ b/demo/Page/components/Edit/index.js
@@ -18,11 +18,6 @@ const Edit = props => {
const { id } = props.match.params;
const { data, collection, config } = props;
- function get(attribute) {
- // TODO: if the app is not using localization this will need to be revisited
- return data[attribute] && props.locale && data[attribute][props.locale] ? data[attribute][props.locale] : '';
- }
-
const sampleRepeaterValue = [
{
content: 'here\'s some test content'
@@ -47,12 +42,12 @@ const Edit = props => {
diff --git a/src/components/data/edit.js b/src/components/data/edit.js
index c55ba98522..8594f082aa 100644
--- a/src/components/data/edit.js
+++ b/src/components/data/edit.js
@@ -20,9 +20,9 @@ const withEditData = PassedComponent => {
fetchData = () => {
const { id } = this.props.match.params;
+
const params = {
- // TODO: if the app is not using localization this will need to be revisited
- locale: 'all'
+ locale: this.props.locale
};
if (id) {
diff --git a/src/components/views/collections/Edit/index.js b/src/components/views/collections/Edit/index.js
index 9ab59d2f25..f1bb04cadb 100644
--- a/src/components/views/collections/Edit/index.js
+++ b/src/components/views/collections/Edit/index.js
@@ -5,15 +5,6 @@ import './index.scss';
const EditView = props => {
- function title() {
- // TODO: this doesn't work because props.locale is missing
- // TODO: if the app is not using localization this will need to be revisited
- if (Object.keys(props.data).length > 0 && props.locale) {
- return props.data[props.collection.useAsTitle] ? props.data[props.collection.useAsTitle]['en'] || props.data[props.collection.useAsTitle] : '[Untitled]';
- }
- return '[Untitled]';
- }
-
const nav = [{
url: `/collections/${props.collection.slug}`,
label: props.collection.label
@@ -22,7 +13,7 @@ const EditView = props => {
if (props.isEditing) {
nav.push({
url: `/collections/${props.collection.slug}/${props.data._id}`,
- label: props.data ? title() : ''
+ label: props.data ? props.data[props.collection.useAsTitle] : ''
})
} else {
nav.push({
@@ -36,7 +27,9 @@ const EditView = props => {
{props.isEditing &&
- Edit {title()}
+ Edit {Object.keys(props.data).length > 0 &&
+ (props.data[props.collection.useAsTitle] ? props.data[props.collection.useAsTitle] : '[Untitled]')
+ }
}
{!props.isEditing &&