Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
386 changes: 217 additions & 169 deletions bot/admin/web/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bot/admin/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"karma-coverage": "^2.2.0",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"ngx-mf": "^5.2.0",
"prettier": "2.6.2",
"ts-node": "3.2.2",
"typescript": "5.2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 class="flex-grow-1">Dialog</h1>
></tock-no-data-found>

<nb-card *ngIf="dialog">
<nb-card-body class="pl-3 pr-0">
<nb-card-body class="p-0">
<tock-chat-ui>
<tock-chat-ui-dialog-logger
[dialog]="dialog"
Expand Down
2 changes: 1 addition & 1 deletion bot/admin/web/src/app/analytics/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class DialogComponent implements OnInit, OnDestroy {
) {}

ngOnInit(): void {
this.initialize();
setTimeout(() => this.initialize());
}

initialize(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,66 @@
>
<form [formGroup]="form">
<div class="row">
<div class="col-6 col-lg-3">
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="calendar-plus"
></nb-icon>
<input
nbInput
fullWidth
fieldSize="small"
placeholder="Data collected after"
nbTooltip="Show dialogs created after this date"
[nbDatepicker]="from_date"
formControlName="dialogCreationDateFrom"
/>
<button
*ngIf="!!getFormControl('dialogCreationDateFrom').value"
nbButton
nbSuffix
ghost
nbTooltip="Clear"
type="button"
(click)="resetControl(getFormControl('dialogCreationDateFrom'))"
>
<nb-icon icon="x"></nb-icon>
</button>
</nb-form-field>
<nb-datepicker #from_date></nb-datepicker>
</div>

<div class="col-6 col-lg-3">
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="calendar-minus"
></nb-icon>
<input
nbInput
fullWidth
fieldSize="small"
placeholder="Data collected before"
nbTooltip="Show dialogs created before this date"
[nbDatepicker]="to_date"
formControlName="dialogCreationDateTo"
/>
<button
*ngIf="!!getFormControl('dialogCreationDateTo').value"
nbButton
nbSuffix
ghost
nbTooltip="Clear"
type="button"
(click)="resetControl(getFormControl('dialogCreationDateTo'))"
>
<nb-icon icon="x"></nb-icon>
</button>
</nb-form-field>
<nb-datepicker #to_date></nb-datepicker>
</div>

<div class="col-6 col-lg-3">
<nb-form-field class="mb-2">
<nb-icon
Expand All @@ -90,6 +150,7 @@
></nb-icon>
<nb-select
fullWidth
size="small"
nbTooltip="Search for dialogs using this configuration."
placeholder="Configuration"
formControlName="configuration"
Expand All @@ -113,6 +174,7 @@
></nb-icon>
<nb-select
fullWidth
size="small"
nbTooltip="Search for dialogs using this connector."
placeholder="Connector"
formControlName="connectorType"
Expand Down Expand Up @@ -140,6 +202,7 @@
></nb-icon>
<nb-select
fullWidth
size="small"
nbTooltip="Search dialogs containing exchanges corresponding to the selected intent."
placeholder="Intent"
formControlName="intentName"
Expand All @@ -164,6 +227,7 @@
></nb-icon>
<nb-select
fullWidth
size="small"
multiple
nbTooltip="Hide exchanges corresponding to selected intents."
placeholder="Hide intents"
Expand All @@ -179,9 +243,7 @@
</nb-select>
</nb-form-field>
</div>
</div>

<div class="row">
<div class="col-6 col-lg-3">
<nb-form-field>
<nb-icon
Expand All @@ -191,7 +253,7 @@
<input
nbInput
fullWidth
fieldSize="medium"
fieldSize="small"
nbTooltip="Search a dialog by id"
placeholder="Dialog id"
type="text"
Expand All @@ -213,7 +275,16 @@
</nb-form-field>
</div>

<div class="col-6 col-lg-3 pt-2">
<div class="col-6 col-lg-3 pt-1">
<nb-checkbox
nbTooltip="Display dialogues held from the studio test view"
class="text-nowrap"
formControlName="displayTests"
>Display tests
</nb-checkbox>
</div>

<div class="col-6 col-lg-3 pt-1">
<nb-checkbox
nbTooltip="Display only dialogs containing Rag responses"
class="text-nowrap"
Expand All @@ -222,14 +293,156 @@
</nb-checkbox>
</div>

<div class="col-6 col-lg-3 pt-2">
<!-- Annotations filters -->

<div class="col-6 col-lg-3 pt-1 ellipsis">
<nb-checkbox
nbTooltip="Display dialogues held from the studio test view"
nbTooltip="Display only annotated dialogs"
class="text-nowrap"
formControlName="displayTests"
>Display tests
formControlName="withAnnotations"
>With annotation
</nb-checkbox>
</div>

<div
class="col-6 col-lg-3"
*ngIf="getFormControl('withAnnotations').value"
>
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="pin-angle"
></nb-icon>
<nb-select
fullWidth
size="small"
multiple
nbTooltip="Filter annotations by state"
placeholder="Annotations state"
formControlName="annotationStates"
>
<nb-option>Clear selection</nb-option>
<nb-option
*ngFor="let state of annotationStates"
[value]="state.value"
>
{{ state.label }}
</nb-option>
</nb-select>
</nb-form-field>
</div>

<div
class="col-6 col-lg-3"
*ngIf="getFormControl('withAnnotations').value"
>
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="cone-striped"
></nb-icon>
<nb-select
fullWidth
size="small"
multiple
nbTooltip="Filter annotations by reason"
placeholder="Annotations reasons"
formControlName="annotationReasons"
>
<nb-option>Clear selection</nb-option>
<nb-option
*ngFor="let reason of annotationReasons"
[value]="reason.value"
>
{{ reason.label }}
</nb-option>
</nb-select>
</nb-form-field>
</div>

<div
class="col-6 col-lg-3"
*ngIf="getFormControl('withAnnotations').value"
>
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="calendar-plus"
></nb-icon>
<input
nbInput
fullWidth
fieldSize="small"
placeholder="Annotations created after"
nbTooltip="Show annotations created after this date"
[nbDatepicker]="from_date_annotation"
formControlName="annotationCreationDateFrom"
/>
<button
*ngIf="!!getFormControl('annotationCreationDateFrom').value"
nbButton
nbSuffix
ghost
nbTooltip="Clear"
type="button"
(click)="resetControl(getFormControl('annotationCreationDateFrom'))"
>
<nb-icon icon="x"></nb-icon>
</button>
</nb-form-field>
<nb-datepicker #from_date_annotation></nb-datepicker>
</div>

<div
class="col-6 col-lg-3"
*ngIf="getFormControl('withAnnotations').value"
>
<nb-form-field class="mb-2">
<nb-icon
nbPrefix
icon="calendar-minus"
></nb-icon>
<input
nbInput
fullWidth
fieldSize="small"
placeholder="Annotations created before"
nbTooltip="Show annotations created before this date"
[nbDatepicker]="to_date_annotation"
formControlName="annotationCreationDateTo"
/>
<button
*ngIf="!!getFormControl('annotationCreationDateTo').value"
nbButton
nbSuffix
ghost
nbTooltip="Clear"
type="button"
(click)="resetControl(getFormControl('annotationCreationDateTo'))"
>
<nb-icon icon="x"></nb-icon>
</button>
</nb-form-field>
<nb-datepicker #to_date_annotation></nb-datepicker>
</div>

<div
class="col-12 col-xl-6 d-flex gap-1 align-items-center"
*ngIf="getFormControl('withAnnotations').value"
>
Sort order of annotations:
<nb-radio-group
formControlName="annotationSort"
class="d-flex"
>
<nb-radio
*ngFor="let order of sortOrders"
[value]="order.value"
>
{{ order.label }}
</nb-radio>
</nb-radio-group>
</div>
</div>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { BotSharedService } from '../../../../shared/bot-shared.service';
import { StateService } from '../../../../core-nlp/state.service';
import { BotConfigurationService } from '../../../../core/bot-configuration.service';
import { RestService } from '../../../../core-nlp/rest/rest.service';
import {
AnnotationReason,
AnnotationReasons,
AnnotationState,
AnnotationStates
} from '../../../../shared/components/annotation/annotations';
import { SortOrder, SortOrders } from '../../../../shared/model/misc';

interface DialogListFiltersForm {
exactMatch: FormControl<boolean>;
Expand All @@ -19,6 +26,15 @@ interface DialogListFiltersForm {
configuration?: FormControl<string>;
intentsToHide?: FormControl<string[]>;
isGenAiRagDialog?: FormControl<boolean>;
dialogSort?: FormControl<SortOrder>;
dialogCreationDateFrom?: FormControl<Date>;
dialogCreationDateTo?: FormControl<Date>;
withAnnotations?: FormControl<boolean>;
annotationStates?: FormControl<AnnotationState[]>;
annotationReasons?: FormControl<AnnotationReason[]>;
annotationSort?: FormControl<SortOrder>;
annotationCreationDateFrom?: FormControl<Date>;
annotationCreationDateTo?: FormControl<Date>;
}

export type DialogListFilters = ExtractFormControlTyping<DialogListFiltersForm>;
Expand All @@ -35,6 +51,10 @@ export class DialogsListFiltersComponent implements OnInit {
connectorTypes: ConnectorType[] = [];
configurationNameList: { label: string; applicationId: string }[];

annotationStates = AnnotationStates;
annotationReasons = AnnotationReasons;
sortOrders = SortOrders;

@Input() initialFilters: Partial<DialogListFilters>;
@Output() onFilter = new EventEmitter<Partial<DialogListFilters>>();

Expand Down Expand Up @@ -74,7 +94,16 @@ export class DialogsListFiltersComponent implements OnInit {
ratings: new FormControl(),
configuration: new FormControl(),
intentsToHide: new FormControl([]),
isGenAiRagDialog: new FormControl()
isGenAiRagDialog: new FormControl(),
dialogSort: new FormControl(),
dialogCreationDateFrom: new FormControl(),
dialogCreationDateTo: new FormControl(),
withAnnotations: new FormControl(),
annotationStates: new FormControl([]),
annotationReasons: new FormControl([]),
annotationSort: new FormControl(),
annotationCreationDateFrom: new FormControl(),
annotationCreationDateTo: new FormControl()
});

getFormControl(formControlName: string): FormControl {
Expand Down
Loading