Skip to content

Commit

Permalink
fix: force fullName to CustomLabels
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 17, 2021
1 parent 9d7ee33 commit 879129f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/registry/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"customlabels": {
"id": "customlabels",
"name": "CustomLabels",
"ignoreTypeName": true,
"suffix": "labels",
"directoryName": "labels",
"inFolder": false,
Expand Down Expand Up @@ -2563,7 +2564,7 @@
"bots": "bot",
"objectTranslations": "customobjecttranslation",
"staticresources": "staticresource",
"sites": "customsite",
"sites": "customsite"
},
"childTypes": {
"customlabel": "customlabels",
Expand Down
5 changes: 5 additions & 0 deletions src/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export interface MetadataType {
* Whether or not components are required to reside in a folder named after the type's directoryName.
*/
strictDirectoryName?: boolean;
/**
* Whether or not to ignore the fullName that's parsed from the file path. If true, the metadata type's
* name will be used instead. For example, CustomLabels instead of MyLabels.
*/
ignoreTypeName?: boolean;
/**
* If the type is a folder type (container for components), the id of the type it is a container for.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/resolve/sourceComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ export class SourceComponent implements MetadataComponent {
}

get fullName(): string {
if (this.type.ignoreTypeName) {
return this.type.name;
}
if (this.parent && this.type.ignoreParentName) {
return this.name;
} else {
Expand Down

0 comments on commit 879129f

Please sign in to comment.