Skip to content

Commit

Permalink
conditionally set FqN name for partial import
Browse files Browse the repository at this point in the history
  • Loading branch information
AnaghHegde committed Nov 26, 2024
1 parent b9ce30e commit 817ad74
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ private Mono<ImportActionResultDTO> createImportNewActionsMono(
// It is context level action and hence the action name should be unique
if (TRUE.equals(importingMetaDTO.getIsPartialImport())
&& mappedImportableResourcesDTO.getRefactoringNameReference() != null) {
updateActionNameBeforeMerge(importedNewActionList, mappedImportableResourcesDTO);
updateActionNameBeforeMerge(
importedNewActionList, mappedImportableResourcesDTO, importingMetaDTO.getIsPartialImport());
}

return Mono.zip(actionsInCurrentArtifactMono, actionsInOtherBranchesMono)
Expand Down Expand Up @@ -469,7 +470,9 @@ private Context populateIdReferencesAndReturnBaseContext(
}

private void updateActionNameBeforeMerge(
List<NewAction> importedNewActionList, MappedImportableResourcesDTO mappedImportableResourcesDTO) {
List<NewAction> importedNewActionList,
MappedImportableResourcesDTO mappedImportableResourcesDTO,
boolean isPartialImport) {
Set<String> refactoringNames =
mappedImportableResourcesDTO.getRefactoringNameReference().keySet();

Expand All @@ -483,7 +486,9 @@ private void updateActionNameBeforeMerge(
String oldId = newAction.getId().split("_")[1];
newAction.setId(newNameAction + "_" + oldId);
newAction.getUnpublishedAction().setName(newNameAction);
newAction.getUnpublishedAction().setFullyQualifiedName(newNameAction);
if (!isPartialImport) {
newAction.getUnpublishedAction().setFullyQualifiedName(newNameAction);
}
if (newAction.getPublishedAction() != null) {
newAction.getPublishedAction().setName(newNameAction);
newAction.getPublishedAction().setFullyQualifiedName(newNameAction);
Expand Down

0 comments on commit 817ad74

Please sign in to comment.