aril 1.1.74 → 1.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/theme/layout/app/layout/app.layout.component.mjs +3 -5
- package/esm2022/ui/lib/src/input/input-error-message.pipe.mjs +7 -1
- package/esm2022/ui/table/src/table.component.mjs +18 -9
- package/esm2022/ui-business/notification-templates-dialog/src/notification-templates-dialog.component.mjs +2 -2
- package/esm2022/util/lib/index.mjs +2 -1
- package/esm2022/util/lib/src/validators/identity.validator.mjs +91 -0
- package/esm2022/util/lib/src/validators/index.mjs +2 -1
- package/esm2022/util/lib/src/validators/validators.mjs +17 -2
- package/fesm2022/aril-theme-layout.mjs +15 -139
- package/fesm2022/aril-theme-layout.mjs.map +1 -1
- package/fesm2022/aril-ui-business-notification-templates-dialog.mjs +1 -1
- package/fesm2022/aril-ui-business-notification-templates-dialog.mjs.map +1 -1
- package/fesm2022/aril-ui-lib.mjs +6 -0
- package/fesm2022/aril-ui-lib.mjs.map +1 -1
- package/fesm2022/aril-ui-table.mjs +16 -7
- package/fesm2022/aril-ui-table.mjs.map +1 -1
- package/fesm2022/aril-util-lib.mjs +107 -1
- package/fesm2022/aril-util-lib.mjs.map +1 -1
- package/package.json +137 -137
- package/theme/layout/app/layout/app.layout.component.html +0 -1
- package/theme/layout/app/layout/app.layout.component.ts +0 -2
- package/theme/styles/layout/_breadcrumb.scss +1 -1
- package/theme/styles/theme/base/components/panel/_tabview.scss +1 -1
- package/ui/table/src/table.component.d.ts +4 -3
- package/util/lib/index.d.ts +1 -0
- package/util/lib/src/validators/identity.validator.d.ts +33 -0
- package/util/lib/src/validators/index.d.ts +1 -0
- package/util/lib/src/validators/validators.d.ts +5 -0
- package/esm2022/theme/layout/app/chatbot/app.chatbot.component.mjs +0 -140
- package/theme/layout/app/chatbot/app.chatbot.component.d.ts +0 -35
- package/theme/layout/app/chatbot/app.chatbot.component.html +0 -108
- package/theme/layout/app/chatbot/app.chatbot.component.scss +0 -35
- package/theme/layout/app/chatbot/app.chatbot.component.ts +0 -151
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @angular-eslint/component-selector */
|
|
2
|
-
import { HttpClient } from '@angular/common/http';
|
|
3
|
-
import { Component } from '@angular/core';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
5
|
-
|
|
6
|
-
import { ButtonModule } from 'primeng/button';
|
|
7
|
-
import { IconFieldModule } from 'primeng/iconfield';
|
|
8
|
-
import { InputIconModule } from 'primeng/inputicon';
|
|
9
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
10
|
-
import { MessagesModule } from 'primeng/messages';
|
|
11
|
-
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
12
|
-
import { RatingModule } from 'primeng/rating';
|
|
13
|
-
import { SidebarModule } from 'primeng/sidebar';
|
|
14
|
-
|
|
15
|
-
import { KeycloakService } from 'keycloak-angular';
|
|
16
|
-
import { BehaviorSubject, firstValueFrom } from 'rxjs';
|
|
17
|
-
|
|
18
|
-
import { API_CONFIGS } from 'aril/boot/config/api';
|
|
19
|
-
import { ButtonComponent } from 'aril/ui/button';
|
|
20
|
-
import { TextAreaComponent } from 'aril/ui/textArea';
|
|
21
|
-
|
|
22
|
-
@Component({
|
|
23
|
-
standalone: true,
|
|
24
|
-
selector: 'app-chatbot',
|
|
25
|
-
imports: [
|
|
26
|
-
ButtonModule,
|
|
27
|
-
SidebarModule,
|
|
28
|
-
RadioButtonModule,
|
|
29
|
-
FormsModule,
|
|
30
|
-
InputIconModule,
|
|
31
|
-
IconFieldModule,
|
|
32
|
-
InputTextModule,
|
|
33
|
-
MessagesModule,
|
|
34
|
-
TextAreaComponent,
|
|
35
|
-
RatingModule,
|
|
36
|
-
ButtonComponent
|
|
37
|
-
],
|
|
38
|
-
templateUrl: './app.chatbot.component.html',
|
|
39
|
-
styleUrl: './app.chatbot.component.scss'
|
|
40
|
-
})
|
|
41
|
-
export class AppChatbotComponent {
|
|
42
|
-
chatbotVisible = false;
|
|
43
|
-
projectName!: string;
|
|
44
|
-
questionQuery!: string;
|
|
45
|
-
queryList: BehaviorSubject<any[]> = new BehaviorSubject<any[]>([]);
|
|
46
|
-
error!: string;
|
|
47
|
-
historyList: BehaviorSubject<any[]> = new BehaviorSubject<any[]>([]);
|
|
48
|
-
isTyping = false;
|
|
49
|
-
typingInterval: any;
|
|
50
|
-
typingText = '.';
|
|
51
|
-
username: string;
|
|
52
|
-
visibleGiveFeedback = false;
|
|
53
|
-
feedbackComments = '';
|
|
54
|
-
feedbackRating = 0;
|
|
55
|
-
feedBackResult!: string;
|
|
56
|
-
baseUrl = API_CONFIGS.aiApi;
|
|
57
|
-
|
|
58
|
-
constructor(
|
|
59
|
-
private readonly http: HttpClient,
|
|
60
|
-
private readonly keycloak: KeycloakService
|
|
61
|
-
) {
|
|
62
|
-
this.username = this.keycloak.getUsername();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
sendRequest() {
|
|
66
|
-
this.fetchData();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async getHistory() {
|
|
70
|
-
try {
|
|
71
|
-
await this.http
|
|
72
|
-
.get<any[]>(this.baseUrl + 'history?project=CRM' + '&user_name=' + this.username)
|
|
73
|
-
.subscribe((response) => {
|
|
74
|
-
this.historyList.next(response);
|
|
75
|
-
});
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.log(error);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async fetchData() {
|
|
82
|
-
this.startTyping();
|
|
83
|
-
const request = {
|
|
84
|
-
project: 'CRM',
|
|
85
|
-
user_name: this.username,
|
|
86
|
-
query: this.questionQuery
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
const result = await firstValueFrom(this.http.post<any>(this.baseUrl + 'chat', request));
|
|
91
|
-
if (result && result.answer) {
|
|
92
|
-
this.queryList.next([...this.queryList.value, { question: this.questionQuery, answer: result.answer }]);
|
|
93
|
-
}
|
|
94
|
-
} catch (error: any) {
|
|
95
|
-
this.error = error;
|
|
96
|
-
} finally {
|
|
97
|
-
this.questionQuery = '';
|
|
98
|
-
this.stopTyping();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
onVisible() {
|
|
102
|
-
this.getHistory();
|
|
103
|
-
this.chatbotVisible = true;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
startTyping() {
|
|
107
|
-
this.isTyping = true;
|
|
108
|
-
let dots = 0;
|
|
109
|
-
|
|
110
|
-
this.typingInterval = setInterval(() => {
|
|
111
|
-
dots = (dots + 1) % 4;
|
|
112
|
-
this.typingText = '.'.repeat(dots);
|
|
113
|
-
}, 300);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
stopTyping() {
|
|
117
|
-
clearInterval(this.typingInterval);
|
|
118
|
-
this.isTyping = false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
giveFeedback() {
|
|
122
|
-
this.visibleGiveFeedback = true;
|
|
123
|
-
}
|
|
124
|
-
async sendFeedback() {
|
|
125
|
-
const request = {
|
|
126
|
-
project: 'CRM',
|
|
127
|
-
user_name: this.username,
|
|
128
|
-
rating: this.feedbackRating,
|
|
129
|
-
comments: this.feedbackComments
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
const result = await firstValueFrom(this.http.post<any>(this.baseUrl + 'feedback', request));
|
|
134
|
-
if (result) {
|
|
135
|
-
this.feedBackResult = result.message;
|
|
136
|
-
}
|
|
137
|
-
} catch (error: any) {
|
|
138
|
-
this.error = error;
|
|
139
|
-
} finally {
|
|
140
|
-
this.visibleGiveFeedback = false;
|
|
141
|
-
this.feedbackComments = '';
|
|
142
|
-
this.feedbackRating = 0;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
cancelFeedback() {
|
|
147
|
-
this.visibleGiveFeedback = false;
|
|
148
|
-
this.feedbackComments = '';
|
|
149
|
-
this.feedbackRating = 0;
|
|
150
|
-
}
|
|
151
|
-
}
|