@@ -1024,13 +1024,18 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
10241024 }
10251025
10261026 const user = ( await this . currentUser ( ) ) as User ;
1027- const commitMessage = commitMessageFormatter ( newEntry ? 'create' : 'update' , config , {
1028- collection,
1029- slug,
1030- path,
1031- authorLogin : user . login ,
1032- authorName : user . name ,
1033- } ) ;
1027+ const commitMessage = commitMessageFormatter (
1028+ newEntry ? 'create' : 'update' ,
1029+ config ,
1030+ {
1031+ collection,
1032+ slug,
1033+ path,
1034+ authorLogin : user . login ,
1035+ authorName : user . name ,
1036+ } ,
1037+ user . useOpenAuthoring ,
1038+ ) ;
10341039
10351040 const collectionName = collection . name ;
10361041
@@ -1092,11 +1097,16 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
10921097 async persistMedia ( config : ConfigWithDefaults , file : AssetProxy ) {
10931098 const user = ( await this . currentUser ( ) ) as User ;
10941099 const options = {
1095- commitMessage : commitMessageFormatter ( 'uploadMedia' , config , {
1096- path : file . path ,
1097- authorLogin : user . login ,
1098- authorName : user . name ,
1099- } ) ,
1100+ commitMessage : commitMessageFormatter (
1101+ 'uploadMedia' ,
1102+ config ,
1103+ {
1104+ path : file . path ,
1105+ authorLogin : user . login ,
1106+ authorName : user . name ,
1107+ } ,
1108+ user . useOpenAuthoring ,
1109+ ) ,
11001110 } ;
11011111 return this . implementation . persistMedia ( file , options ) ;
11021112 }
@@ -1119,13 +1129,18 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
11191129 }
11201130
11211131 const user = ( await this . currentUser ( ) ) as User ;
1122- const commitMessage = commitMessageFormatter ( 'delete' , configState . config , {
1123- collection,
1124- slug,
1125- path,
1126- authorLogin : user . login ,
1127- authorName : user . name ,
1128- } ) ;
1132+ const commitMessage = commitMessageFormatter (
1133+ 'delete' ,
1134+ configState . config ,
1135+ {
1136+ collection,
1137+ slug,
1138+ path,
1139+ authorLogin : user . login ,
1140+ authorName : user . name ,
1141+ } ,
1142+ user . useOpenAuthoring ,
1143+ ) ;
11291144
11301145 let paths = [ path ] ;
11311146 if ( hasI18n ( collection ) ) {
@@ -1136,11 +1151,16 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
11361151
11371152 async deleteMedia ( config : ConfigWithDefaults , path : string ) {
11381153 const user = ( await this . currentUser ( ) ) as User ;
1139- const commitMessage = commitMessageFormatter ( 'deleteMedia' , config , {
1140- path,
1141- authorLogin : user . login ,
1142- authorName : user . name ,
1143- } ) ;
1154+ const commitMessage = commitMessageFormatter (
1155+ 'deleteMedia' ,
1156+ config ,
1157+ {
1158+ path,
1159+ authorLogin : user . login ,
1160+ authorName : user . name ,
1161+ } ,
1162+ user . useOpenAuthoring ,
1163+ ) ;
11441164 return this . implementation . deleteFiles ( [ path ] , commitMessage ) ;
11451165 }
11461166
@@ -1177,7 +1197,7 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
11771197 entryData : UnpublishedEntry ,
11781198 withMediaFiles : boolean ,
11791199 ) {
1180- const { slug } = entryData ;
1200+ const { slug, openAuthoring } = entryData ;
11811201 let extension : string ;
11821202 if ( 'files' in collection ) {
11831203 const file = collection . files . find ( f => f ?. name === slug ) ;
@@ -1210,10 +1230,10 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
12101230 author : entryData . pullRequestAuthor ,
12111231 status : workflowStatusFromString ( entryData . status ) ,
12121232 meta : { path : prepareMetaPath ( path , collection ) } ,
1233+ openAuthoring,
12131234 } ) ;
12141235
1215- const entryWithFormat = this . entryWithFormat ( collection ) ( entry ) ;
1216- return entryWithFormat ;
1236+ return this . entryWithFormat ( collection ) ( entry ) ;
12171237 } ;
12181238
12191239 const readAndFormatDataFile = async ( dataFile : UnpublishedEntryDiff ) => {
@@ -1223,8 +1243,8 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
12231243 dataFile . path ,
12241244 dataFile . id ,
12251245 ) ;
1226- const entryWithFormat = formatData ( data , dataFile . path , dataFile . newFile ) ;
1227- return entryWithFormat ;
1246+
1247+ return formatData ( data , dataFile . path , dataFile . newFile ) ;
12281248 } ;
12291249
12301250 // if the unpublished entry has no diffs, return the original
@@ -1244,8 +1264,7 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
12441264 const grouped = await groupEntries ( collection , extension , entries as Entry [ ] ) ;
12451265 return grouped [ 0 ] ;
12461266 } else {
1247- const entryWithFormat = await readAndFormatDataFile ( dataFiles [ 0 ] ) ;
1248- return entryWithFormat ;
1267+ return readAndFormatDataFile ( dataFiles [ 0 ] ) ;
12491268 }
12501269 }
12511270
@@ -1261,8 +1280,8 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
12611280 console . warn ( `Missing collection '${ collectionName } ' for unpublished entry '${ id } '` ) ;
12621281 return null ;
12631282 }
1264- const entry = await this . processUnpublishedEntry ( collection , entryData , false ) ;
1265- return entry ;
1283+
1284+ return this . processUnpublishedEntry ( collection , entryData , false ) ;
12661285 } ) ,
12671286 )
12681287 ) . filter ( Boolean ) as Entry [ ] ;
0 commit comments