[ACS-8202] basic flow getting ai response for one or more selected files (#3936)

* ACS-8202 Added animated icon

* ACS-8202 Added search ai input

* ACS-8202 Added AI search results page

* ACS-8202 Allow to run knowledge retrieval on files inside library, shared, favourites and recent files

* ACS-8202 Hide icon when selected more than 100 files or non text files

* ACS-8202 Display notification when too many files are selected

* ACS-8202 Added agents dropdown

* ACS-8202 Styles for AI response

* ACS-8202 Applied design changes

* ACS-8202 Added query card to Knowledge retrieval page results

* ACS-8202 Fixed search collapsing when opened results page

* ACS-8202 Changed placeholder in input for results page, wrapping text and scrolling for results page

* ACS-8202 Display snackbar with messages when conditions are not met

* ACS-8202 Disallow run knowledge retrieval for libraries, leave input when click on x button

* ACS-8202 Renaming files

* ACS-8202 Trigger ai input by selecting agent instead of clicking on button

* ACS-8202 Reverted triggering showing input by selecting option from select

* ACS-8202 Display dropdown with agents by clicking on button

* ACS-8202 Structural changes - services and agents button component

* ACS-8202 Removed part for examples from search page

* ACS-8202 Simplified html for search page

* ACS-8202 Refactored html and styles for search page, translations for search page

* ACS-8202 More html and styles refactoring

* ACS-8202 Formatting html

* ACS-8202 Removed references to angular material classes

* ACS-8202 Added data automation id attributes

* ACS-8202 Load agents from backend, formatting html for agents button component and adding data automation ids to that component

* ACS-8202 Correction after rebase

* ACS-8202 Set agent for input based on selected agent from dropdown for agents button

* ACS-8202 Hide agent button for libraries pages and use translations for warnings when clicked on agents button

* ACS-8202 Pass agent id to search results page

* ACS-8202 Used form control instead of ngmodel for search query

* ACS-8202 Moved search ai service and search ai input state to ADF

* ACS-8202 Results page ts clean up

* ACS-8202 Used ask and getAnswer functions from search ai service

* ACS-8202 Cleaning of search ai navigation service

* ACS-8202 Small clean ups

* ACS-8202 Renamed sources to references

* ACS-8202 Fixed asking next question from results page

* ACS-8202 Added possibility to use knowledge retrieval from search results page

* ACS-8202 Fixed issue with selecting the same agent after previously closing input on search results page

* ACS-8202 Disallowed using knowledge retrieval on trash page

* ACS-8202 Hide toggling knowledge retrieval for tasks and processes, fixed displaying ask button for favorites page

* ACS-8202 Removed redundant image and function

* ACS-8202 Renamed breadcrumbTemplate to header

* ACS-8202 Removed redundant code, added some comments, made some fields as private

* ACS-8202 Display error message on search page

* ACS-8202 Accessibility changes

* ACS-8202 Small correction

* ACS-8202 Addressed comments

* ACS-8202 Displayed correct initials

* ACS-8202 Removed redundant imports

* ACS-8202 Change css value

* ACS-8202 Removed icon animation

* ACS-8202 Removed icon animation
This commit is contained in:
AleksanderSklorz
2024-07-16 15:12:31 +02:00
committed by GitHub
parent e7cd5741d2
commit 17a7697e5e
40 changed files with 1411 additions and 25 deletions

View File

@@ -0,0 +1,17 @@
<aca-search-ai-input
(searchSubmitted)="hideSearchInput()"
[placeholder]="placeholder"
[agentId]="agentId"
[useStoredNodes]="useStoredNodes">
</aca-search-ai-input>
<mat-divider
[vertical]="true"
class="aca-search-ai-input-container-divider">
</mat-divider>
<button
mat-icon-button
(click)="leaveSearchInput()"
data-automation-id="aca-search-ai-input-container-leaving-search-button"
[title]="'KNOWLEDGE_RETRIEVAL.SEARCH.SEARCH_INPUT.HIDE_INPUT' | translate">
<mat-icon>close</mat-icon>
</button>

View File

@@ -0,0 +1,14 @@
aca-search-ai-input-container {
display: flex;
flex-direction: row;
flex: 1;
align-items: center;
width: 100%;
.aca-search-ai-input-container-divider {
height: 24px;
margin-left: 30px;
margin-right: 7px;
background: var(--adf-theme-foreground-text-color-025);
}
}

View File

@@ -0,0 +1,81 @@
/*!
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { SearchAiInputComponent } from '../search-ai-input/search-ai-input.component';
import { MatDividerModule } from '@angular/material/divider';
import { SearchAiNavigationService } from '../../../../services/search-ai-navigation.service';
import { NavigationStart, Router } from '@angular/router';
import { filter, takeUntil } from 'rxjs/operators';
import { SearchAiService } from '@alfresco/adf-content-services';
import { TranslateModule } from '@ngx-translate/core';
import { Subject } from 'rxjs';
@Component({
standalone: true,
imports: [SearchAiInputComponent, MatIconModule, MatDividerModule, MatButtonModule, TranslateModule],
selector: 'aca-search-ai-input-container',
templateUrl: './search-ai-input-container.component.html',
styleUrls: ['./search-ai-input-container.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class SearchAiInputContainerComponent implements OnInit, OnDestroy {
@Input()
placeholder = 'KNOWLEDGE_RETRIEVAL.SEARCH.SEARCH_INPUT.DEFAULT_PLACEHOLDER';
@Input()
agentId: string;
@Input()
useStoredNodes: boolean;
private onDestroy$ = new Subject<void>();
constructor(private searchAiService: SearchAiService, private searchNavigationService: SearchAiNavigationService, private router: Router) {}
ngOnInit(): void {
this.router.events
.pipe(
filter((event) => event instanceof NavigationStart),
takeUntil(this.onDestroy$)
)
.subscribe(() => this.hideSearchInput());
}
ngOnDestroy(): void {
this.onDestroy$.next();
this.onDestroy$.complete();
}
hideSearchInput(): void {
this.searchAiService.updateSearchAiInputState({
active: false
});
}
leaveSearchInput(): void {
this.searchNavigationService.navigateToPreviousRoute();
this.hideSearchInput();
}
}