Skip to content

Commit

Permalink
fix: force fullName to CustomLabels (#427)
Browse files Browse the repository at this point in the history
* fix: force fullName to CustomLabels

* chore: update prop name

* fix: backward support for toolbelt suffix differences

* Revert "fix: backward support for toolbelt suffix differences"

This reverts commit 9cf9505.

Co-authored-by: mshanemc <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
  • Loading branch information
3 people authored and AnanyaJha committed Aug 19, 2021
1 parent 31208f6 commit 6957c3a
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",
"ignoreParsedFullName": 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.
*/
ignoreParsedFullName?: 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.ignoreParsedFullName) {
return this.type.name;
}
if (this.parent && this.type.ignoreParentName) {
return this.name;
} else {
Expand Down

0 comments on commit 6957c3a

Please sign in to comment.