Skip to content

Commit 197a7a8

Browse files
rkufferassouktim
andauthored
[Tock studio] Bot and Nlp modules merge (theopenconversationkit#1700)
* Front Bot and Nlp modules merged * Deleting an unnecessary comment * [DERCBOT-1099] Remove NLP Module * Updates, fixes and cleaning after fusion (wip) * Updates, fixes and cleaning after fusion (wip) * Updates, fixes and cleaning after fusion (wip) * Updates, fixes and cleaning after fusion * Removal of Docker doc that should not appear in this repo * Fix dark mode text colors * Modules and components refacto * Shared components reorg --------- Co-authored-by: Mohamed ASSOUKTI <mohamed.assoukti@partnre.com>
1 parent 3b32644 commit 197a7a8

File tree

332 files changed

+740
-28630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+740
-28630
lines changed

bot/admin/web/.gitignore

-20
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@
88
# dependencies
99
/node_modules
1010

11-
# nlp admin folders symbolic links for windows
12-
/src/app/applications
13-
/src/app/archive
14-
/src/app/build
15-
/src/app/core-nlp
16-
/src/app/entities
17-
/src/app/inbox
18-
/src/app/intents
19-
/src/app/logs
20-
/src/app/model
21-
/src/app/nlp-tabs
22-
/src/app/quality-nlp
23-
/src/app/scroll
24-
/src/app/search
25-
/src/app/sentence-analysis
26-
/src/app/sentences-scroll
27-
/src/app/shared-nlp
28-
/src/app/test-nlp
29-
/src/app/try
30-
3111
# IDEs and editors
3212
/.idea
3313
.project

bot/admin/web/Dockerfile

-7
This file was deleted.

bot/admin/web/README.md

+1-98
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,8 @@
22

33
## Local run instructions
44

5-
Since Tock can be used as a Bot platform or a NLP-only platform,
6-
the _Bot Admin_ Web frontent extends the _NLP Admin_ Web frontend.
7-
8-
To build/run the frontend, one can:
9-
10-
- merge NLP sources (from NLP assembly) to a temporary folder
11-
(namely `target/frontend`),
12-
- or set symbolic links to NLP sources.
13-
14-
> For CI/release builds, Maven merges sources to a temporary folder.
15-
16-
### Merge sources to target folder
17-
18-
This is how Maven builds the frontend for deployment.
19-
20-
Use Maven to merge sources to the `target/frontend` temporary folder:
21-
22-
```
23-
mvn generate-resources
24-
cd target/frontend
25-
```
26-
27-
Then run NPM to setup and launch [Angular CLI](https://cli.angular.io/):
28-
29-
```
30-
npm install
31-
npm install -g @angular/cli
32-
ng serve
33-
```
34-
35-
> Don't forget to start the
36-
> [_Bot Admin_ server](https://github.com/theopenconversationkit/tock/blob/master/.idea/runConfigurations/BotAdmin.xml).
37-
38-
### Symlinks alternative
39-
40-
One can alternatively add these symbolic links to merge sources in `src` folder:
41-
42-
> For unix users, in the current directory (bot/admin/web):
43-
44-
```
45-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/applications" src/app/applications
46-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/archive" src/app/archive
47-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/build" src/app/build
48-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/core-nlp" src/app/core-nlp
49-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/entities" src/app/entities
50-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/inbox" src/app/inbox
51-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/intents" src/app/intents
52-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/logs" src/app/logs
53-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/model" src/app/model
54-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/nlp-tabs" src/app/nlp-tabs
55-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/quality-nlp" src/app/quality-nlp
56-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/scroll" src/app/scroll
57-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/search" src/app/search
58-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/sentence-analysis" src/app/sentence-analysis
59-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/sentences-scroll" src/app/sentences-scroll
60-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/shared-nlp" src/app/shared-nlp
61-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/test-nlp" src/app/test-nlp
62-
ln -s "$(pwd)/../../../nlp/admin/web/src/app/try" src/app/try
63-
```
64-
65-
> For Windows users, in the current directory (bot/admin/web):
66-
67-
Use the CMD and not PowerShell to execute these commands
68-
69-
```
70-
mklink /D "src/app/applications" "%cd%/../../../nlp/admin/web/src/app/applications/"
71-
mklink /D "src/app/archive" "%cd%/../../../nlp/admin/web/src/app/archive/"
72-
mklink /D "src/app/build" "%cd%/../../../nlp/admin/web/src/app/build/"
73-
mklink /D "src/app/core-nlp" "%cd%/../../../nlp/admin/web/src/app/core-nlp/"
74-
mklink /D "src/app/entities" "%cd%/../../../nlp/admin/web/src/app/entities/"
75-
mklink /D "src/app/inbox" "%cd%/../../../nlp/admin/web/src/app/inbox/"
76-
mklink /D "src/app/intents" "%cd%/../../../nlp/admin/web/src/app/intents/"
77-
mklink /D "src/app/logs" "%cd%/../../../nlp/admin/web/src/app/logs/"
78-
mklink /D "src/app/model" "%cd%/../../../nlp/admin/web/src/app/model/"
79-
mklink /D "src/app/nlp-tabs" "%cd%/../../../nlp/admin/web/src/app/nlp-tabs/"
80-
mklink /D "src/app/quality-nlp" "%cd%/../../../nlp/admin/web/src/app/quality-nlp/"
81-
mklink /D "src/app/scroll" "%cd%/../../../nlp/admin/web/src/app/scroll/"
82-
mklink /D "src/app/search" "%cd%/../../../nlp/admin/web/src/app/search/"
83-
mklink /D "src/app/sentence-analysis" "%cd%/../../../nlp/admin/web/src/app/sentence-analysis/"
84-
mklink /D "src/app/sentences-scroll" "%cd%/../../../nlp/admin/web/src/app/sentences-scroll/"
85-
mklink /D "src/app/shared-nlp" "%cd%/../../../nlp/admin/web/src/app/shared-nlp/"
86-
mklink /D "src/app/test-nlp" "%cd%/../../../nlp/admin/web/src/app/test-nlp/"
87-
mklink /D "src/app/try" "%cd%/../../../nlp/admin/web/src/app/try/"
88-
```
89-
90-
Then run NPM to setup and launch [Angular CLI](https://cli.angular.io/):
91-
925
```
6+
cd bot/admin/web
937
npm install
948
npm install -g @angular/cli
959
ng serve
@@ -98,17 +12,6 @@ ng serve
9812
> Don't forget to start the
9913
> [_Bot Admin_ server](https://github.com/theopenconversationkit/tock/blob/master/.idea/runConfigurations/BotAdmin.xml).
10014
101-
## Package instructions
102-
103-
To build/package the frontend:
104-
105-
```
106-
mvn install
107-
```
108-
109-
Maven runs NPM / Angular scripts automatically from merged sources folder. They produce the `web`
110-
assembly, ie. the deployable _Bot Admin_ frontend application.
111-
11215
## Troubleshooting
11316

11417
### Windows setup

bot/admin/web/pom.xml

-10
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@
3333
<project.build.frontend.directory>${project.build.directory}/frontend</project.build.frontend.directory>
3434
</properties>
3535

36-
<dependencies>
37-
<dependency>
38-
<groupId>ai.tock</groupId>
39-
<artifactId>tock-nlp-admin-web</artifactId>
40-
<version>${project.version}</version>
41-
<type>zip</type>
42-
<classifier>sources</classifier>
43-
</dependency>
44-
</dependencies>
45-
4636
<build>
4737
<plugins>
4838
<plugin>

bot/admin/web/src/app/analytics/activity/activity.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import { StateService } from 'src/app/core-nlp/state.service';
2020
import { BotConfigurationService } from 'src/app/core/bot-configuration.service';
2121
import { BotApplicationConfiguration, ConnectorType } from 'src/app/core/model/configuration';
2222

23-
import { SelectBotEvent } from '../../shared/select-bot/select-bot.component';
2423
import { AnalyticsService } from '../analytics.service';
2524
import { ChartData } from '../chart/ChartData';
2625
import { DialogFlowRequest } from '../flow/flow';
2726
import { UserAnalyticsPreferences } from '../preferences/UserAnalyticsPreferences';
2827
import { UserAnalyticsQueryResult } from '../users/users';
2928
import { UserFilter } from '../users/users.component';
30-
import {toISOStringWithoutOffset} from "../../shared/utils";
29+
import { toISOStringWithoutOffset } from '../../shared/utils';
30+
import { SelectBotEvent } from '../../shared/components';
3131

3232
@Component({
3333
selector: 'tock-activity',

bot/admin/web/src/app/analytics/analytics.module.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
1818
import { CommonModule } from '@angular/common';
1919
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
20-
import { SharedModule } from '../shared-nlp/shared.module';
2120
import { AnalyticsTabsComponent } from './analytics-tabs.component';
2221
import { UsersComponent } from './users/users.component';
2322
import { AnalyticsService } from './analytics.service';
2423
import { BotSharedModule } from '../shared/bot-shared.module';
2524
import { BotModule } from '../bot/bot.module';
26-
import { NlpModule } from '../nlp-tabs/nlp.module';
2725
import { MomentModule } from 'ngx-moment';
2826
import { DialogsComponent } from './dialogs/dialogs.component';
2927
import {
@@ -44,9 +42,11 @@ import {
4442
NbUserModule,
4543
NbCalendarRangeModule,
4644
NbDialogModule,
47-
NbRadioModule
45+
NbRadioModule,
46+
NbToggleModule,
47+
NbIconModule
4848
} from '@nebular/theme';
49-
import { ReactiveFormsModule } from '@angular/forms';
49+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5050
import { ChartComponent } from './chart/chart.component';
5151
import { ChartDialogComponent } from './chart-dialog/chart-dialog.component';
5252
import { ActivityComponent } from './activity/activity.component';
@@ -70,13 +70,12 @@ export function importEcharts() {
7070
schemas: [NO_ERRORS_SCHEMA],
7171
imports: [
7272
CommonModule,
73-
SharedModule,
73+
FormsModule,
7474
AnalyticsRoutingModule,
7575
InfiniteScrollModule,
7676
MomentModule,
7777
BotSharedModule,
7878
BotModule,
79-
NlpModule,
8079
NbRouteTabsetModule,
8180
NbCheckboxModule,
8281
NbCardModule,
@@ -96,6 +95,8 @@ export function importEcharts() {
9695
NbCalendarRangeModule,
9796
NbDialogModule.forRoot(),
9897
NbRadioModule,
98+
NbToggleModule,
99+
NbIconModule,
99100
NgxEchartsModule.forRoot({
100101
echarts: importEcharts
101102
}),

bot/admin/web/src/app/analytics/behavior/behavior.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import { StateService } from 'src/app/core-nlp/state.service';
2020
import { BotConfigurationService } from 'src/app/core/bot-configuration.service';
2121
import { BotApplicationConfiguration, ConnectorType } from 'src/app/core/model/configuration';
2222

23-
import { SelectBotEvent } from '../../shared/select-bot/select-bot.component';
2423
import { AnalyticsService } from '../analytics.service';
2524
import { DialogFlowRequest } from '../flow/flow';
2625
import { UserAnalyticsPreferences } from '../preferences/UserAnalyticsPreferences';
2726
import { UserAnalyticsQueryResult } from '../users/users';
2827
import { UserFilter } from '../users/users.component';
29-
import {toISOStringWithoutOffset} from "../../shared/utils";
28+
import { toISOStringWithoutOffset } from '../../shared/utils';
29+
import { SelectBotEvent } from '../../shared/components';
3030

3131
@Component({
3232
selector: 'tock-behavior',

bot/admin/web/src/app/analytics/dialogs/dialogs-list/dialogs-list.component.html

-8
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,6 @@ <h1 *ngIf="total === 0">
158158
</tock-chat-ui>
159159
</nb-card-body>
160160
</nb-card>
161-
162-
<!-- <tock-display-dialog
163-
[dialog]="dialog"
164-
[intentsToHide]="filter.intentsToHide"
165-
>
166-
<div *ngIf="dialog.actions.length === 0">No dialog</div>
167-
</tock-display-dialog> -->
168-
<p></p>
169161
</div>
170162
</div>
171163
</div>

bot/admin/web/src/app/analytics/dialogs/dialogs.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Component, ViewChild } from '@angular/core';
17+
import { AfterViewInit, Component, ViewChild } from '@angular/core';
1818
import { DialogsListComponent } from './dialogs-list/dialogs-list.component';
1919

2020
@Component({
2121
selector: 'tock-dialogs',
2222
templateUrl: './dialogs.component.html',
2323
styleUrls: ['./dialogs.component.css']
2424
})
25-
export class DialogsComponent {
25+
export class DialogsComponent implements AfterViewInit {
2626
@ViewChild('dialogsList') dialogsList: DialogsListComponent;
2727

2828
count: string = '';

bot/admin/web/src/app/analytics/flow/flow.component.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import { Component, OnDestroy, OnInit } from '@angular/core';
1818
import { BotService } from '../../bot/bot-service';
1919
import { AnalyticsService } from '../analytics.service';
20-
import { NlpService } from '../../nlp-tabs/nlp.service';
2120
import { StateService } from '../../core-nlp/state.service';
2221
import {
2322
ApplicationDialogFlow,
@@ -30,13 +29,13 @@ import { BotConfigurationService } from '../../core/bot-configuration.service';
3029
import { entityColor } from '../../model/nlp';
3130
import { KeyValue } from '@angular/common';
3231
import { NodeTransition, NodeTypeFilter, NodeTypeFilters, StoryNode } from './node';
33-
import { SelectBotEvent } from '../../shared/select-bot/select-bot.component';
3432
import { AnswerConfigurationType, StoryDefinitionConfiguration, StorySearchQuery, StoryStep } from '../../bot/model/story';
3533
import { Subscription } from 'rxjs';
3634
import { NbToastrService } from '@nebular/theme';
3735
import { ChartData } from '../chart/ChartData';
3836
import { toISOStringWithoutOffset } from '../../shared/utils';
3937
import { ChartType } from 'angular-google-charts';
38+
import { SelectBotEvent } from '../../shared/components';
4039

4140
@Component({
4241
selector: 'tock-flow',
@@ -182,7 +181,6 @@ export class FlowComponent implements OnInit, OnDestroy {
182181
};
183182

184183
constructor(
185-
private nlp: NlpService,
186184
public state: StateService,
187185
private analytics: AnalyticsService,
188186
private bot: BotService,

bot/admin/web/src/app/analytics/satisfaction/satisfaction-details/satisfaction-details.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { Component, OnInit, ViewChild } from '@angular/core';
16+
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
1717
import { AnalyticsService } from '../../analytics.service';
1818
import { RatingReportQueryResult } from './RatingReportQueryResult';
1919
import { DialogsListComponent } from '../../dialogs/dialogs-list/dialogs-list.component';
@@ -23,7 +23,7 @@ import { DialogsListComponent } from '../../dialogs/dialogs-list/dialogs-list.co
2323
templateUrl: './satisfaction-details.component.html',
2424
styleUrls: ['./satisfaction-details.component.css']
2525
})
26-
export class SatisfactionDetailsComponent implements OnInit {
26+
export class SatisfactionDetailsComponent implements OnInit, AfterViewInit {
2727
loading = false;
2828

2929
count: string = '';

nlp/admin/web/src/app/applications/applications.module.ts bot/admin/web/src/app/applications/applications.module.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { SharedModule } from '../shared-nlp/shared.module';
1817
import { CommonModule } from '@angular/common';
1918
import { Injectable, NgModule } from '@angular/core';
2019
import { ApplicationsComponent } from './applications/applications.component';
@@ -30,11 +29,14 @@ import {
3029
NbCardModule,
3130
NbCheckboxModule,
3231
NbDialogModule,
32+
NbIconModule,
33+
NbInputModule,
3334
NbRadioModule,
3435
NbRouteTabsetModule,
3536
NbSelectModule,
3637
NbSpinnerModule,
3738
NbTabsetModule,
39+
NbToggleModule,
3840
NbTooltipModule
3941
} from '@nebular/theme';
4042
import { UserLogsComponent } from './user/user-logs.component';
@@ -48,6 +50,7 @@ import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
4850
import { CreateNamespaceComponent } from './namespace/create-namespace/create-namespace.component';
4951
import { ApplicationsRoutingModule } from './applications-routing.module';
5052
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
53+
import { BotSharedModule } from '../shared/bot-shared.module';
5154

5255
@Injectable()
5356
export class NlpApplicationConfig implements ApplicationConfig {
@@ -60,7 +63,7 @@ export class NlpApplicationConfig implements ApplicationConfig {
6063
@NgModule({
6164
imports: [
6265
CommonModule,
63-
SharedModule,
66+
BotSharedModule,
6467
MomentModule,
6568
ApplicationsRoutingModule,
6669
NbTabsetModule,
@@ -76,6 +79,9 @@ export class NlpApplicationConfig implements ApplicationConfig {
7679
NbAccordionModule,
7780
NbSpinnerModule,
7881
NbRadioModule,
82+
NbIconModule,
83+
NbToggleModule,
84+
NbInputModule,
7985
NgJsonEditorModule,
8086
NbDialogModule.forRoot(),
8187
NgbPaginationModule,

0 commit comments

Comments
 (0)