@@ -14,7 +14,6 @@ import MarkdownPageBody from '../../components/MarkdownPageBody';
14
14
import { fetchPage , deletePage , putPage } from '../../ducks/pages' ;
15
15
import { updateTitle , updateBody , updatePath } from '../../ducks/metadata' ;
16
16
import { clearErrors } from '../../ducks/utils' ;
17
- import { injectDefaultFields } from '../../utils/metadata' ;
18
17
import { preventDefault , getDocumentTitle } from '../../utils/helpers' ;
19
18
import { ADMIN_PREFIX } from '../../constants' ;
20
19
@@ -85,7 +84,6 @@ export class PageEdit extends Component {
85
84
updated,
86
85
fieldChanged,
87
86
params,
88
- config,
89
87
} = this . props ;
90
88
91
89
if ( isFetching ) {
@@ -100,12 +98,16 @@ export class PageEdit extends Component {
100
98
save : this . handleClickSave ,
101
99
} ;
102
100
103
- const { name, raw_content, http_url, front_matter } = page ;
101
+ const {
102
+ name,
103
+ raw_content,
104
+ http_url,
105
+ front_matter,
106
+ front_matter_defaults,
107
+ } = page ;
104
108
const directory = params . splat [ 0 ] ;
105
109
106
110
const title = front_matter && front_matter . title ? front_matter . title : '' ;
107
- const defaultMetadata = injectDefaultFields ( config , directory , 'pages' ) ;
108
-
109
111
const document_title = getDocumentTitle ( 'pages' , directory , title || name ) ;
110
112
111
113
return (
@@ -128,7 +130,7 @@ export class PageEdit extends Component {
128
130
title = { title }
129
131
body = { raw_content }
130
132
metafields = { { title, raw_content, path : name , ...front_matter } }
131
- staticmetafields = { defaultMetadata }
133
+ staticmetafields = { front_matter_defaults }
132
134
/>
133
135
< div className = "content-side" >
134
136
< Button
@@ -170,7 +172,6 @@ PageEdit.propTypes = {
170
172
params : PropTypes . object . isRequired ,
171
173
router : PropTypes . object . isRequired ,
172
174
route : PropTypes . object . isRequired ,
173
- config : PropTypes . object . isRequired ,
174
175
} ;
175
176
176
177
const mapStateToProps = state => ( {
@@ -179,7 +180,6 @@ const mapStateToProps = state => ({
179
180
fieldChanged : state . metadata . fieldChanged ,
180
181
updated : state . pages . updated ,
181
182
errors : state . utils . errors ,
182
- config : state . config . config ,
183
183
} ) ;
184
184
185
185
const mapDispatchToProps = dispatch =>
0 commit comments