mirror of
https://github.com/kuhyx/ARAI.git
synced 2026-07-04 15:43:12 +02:00
chore: first input
This commit is contained in:
parent
1f0f14d6ef
commit
9e78430d5b
16
arai-frontend/.editorconfig
Normal file
16
arai-frontend/.editorconfig
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Editor configuration, see https://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.ts]
|
||||||
|
quote_type = single
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
42
arai-frontend/.gitignore
vendored
Normal file
42
arai-frontend/.gitignore
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# Compiled output
|
||||||
|
/dist
|
||||||
|
/tmp
|
||||||
|
/out-tsc
|
||||||
|
/bazel-out
|
||||||
|
|
||||||
|
# Node
|
||||||
|
/node_modules
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
.idea/
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.c9/
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
|
# Visual Studio Code
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.history/*
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
/.angular/cache
|
||||||
|
.sass-cache/
|
||||||
|
/connect.lock
|
||||||
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
|
testem.log
|
||||||
|
/typings
|
||||||
|
|
||||||
|
# System files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
27
arai-frontend/README.md
Normal file
27
arai-frontend/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# AraiFrontend
|
||||||
|
|
||||||
|
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.3.
|
||||||
|
|
||||||
|
## Development server
|
||||||
|
|
||||||
|
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
||||||
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
||||||
108
arai-frontend/angular.json
Normal file
108
arai-frontend/angular.json
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"arai-frontend": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"style": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:application",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/arai-frontend",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"browser": "src/main.ts",
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"@angular/material/prebuilt-themes/indigo-pink.css",
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": [],
|
||||||
|
"server": "src/main.server.ts",
|
||||||
|
"prerender": true,
|
||||||
|
"ssr": {
|
||||||
|
"entry": "server.ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kb",
|
||||||
|
"maximumError": "1mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kb",
|
||||||
|
"maximumError": "4kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"optimization": false,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "arai-frontend:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "arai-frontend:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"buildTarget": "arai-frontend:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js",
|
||||||
|
"zone.js/testing"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"@angular/material/prebuilt-themes/indigo-pink.css",
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
49
arai-frontend/package.json
Normal file
49
arai-frontend/package.json
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "arai-frontend",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"test": "ng test",
|
||||||
|
"serve:ssr:arai-frontend": "node dist/arai-frontend/server/server.mjs"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^17.0.0",
|
||||||
|
"@angular/cdk": "^17.2.2",
|
||||||
|
"@angular/common": "^17.0.0",
|
||||||
|
"@angular/compiler": "^17.0.0",
|
||||||
|
"@angular/core": "^17.0.0",
|
||||||
|
"@angular/forms": "^17.0.0",
|
||||||
|
"@angular/material": "^17.2.2",
|
||||||
|
"@angular/platform-browser": "^17.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "^17.0.0",
|
||||||
|
"@angular/platform-server": "^17.0.0",
|
||||||
|
"@angular/router": "^17.0.0",
|
||||||
|
"@angular/ssr": "^17.0.3",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"rxjs": "~7.8.0",
|
||||||
|
"socket.io-client": "^4.7.4",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"uuid": "^9.0.1",
|
||||||
|
"zone.js": "~0.14.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "^17.0.3",
|
||||||
|
"@angular/cli": "^17.0.3",
|
||||||
|
"@angular/compiler-cli": "^17.0.0",
|
||||||
|
"@types/express": "^4.17.17",
|
||||||
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"@types/node": "^18.18.0",
|
||||||
|
"@types/uuid": "^9.0.8",
|
||||||
|
"jasmine-core": "~5.1.0",
|
||||||
|
"karma": "~6.4.0",
|
||||||
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.1.0",
|
||||||
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
|
"typescript": "~5.2.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
7252
arai-frontend/pnpm-lock.yaml
Normal file
7252
arai-frontend/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
56
arai-frontend/server.ts
Normal file
56
arai-frontend/server.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
import { CommonEngine } from '@angular/ssr';
|
||||||
|
import express from 'express';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { dirname, join, resolve } from 'node:path';
|
||||||
|
import bootstrap from './src/main.server';
|
||||||
|
|
||||||
|
// The Express app is exported so that it can be used by serverless Functions.
|
||||||
|
export function app(): express.Express {
|
||||||
|
const server = express();
|
||||||
|
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
|
||||||
|
const browserDistFolder = resolve(serverDistFolder, '../browser');
|
||||||
|
const indexHtml = join(serverDistFolder, 'index.server.html');
|
||||||
|
|
||||||
|
const commonEngine = new CommonEngine();
|
||||||
|
|
||||||
|
server.set('view engine', 'html');
|
||||||
|
server.set('views', browserDistFolder);
|
||||||
|
|
||||||
|
// Example Express Rest API endpoints
|
||||||
|
// server.get('/api/**', (req, res) => { });
|
||||||
|
// Serve static files from /browser
|
||||||
|
server.get('*.*', express.static(browserDistFolder, {
|
||||||
|
maxAge: '1y'
|
||||||
|
}));
|
||||||
|
|
||||||
|
// All regular routes use the Angular engine
|
||||||
|
server.get('*', (req, res, next) => {
|
||||||
|
const { protocol, originalUrl, baseUrl, headers } = req;
|
||||||
|
|
||||||
|
commonEngine
|
||||||
|
.render({
|
||||||
|
bootstrap,
|
||||||
|
documentFilePath: indexHtml,
|
||||||
|
url: `${protocol}://${headers.host}${originalUrl}`,
|
||||||
|
publicPath: browserDistFolder,
|
||||||
|
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
||||||
|
})
|
||||||
|
.then((html) => res.send(html))
|
||||||
|
.catch((err) => next(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
|
||||||
|
function run(): void {
|
||||||
|
const port = process.env['PORT'] || 4000;
|
||||||
|
|
||||||
|
// Start up the Node server
|
||||||
|
const server = app();
|
||||||
|
server.listen(port, () => {
|
||||||
|
console.log(`Node Express server listening on http://localhost:${port}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
1
arai-frontend/src/app/app.component.html
Normal file
1
arai-frontend/src/app/app.component.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<app-case-input> </app-case-input>
|
||||||
0
arai-frontend/src/app/app.component.scss
Normal file
0
arai-frontend/src/app/app.component.scss
Normal file
29
arai-frontend/src/app/app.component.spec.ts
Normal file
29
arai-frontend/src/app/app.component.spec.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [AppComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should have the 'arai-frontend' title`, () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app.title).toEqual('arai-frontend');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
|
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, arai-frontend');
|
||||||
|
});
|
||||||
|
});
|
||||||
14
arai-frontend/src/app/app.component.ts
Normal file
14
arai-frontend/src/app/app.component.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
standalone: true,
|
||||||
|
imports: [CommonModule, RouterOutlet],
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrl: './app.component.scss'
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
title = 'arai-frontend';
|
||||||
|
}
|
||||||
11
arai-frontend/src/app/app.config.server.ts
Normal file
11
arai-frontend/src/app/app.config.server.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
||||||
|
import { provideServerRendering } from '@angular/platform-server';
|
||||||
|
import { appConfig } from './app.config';
|
||||||
|
|
||||||
|
const serverConfig: ApplicationConfig = {
|
||||||
|
providers: [
|
||||||
|
provideServerRendering()
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export const config = mergeApplicationConfig(appConfig, serverConfig);
|
||||||
10
arai-frontend/src/app/app.config.ts
Normal file
10
arai-frontend/src/app/app.config.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { ApplicationConfig } from '@angular/core';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
|
import { routes } from './app.routes';
|
||||||
|
import { provideClientHydration } from '@angular/platform-browser';
|
||||||
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||||
|
|
||||||
|
export const appConfig: ApplicationConfig = {
|
||||||
|
providers: [provideRouter(routes), provideClientHydration(), provideAnimationsAsync()]
|
||||||
|
};
|
||||||
3
arai-frontend/src/app/app.routes.ts
Normal file
3
arai-frontend/src/app/app.routes.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
export const routes: Routes = [];
|
||||||
16
arai-frontend/src/app/backend.service.spec.ts
Normal file
16
arai-frontend/src/app/backend.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { BackendService } from './backend.service';
|
||||||
|
|
||||||
|
describe('BackendService', () => {
|
||||||
|
let service: BackendService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(BackendService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
55
arai-frontend/src/app/backend.service.ts
Normal file
55
arai-frontend/src/app/backend.service.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { EventEmitter, Injectable } from '@angular/core';
|
||||||
|
import { io, Socket } from 'socket.io-client';
|
||||||
|
import { GenericRequest, GenericResponse, RecommendedMediatorsResponse, StatisticsOutputResponse, UserInput, UserInputRequest } from './requests-responses';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class BackendService {
|
||||||
|
address = "localhost:1227";
|
||||||
|
|
||||||
|
public genericResponsesArray: GenericResponse[] = [];
|
||||||
|
public userInputArray: UserInputRequest[] = [];
|
||||||
|
public recommendedMediatorsResponsesArray: RecommendedMediatorsResponse[] = [];
|
||||||
|
public recommendedMediatorsResponsesArrayEvent = new EventEmitter<RecommendedMediatorsResponse>();
|
||||||
|
public statisticsOutputResponseArray: StatisticsOutputResponse[] = [];
|
||||||
|
public statisticsOutputResponseArrayEvent = new EventEmitter<StatisticsOutputResponse>();
|
||||||
|
|
||||||
|
|
||||||
|
private socket: Socket = io(`http://${this.address}`);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private filterMessages(message: GenericResponse) {
|
||||||
|
this.genericResponsesArray.push(message);
|
||||||
|
if(message.response_type === "recommended_mediators") {
|
||||||
|
this.recommendedMediatorsResponsesArray.push(message as RecommendedMediatorsResponse);
|
||||||
|
this.recommendedMediatorsResponsesArrayEvent.next(message as RecommendedMediatorsResponse);
|
||||||
|
}
|
||||||
|
if(message.response_type === "statistics_output") {
|
||||||
|
this.statisticsOutputResponseArray.push(message as StatisticsOutputResponse);
|
||||||
|
this.statisticsOutputResponseArrayEvent.next(message as StatisticsOutputResponse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private connect(): void {
|
||||||
|
this.socket = io(`http://${this.address}`);
|
||||||
|
this.socket.on('connect', () => {
|
||||||
|
console.log('Connected to WebSocket server');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listen for messages
|
||||||
|
this.socket.on('message', (message: GenericResponse) => {
|
||||||
|
this.filterMessages(message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMessage(message: GenericRequest): void {
|
||||||
|
if(message.request_type === "user_input") {
|
||||||
|
this.userInputArray.push(message as UserInput);
|
||||||
|
}
|
||||||
|
this.socket.emit('message', message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<p>case-input works!</p>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { CaseInputComponent } from './case-input.component';
|
||||||
|
|
||||||
|
describe('CaseInputComponent', () => {
|
||||||
|
let component: CaseInputComponent;
|
||||||
|
let fixture: ComponentFixture<CaseInputComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [CaseInputComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(CaseInputComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
23
arai-frontend/src/app/case-input/case-input.component.ts
Normal file
23
arai-frontend/src/app/case-input/case-input.component.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { MatInputModule } from '@angular/material/input'
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { MatCheckboxModule } from '@angular/material/checkbox'
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-case-input',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
// other modules
|
||||||
|
MatInputModule,
|
||||||
|
MatCheckboxModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
],
|
||||||
|
templateUrl: './case-input.component.html',
|
||||||
|
styleUrl: './case-input.component.scss'
|
||||||
|
})
|
||||||
|
export class CaseInputComponent {
|
||||||
|
|
||||||
|
}
|
||||||
1
arai-frontend/src/app/cost-view/cost-view.component.html
Normal file
1
arai-frontend/src/app/cost-view/cost-view.component.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<p>cost-view works!</p>
|
||||||
23
arai-frontend/src/app/cost-view/cost-view.component.spec.ts
Normal file
23
arai-frontend/src/app/cost-view/cost-view.component.spec.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { CostViewComponent } from './cost-view.component';
|
||||||
|
|
||||||
|
describe('CostViewComponent', () => {
|
||||||
|
let component: CostViewComponent;
|
||||||
|
let fixture: ComponentFixture<CostViewComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [CostViewComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(CostViewComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
12
arai-frontend/src/app/cost-view/cost-view.component.ts
Normal file
12
arai-frontend/src/app/cost-view/cost-view.component.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-cost-view',
|
||||||
|
standalone: true,
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './cost-view.component.html',
|
||||||
|
styleUrl: './cost-view.component.scss'
|
||||||
|
})
|
||||||
|
export class CostViewComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<p>mediators-list works!</p>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { MediatorsListComponent } from './mediators-list.component';
|
||||||
|
|
||||||
|
describe('MediatorsListComponent', () => {
|
||||||
|
let component: MediatorsListComponent;
|
||||||
|
let fixture: ComponentFixture<MediatorsListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [MediatorsListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(MediatorsListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-mediators-list',
|
||||||
|
standalone: true,
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './mediators-list.component.html',
|
||||||
|
styleUrl: './mediators-list.component.scss'
|
||||||
|
})
|
||||||
|
export class MediatorsListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
7
arai-frontend/src/app/requests-responses.spec.ts
Normal file
7
arai-frontend/src/app/requests-responses.spec.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { RequestsResponses } from './requests-responses';
|
||||||
|
|
||||||
|
describe('RequestsResponses', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new RequestsResponses()).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
78
arai-frontend/src/app/requests-responses.ts
Normal file
78
arai-frontend/src/app/requests-responses.ts
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
export enum REQUESTS_TYPES {
|
||||||
|
"user_input" = 0,
|
||||||
|
"registering_mediator" = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RESPONSE_TYPES {
|
||||||
|
"statistics_output" = 0,
|
||||||
|
"recommended_mediators" = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GenericRequest {
|
||||||
|
readonly "request_type": string;
|
||||||
|
readonly "request_data": unknown;
|
||||||
|
constructor(setType: string, setData: unknown) {
|
||||||
|
this.request_type = setType;
|
||||||
|
this.request_data = setData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface userInput {
|
||||||
|
"generic_input": string,
|
||||||
|
"trial_value": number,
|
||||||
|
"location": string,
|
||||||
|
"experts_called": boolean,
|
||||||
|
"witnesses_called": boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UserInputRequest extends GenericRequest {
|
||||||
|
override "request_type" = "user_input";
|
||||||
|
override "request_data": userInput
|
||||||
|
|
||||||
|
constructor(setRequest: userInput) {
|
||||||
|
super("user_input", setRequest);
|
||||||
|
this.request_data = setRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GenericResponse {
|
||||||
|
readonly "response_type": string;
|
||||||
|
readonly "response_data": unknown;
|
||||||
|
constructor(setType: string, setData: unknown) {
|
||||||
|
this.response_type = setType;
|
||||||
|
this.response_data = setData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RecommendedMediatorsInterface {
|
||||||
|
"name": string,
|
||||||
|
"specialization": string,
|
||||||
|
"localization": string,
|
||||||
|
"score": number,
|
||||||
|
"number_of_opinions": number
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RecommendedMediatorsResponse extends GenericResponse {
|
||||||
|
override "response_type" = "recommended_mediators";
|
||||||
|
override "response_data": RecommendedMediatorsInterface;
|
||||||
|
|
||||||
|
constructor(setResponseData: RecommendedMediatorsInterface) {
|
||||||
|
super("recommended_mediators", setResponseData);
|
||||||
|
this.response_data = setResponseData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StatisticsOutputInterface {
|
||||||
|
"cost_of_trial": number,
|
||||||
|
"time_of_trial": number
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StatisticsOutputResponse extends GenericResponse {
|
||||||
|
override "response_type" = "statistics_output";
|
||||||
|
override "response_data": StatisticsOutputInterface;
|
||||||
|
|
||||||
|
constructor(setResponseData: StatisticsOutputInterface) {
|
||||||
|
super("statistics_output", setResponseData);
|
||||||
|
this.response_data = setResponseData;
|
||||||
|
}
|
||||||
|
}
|
||||||
0
arai-frontend/src/assets/.gitkeep
Normal file
0
arai-frontend/src/assets/.gitkeep
Normal file
BIN
arai-frontend/src/favicon.ico
Normal file
BIN
arai-frontend/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
15
arai-frontend/src/index.html
Normal file
15
arai-frontend/src/index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>AraiFrontend</title>
|
||||||
|
<base href="/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body class="mat-typography">
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
arai-frontend/src/main.server.ts
Normal file
7
arai-frontend/src/main.server.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { AppComponent } from './app/app.component';
|
||||||
|
import { config } from './app/app.config.server';
|
||||||
|
|
||||||
|
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
||||||
|
|
||||||
|
export default bootstrap;
|
||||||
6
arai-frontend/src/main.ts
Normal file
6
arai-frontend/src/main.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { appConfig } from './app/app.config';
|
||||||
|
import { AppComponent } from './app/app.component';
|
||||||
|
|
||||||
|
bootstrapApplication(AppComponent, appConfig)
|
||||||
|
.catch((err) => console.error(err));
|
||||||
4
arai-frontend/src/styles.scss
Normal file
4
arai-frontend/src/styles.scss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
|
||||||
|
html, body { height: 100%; }
|
||||||
|
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
|
||||||
18
arai-frontend/tsconfig.app.json
Normal file
18
arai-frontend/tsconfig.app.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/app",
|
||||||
|
"types": [
|
||||||
|
"node"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/main.ts",
|
||||||
|
"src/main.server.ts",
|
||||||
|
"server.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
32
arai-frontend/tsconfig.json
Normal file
32
arai-frontend/tsconfig.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist/out-tsc",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": false,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"dom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
14
arai-frontend/tsconfig.spec.json
Normal file
14
arai-frontend/tsconfig.spec.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user