Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support toolbelt suffixes #428

Merged
merged 10 commits into from
Aug 18, 2021
6 changes: 4 additions & 2 deletions src/convert/transformers/defaultMetadataTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class DefaultMetadataTransformer extends BaseMetadataTransformer {
return mergeWith.xml;
}

const { folderContentType, suffix } = component.type;
const { folderContentType, suffix, legacySuffix } = component.type;
let xmlDestination = component.getPackageRelativePath(component.xml, targetFormat);

// quirks:
Expand Down Expand Up @@ -117,7 +117,9 @@ export class DefaultMetadataTransformer extends BaseMetadataTransformer {
);
}
}

if (legacySuffix && suffix && xmlDestination.includes(legacySuffix)) {
xmlDestination = xmlDestination.replace(legacySuffix, suffix);
}
return xmlDestination;
}
}
5 changes: 4 additions & 1 deletion src/registry/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
"suffixes": {
"field": "customfield",
"index": "index",
"indexe": "index",
"businessProcess": "businessprocess",
"recordType": "recordtype",
"compactLayout": "compactlayout",
Expand Down Expand Up @@ -422,7 +423,8 @@
"suffix": "weblink",
"directoryName": "weblinks",
"inFolder": false,
"strictDirectoryName": false
"strictDirectoryName": false,
"legacySuffix": "custompageweblink"
},
"letterhead": {
"id": "letterhead",
Expand Down Expand Up @@ -2385,6 +2387,7 @@
"feedFilter": "customfeedfilter",
"layout": "layout",
"weblink": "custompageweblink",
"custompageweblink": "custompageweblink",
"letter": "letterhead",
"email": "emailtemplate",
"quickAction": "quickaction",
Expand Down
5 changes: 5 additions & 0 deletions src/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export interface MetadataType {
* If the parent name should be ignored when constructing the type's fullName
*/
ignoreParentName?: boolean;
/**
* When converting deploying source, this will update the suffix in the output or temporary directory (metadata format)
* Use this, along with additional suffix keys in the registry, to support incorrect suffixes from existing code
*/
legacySuffix?: string;
/**
* The xml attribute used as the unique identifier when parsing the xml
*/
Expand Down