Skip to content

Commit

Permalink
Connexion Webchat - RASA en local ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlaine committed Jan 25, 2024
1 parent 7968ddf commit c38c789
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1 #this installs node and npm for us
with:
node-version: '10.x'
node-version: '18.x'

- uses: actions/cache@v1 # this allows for re-using node_modules caching, making builds a bit faster.
with:
Expand All @@ -19,5 +19,5 @@ jobs:
${{ runner.os }}-node-
- run: yarn install #TODO: --only-prod, le build crash à voir pq
- run: yarn install -g @angular/cli > /dev/null
- run: yarn global add @angular/cli > /dev/null
- run: yarn build:prod
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve",
"start:local": "ng serve --proxy-config proxy.local.conf.json",
"start:local webchat": "ng serve --proxy-config proxy.local.conf.json --project=webchat",
"start:dev": "ng serve --proxy-config proxy.dev.conf.json",
"start:dev webchat": "ng serve --proxy-config proxy.dev.conf.json --project=webchat",
"start:test": "ng serve --proxy-config proxy.test.conf.json",
Expand Down Expand Up @@ -46,7 +47,7 @@
"ngx-panzoom": "^15.0.0",
"ngx-toastr": "^16.0.2",
"rxjs": "~6.6.7",
"socket.io-client": "^4.1.2",
"socket.io-client": "^4.6.2",
"tslib": "^2.3.0",
"uglify-js-es6": "^2.8.9",
"web-animations-js": "^2.3.2",
Expand Down
2 changes: 1 addition & 1 deletion projects/webchat/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="chatbot" *ngIf="configService.config && !configService.config.maintenanceMode">
<app-chat-widget [socketUrl]="chatbotUrl"
<app-chat-widget [socketUrl]="chatbotSocket"
[botAvatar]="chatbotUrl + '/media/' + configService.config.icon"
[companyLogo]="configService.config.embeddedIcon ? chatbotUrl + '/media/' + configService.config.embeddedIcon : null"
[botName]="configService.config.name"
Expand Down
2 changes: 2 additions & 0 deletions projects/webchat/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import { environment } from '../environments/environment';
export class AppComponent implements OnInit {

public chatbotUrl;
public chatbotSocket;

constructor(@Inject(Window) public window: Window,
public configService: ConfigService,
private _titleService: Title) {
this.chatbotUrl = environment.chatbotUrl;
this.chatbotSocket = environment.chatbotSocket ? environment.chatbotSocket : environment.chatbotUrl;
this.configService.init(this.chatbotUrl);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
import { FormBuilder, Validators } from '@angular/forms';
import { WebchatService } from '../core/services/webchat.service';

@Component({
selector: 'app-chat-feedback-modal',
Expand All @@ -14,8 +13,7 @@ export class ChatFeedbackModalComponent implements OnInit {

constructor(public dialogRef: MatDialogRef<ChatFeedbackModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private _fb: FormBuilder,
private _webchatService: WebchatService) { }
private _fb: FormBuilder) { }

ngOnInit(): void {
}
Expand Down
3 changes: 2 additions & 1 deletion projects/webchat/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
export const environment = {
production: false,
chatbotUrl: window.location.origin,
socketUrl: '/socket-chatbot/'
chatbotSocket: 'http://localhost:5005',
socketUrl: '/socket.io/'
};

/*
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9227,10 +9227,10 @@ socket.io-adapter@~2.5.2:
dependencies:
ws "~8.11.0"

socket.io-client@^4.1.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.2.tgz#f2f13f68058bd4e40f94f2a1541f275157ff2c08"
integrity sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==
socket.io-client@^4.6.2:
version "4.7.4"
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.4.tgz#5f0e060ff34ac0a4b4c5abaaa88e0d1d928c64c8"
integrity sha512-wh+OkeF0rAVCrABWQBaEjLfb7DVPotMbu0cgWgyR0v6eA4EoVnAwcIeIbcdTE3GT/H3kbdLl7OoH2+asoDRIIg==
dependencies:
"@socket.io/component-emitter" "~3.1.0"
debug "~4.3.2"
Expand Down

0 comments on commit c38c789

Please sign in to comment.