@@ -44,6 +44,7 @@ export type RenderableChangelog = {
4444 newCustomObjects : NewTypeSection < 'customobject' > | null ;
4545 removedCustomObjects : RemovedTypeSection | null ;
4646 newOrRemovedCustomFields : NewOrModifiedMembersSection | null ;
47+ newOrRemovedCustomMetadataTypeRecords : NewOrModifiedMembersSection | null ;
4748} ;
4849
4950export function convertToRenderableChangelog (
@@ -60,6 +61,16 @@ export function convertToRenderableChangelog(
6061 const newCustomObjects = allNewTypes . filter (
6162 ( type ) : type is CustomObjectMetadata => type . type_name === 'customobject' ,
6263 ) ;
64+ const newOrModifiedCustomFields = changelog . customObjectModifications . filter (
65+ ( modification ) : modification is NewOrModifiedMember =>
66+ modification . modifications . some ( ( mod ) => mod . __typename === 'NewField' || mod . __typename === 'RemovedField' ) ,
67+ ) ;
68+ const newOrModifiedCustomMetadataTypeRecords = changelog . customObjectModifications . filter (
69+ ( modification ) : modification is NewOrModifiedMember =>
70+ modification . modifications . some (
71+ ( mod ) => mod . __typename === 'NewCustomMetadataRecord' || mod . __typename === 'RemovedCustomMetadataRecord' ,
72+ ) ,
73+ ) ;
6374
6475 return {
6576 newClasses :
@@ -122,11 +133,19 @@ export function convertToRenderableChangelog(
122133 }
123134 : null ,
124135 newOrRemovedCustomFields :
125- changelog . customObjectModifications . length > 0
136+ newOrModifiedCustomFields . length > 0
126137 ? {
127138 heading : 'New or Removed Fields to Custom Objects or Standard Objects' ,
128139 description : 'These custom fields have been added or removed.' ,
129- modifications : changelog . customObjectModifications . map ( toRenderableModification ) ,
140+ modifications : newOrModifiedCustomFields . map ( toRenderableModification ) ,
141+ }
142+ : null ,
143+ newOrRemovedCustomMetadataTypeRecords :
144+ newOrModifiedCustomMetadataTypeRecords . length > 0
145+ ? {
146+ heading : 'New or Removed Custom Metadata Type Records' ,
147+ description : 'These custom metadata type records have been added or removed.' ,
148+ modifications : newOrModifiedCustomMetadataTypeRecords . map ( toRenderableModification ) ,
130149 }
131150 : null ,
132151 } ;
@@ -180,5 +199,9 @@ function toRenderableModificationDescription(memberModificationType: MemberModif
180199 return `New Type: ${ withDescription ( memberModificationType ) } ` ;
181200 case 'RemovedType' :
182201 return `Removed Type: ${ memberModificationType . name } ` ;
202+ case 'NewCustomMetadataRecord' :
203+ return `New Custom Metadata Record: ${ withDescription ( memberModificationType ) } ` ;
204+ case 'RemovedCustomMetadataRecord' :
205+ return `Removed Custom Metadata Record: ${ memberModificationType . name } ` ;
183206 }
184207}
0 commit comments