-
Notifications
You must be signed in to change notification settings - Fork 90
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
SALTO-582: custom obj translation reference fields and validation rules #813
Conversation
packages/salesforce-adapter/src/filters/custom_object_translation.ts
Outdated
Show resolved
Hide resolved
_.clone(objTranslationInstance), | ||
_.clone(customObject), | ||
_.clone(objTranslationType), | ||
_.clone(validationRuleType), | ||
_.clone(validationRuleInstance), |
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.
nit: should probably use element.clone()
instead of _.clone(element)
.
Codecov Report
@@ Coverage Diff @@
## master #813 +/- ##
==========================================
+ Coverage 89.27% 89.33% +0.06%
==========================================
Files 204 205 +1
Lines 9168 9220 +52
Branches 1634 1640 +6
==========================================
+ Hits 8185 8237 +52
Misses 983 983
Continue to review full report at Codecov.
|
@@ -5,9 +5,6 @@ | |||
"workspaces": { | |||
"packages": [ | |||
"packages/*" | |||
], | |||
"nohoist": [ | |||
"salto-vscode/**" |
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.
Seems unrelated to this PR.
maybe a separate commit?
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.
Also, I wonder if it was actually needed so it should be fixed instead of removed?
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.
per my understanding, it should be removed as “nohoist” enables workspaces to consume 3rd-party libraries not yet compatible with its hoisting scheme." and AFAIK we don't have such a case.
Notice that practically it's not working for a long time (not sure if it means something as vscode extension is also not working)
@royra @roironn WDYT?
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.
I think it's needed for packaging of the vscode extension: microsoft/vscode-vsce#300
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.
ok so I'll change salto-vscode
-> vscode
instead of removing
|
||
const apiNameToCustomObject = generateApiNameToCustomObject(elements) | ||
const apiNameToRules = _.groupBy( | ||
getInstancesOfMetadataType(elements, VALIDATION_RULES_METADATA_TYPE), | ||
ruleObj | ||
customObjectApiName |
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.
this function is being applied on things that are not a custom object, is this a bug?
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.
I think I understand now what this is supposed to be.
If I am right the name is very confusing. maybe rename customObjectApiName
-> parentApiName
and instanceShortName
-> relativeApiName
?
Then it can be used on field api names as well
onFetch: async (elements: Element[]) => { | ||
const allCustomObjectFields = (elemID: ElemID): Iterable<Field> => | ||
wu(findElements(elements, elemID)) | ||
.map(elem => Object.values((elem as ObjectType).fields)) |
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.
casting is dangerous
.map(elem => Object.values((elem as ObjectType).fields)) | |
.filter(isObjectType) | |
.map(elem => Object.values(elem).fields)) |
|
||
// Change fields to reference | ||
makeArray(customTranslation.value[FIELDS]).forEach(field => { | ||
const customField = wu(allCustomObjectFields(customObjectElemId)) |
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.
nit: create once as a map of apiName -> elemID instead of iterating all fields every time?
same applies to the next loop over validation rules
No description provided.