Skip to content

Commit

Permalink
Add feature to update status for clashes when importing again
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgDangl committed Jul 23, 2024
1 parent eba9ca8 commit e755bbc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,25 @@ export class BcfFileComponent {
);
}

this.bcfFile.topics.push(...createdTopics);
// Now we're trying to change topics that we have already imported if their status
// has changed, so we don't import them again but just update their status

const topicsToAdd: BcfTopic[] = [];
createdTopics.forEach((createdTopic) => {
// We'll check if it exists already, and if it does, we'll just update the status
var existingTopic = this.bcfFile.topics.find(
(existing) =>
existing.serverAssignedId ===
createdTopic.serverAssignedId
);
if (existingTopic) {
existingTopic.topicStatus = createdTopic.topicStatus;
} else {
topicsToAdd.push(createdTopic);
}
});

this.bcfFile.topics.push(...topicsToAdd);
this.filteredTopics = [...this.bcfFile.topics];
this.bcfFileAutomaticallySaveService.saveCurrentActiveBcfFileAutomatically();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 mat-dialog-title>Select Clash Test</h2>
</mat-form-field>
<mat-checkbox
[(ngModel)]="onlyImportNew"
matTooltip="This option imports only clashes that were not previously imported, it does not restrict to only clashes with the status 'New'"
matTooltip="This option imports only clashes that were not previously imported, it does not restrict to only clashes with the status 'New'. Already imported clashes will be ignored, and their status will also not be updated."
>Only Import New Clashes</mat-checkbox
>
</mat-dialog-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
export class NavisworksClashSelectionComponent {
viewpointsClient = inject(ViewpointsClient);
loadingService = inject(LoadingService);
onlyImportNew = true;
onlyImportNew = false;
constructor(
public dialogRef: MatDialogRef<NavisworksClashSelectionComponent>
) {
Expand Down

0 comments on commit e755bbc

Please sign in to comment.