[ACS-9546] knowledge retrieval question is repeated when new question is asked (#4555)

* [ACS-9546] Fixed repeating displayed question for knowledge retrieval

* [ACS-9546] Fixed not displayed border around answer

* [ACS-9546] Unit tests
This commit is contained in:
AleksanderSklorz
2025-05-08 15:23:57 +02:00
committed by GitHub
parent b4530e43b9
commit 2be3b94077
7 changed files with 42 additions and 39 deletions

View File

@@ -465,6 +465,13 @@ describe('SearchAiInputComponent', () => {
submittingTrigger();
expect(modalAiSpy).toHaveBeenCalledWith(jasmine.any(Function));
});
it('should call reset on queryControl', () => {
spyOn(component.queryControl, 'reset');
submittingTrigger();
expect(component.queryControl.reset).toHaveBeenCalled();
});
});
}
});

View File

@@ -163,7 +163,7 @@ export class SearchAiInputComponent implements OnInit {
this.modalAiService.openUnsavedChangesModal(() => this.search());
}
search() {
private search(): void {
const error = this.searchAiService.checkSearchAvailability(this.selectedNodesState);
if (error) {
this.notificationService.showError(error);
@@ -175,6 +175,7 @@ export class SearchAiInputComponent implements OnInit {
this.userPreferencesService.set(this.storedNodesKey, JSON.stringify(this.selectedNodesState));
this.store.dispatch(new SearchByTermAiAction(payload));
this.store.dispatch(new ToggleAISearchInput(this.agentControl.value.id, this.queryControl.value));
this.queryControl.reset();
}
}
}

View File

@@ -32,7 +32,7 @@
padding: 18px 20px;
display: flex;
flex-direction: column;
border: 1px solid var(--adf-card-view-border-color);
border: 1px solid var(--adf-theme-foreground-divider-color);
border-radius: 12px;
margin: 16px 0 75px;

View File

@@ -108,6 +108,6 @@ describe('SidenavComponent', () => {
component.ngOnInit();
routerEvents$.next(mockNavigationEnd);
expect(navigationHistoryService.setHistory).toHaveBeenCalledWith(mockNavigationEnd, 3);
expect(navigationHistoryService.setHistory).toHaveBeenCalledWith(mockNavigationEnd);
});
});

View File

@@ -78,7 +78,7 @@ export class SidenavComponent implements OnInit {
.listenToRouteChanges()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((event: NavigationEnd) => {
this.navigationHistoryService.setHistory(event, 3);
this.navigationHistoryService.setHistory(event);
});
}