-
Notifications
You must be signed in to change notification settings - Fork 929
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
fixed env config renaming #7823
base: master
Are you sure you want to change the base?
Changes from 5 commits
dd65bec
4a585e8
bb9784c
3cc1424
eddaae8
4c52a07
1017585
3b76652
610fcc4
0dbb915
24fdf83
b0b110f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,20 +191,32 @@ export class BitMap { | |
this.legacyBitMap.components.forEach((componentMap) => { | ||
const config = componentMap.config; | ||
if (!config) return; | ||
|
||
Object.keys(config).forEach((aspectId) => { | ||
if (aspectId === sourceId.toString()) { | ||
let fullSourceId: string; | ||
try { | ||
fullSourceId = this.getBitmapEntry(sourceId).id.toStringWithoutVersion(); | ||
} catch (error) { | ||
// If entry not found it's probably new, keep the sourceId as is | ||
fullSourceId = sourceId.toString(); | ||
} | ||
|
||
const aspectIdWithoutVersion = ComponentID.fromString(aspectId).toStringWithoutVersion(); | ||
if (aspectIdWithoutVersion === fullSourceId) { | ||
config[targetId.toString()] = config[aspectId]; | ||
delete config[aspectId]; | ||
this.markAsChanged(); | ||
} | ||
|
||
if (aspectId === EnvsAspect.id) { | ||
const envConfig = config[aspectId]; | ||
if (envConfig !== REMOVE_EXTENSION_SPECIAL_SIGN && envConfig.env === sourceId.toString()) { | ||
if (envConfig !== REMOVE_EXTENSION_SPECIAL_SIGN && envConfig.env === fullSourceId) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is for this prop:
afaik it can't be with the version over there. I think the issue you are referring to is with the env itself as a prop for example:
In that case, this one is resolved here:
|
||
envConfig.env = targetId.toString(); | ||
this.markAsChanged(); | ||
} | ||
} | ||
}); | ||
|
||
componentMap.config = config; | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of try catch you can use
getBitmapEntryIfExist
And instead of doing
toStringWithoutVersion
you can pass a second arg to the get like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Actually, I realized that the sourceId is already a componentId so this whole get entry is just redundant.