Skip to content

Commit

Permalink
Merge branch 'zoneless' of https://github.com/FraunhoferIOSB/AASPortal
Browse files Browse the repository at this point in the history
…into zoneless
  • Loading branch information
ralfaron committed Jun 21, 2024
2 parents 2a3552f + 89bcb03 commit d94aaf3
Show file tree
Hide file tree
Showing 14 changed files with 35,459 additions and 35,504 deletions.
70,421 changes: 35,216 additions & 35,205 deletions package-lock.json

Large diffs are not rendered by default.

290 changes: 145 additions & 145 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,146 +1,146 @@
{
"name": "aas-portal-project",
"version": "3.0.0-development.57",
"description": "Web-based visualization and control of asset administration shells.",
"type": "module",
"scripts": {
"tsoa": "npm run tsoa -w aas-server",
"start": "docker build -f Dockerfile -t aasportal . && docker run -d --name AASPortal -p 80:80 --restart=always aasportal",
"header": "node --no-warnings --loader ts-node/esm copyright-header.ts",
"coverage": "node --no-warnings --loader ts-node/esm coverage-summary.ts",
"user-db": "docker run -p 27017:27017 -d --name aasportal-users -e MONGO_INITDB_DATABASE=aasportal-users mongo",
"lint": "npm run lint -ws",
"format": "npm run format -ws",
"test": "npm run test -ws",
"tsc": "npm run tsc -ws",
"build": "npm run build -ws",
"build:debug": "npm run build:debug -ws",
"lib:build": "npm run build -w common -w aas-lib",
"lib:build:debug": "npm run build:debug -w common -w aas-lib",
"aas-portal:build": "npm run build -w common -w aas-lib -w aas-portal",
"aas-portal:build:debug": "npm run build:build -w common -w aas-lib -w aas-portal",
"aas-server:build": "npm run build -w common -w aas-server",
"aas-server:build:debug": "npm run build:debug -w common -w aas-server",
"serve": "npm run build && node --env-file projects/aas-server/.env projects/aas-server/dist/aas-server.js"
},
"repository": {
"type": "git",
"url": "https://github.com/FraunhoferIOSB/AASPortal.git"
},
"author": "Fraunhofer IOSB-INA",
"homepage": "https://www.iosb-ina.fraunhofer.de/",
"license": "Apache-2.0",
"workspaces": [
"projects/fhg-jest",
"projects/common",
"projects/aas-server",
"projects/aas-lib",
"projects/aas-portal"
],
"dependencies": {
"@angular/animations": "^17.3.4",
"@angular/common": "^17.3.4",
"@angular/compiler": "^17.3.4",
"@angular/core": "^17.3.4",
"@angular/forms": "^17.3.4",
"@angular/localize": "^17.3.4",
"@angular/platform-browser": "^17.3.4",
"@angular/platform-browser-dynamic": "^17.3.4",
"@angular/router": "^17.3.4",
"@babel/polyfill": "^7.4.4",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@popperjs/core": "^2.11.8",
"@xmldom/xmldom": "^0.8.10",
"bcryptjs": "^2.4.3",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"chart.js": "^4.4.3",
"cors": "^2.8.5",
"express": "^4.19.2",
"form-data": "^4.0.0",
"jimp": "^0.22.12",
"jsonwebtoken": "^9.0.2",
"jszip": "^3.10.1",
"jwt-decode": "^4.0.0",
"lodash-es": "^4.17.21",
"lowdb": "^7.0.1",
"mongoose": "^8.4.1",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.10.0",
"node-opcua": "^2.125.0",
"node-opcua-client-crawler": "^2.124.0",
"nodemailer": "^6.9.13",
"reflect-metadata": "^0.2.2",
"rxjs": "~7.8.1",
"swagger-ui-express": "^5.0.1",
"tslib": "^2.6.3",
"tsoa": "^5.1.1",
"tsyringe": "^4.8.0",
"uuid": "^9.0.1",
"webdav": "^5.6.0",
"winston": "^3.13.0",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.17.0",
"xpath": "^0.0.34",
"zone.js": "~0.14.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.4",
"@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "^17.3.4",
"@angular/compiler-cli": "^17.3.4",
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@jest/globals": "^29.7.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.6",
"@types/bcryptjs": "^2.4.6",
"@types/bootstrap": "^5.2.10",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jasmine": "^5.1.4",
"@types/jquery": "^3.5.30",
"@types/jsonwebtoken": "^9.0.6",
"@types/lodash-es": "^4.17.12",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.11",
"@types/node": "^20.14.2",
"@types/nodemailer": "^6.4.15",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"esbuild": "^0.20.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fhg-jest": "./projects/fhg-jest",
"jasmine": "^5.1.0",
"jasmine-core": "^5.1.2",
"jasmine-ts": "^0.4.0",
"jest": "^29.7.0",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"karma-junit-reporter": "^2.0.1",
"ng-packagr": "^17.3.0",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"semantic-release": "^23.0.8",
"supertest": "^6.3.4",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}
"name": "aas-portal-project",
"version": "3.0.0-development.57",
"description": "Web-based visualization and control of asset administration shells.",
"type": "module",
"scripts": {
"tsoa": "npm run tsoa -w aas-server",
"start": "docker build -f Dockerfile -t aasportal . && docker run -d --name AASPortal -p 80:80 --restart=always aasportal",
"header": "node --no-warnings --loader ts-node/esm copyright-header.ts",
"coverage": "node --no-warnings --loader ts-node/esm coverage-summary.ts",
"user-db": "docker run -p 27017:27017 -d --name aasportal-users -e MONGO_INITDB_DATABASE=aasportal-users mongo",
"lint": "npm run lint -ws",
"format": "npm run format -ws",
"test": "npm run test -ws",
"tsc": "npm run tsc -ws",
"build": "npm run build -ws",
"build:debug": "npm run build:debug -ws",
"lib:build": "npm run build -w common -w aas-lib",
"lib:build:debug": "npm run build:debug -w common -w aas-lib",
"aas-portal:build": "npm run build -w common -w aas-lib -w aas-portal",
"aas-portal:build:debug": "npm run build:build -w common -w aas-lib -w aas-portal",
"aas-server:build": "npm run build -w common -w aas-server",
"aas-server:build:debug": "npm run build:debug -w common -w aas-server",
"serve": "npm run build && node --env-file projects/aas-server/.env projects/aas-server/dist/aas-server.js"
},
"repository": {
"type": "git",
"url": "https://github.com/FraunhoferIOSB/AASPortal.git"
},
"author": "Fraunhofer IOSB-INA",
"homepage": "https://www.iosb-ina.fraunhofer.de/",
"license": "Apache-2.0",
"workspaces": [
"projects/fhg-jest",
"projects/common",
"projects/aas-server",
"projects/aas-lib",
"projects/aas-portal"
],
"dependencies": {
"@angular/animations": "^17.3.11",
"@angular/common": "^17.3.11",
"@angular/compiler": "^17.3.11",
"@angular/core": "^17.3.11",
"@angular/forms": "^17.3.11",
"@angular/localize": "^17.3.11",
"@angular/platform-browser": "^17.3.11",
"@angular/platform-browser-dynamic": "^17.3.11",
"@angular/router": "^17.3.11",
"@babel/polyfill": "^7.4.4",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@popperjs/core": "^2.11.8",
"@xmldom/xmldom": "^0.8.10",
"bcryptjs": "^2.4.3",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"chart.js": "^4.4.3",
"cors": "^2.8.5",
"express": "^4.19.2",
"form-data": "^4.0.0",
"jimp": "^0.22.12",
"jsonwebtoken": "^9.0.2",
"jszip": "^3.10.1",
"jwt-decode": "^4.0.0",
"lodash-es": "^4.17.21",
"lowdb": "^7.0.1",
"mongoose": "^8.4.1",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.10.0",
"node-opcua": "^2.125.0",
"node-opcua-client-crawler": "^2.124.0",
"nodemailer": "^6.9.13",
"reflect-metadata": "^0.2.2",
"rxjs": "~7.8.1",
"swagger-ui-express": "^5.0.1",
"tslib": "^2.6.3",
"tsoa": "^5.1.1",
"tsyringe": "^4.8.0",
"uuid": "^9.0.1",
"webdav": "^5.6.0",
"winston": "^3.13.0",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.17.0",
"xpath": "^0.0.34",
"zone.js": "~0.14.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.4",
"@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "^17.3.4",
"@angular/compiler-cli": "^17.3.11",
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@jest/globals": "^29.7.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.6",
"@types/bcryptjs": "^2.4.6",
"@types/bootstrap": "^5.2.10",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jasmine": "^5.1.4",
"@types/jquery": "^3.5.30",
"@types/jsonwebtoken": "^9.0.6",
"@types/lodash-es": "^4.17.12",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.11",
"@types/node": "^20.14.2",
"@types/nodemailer": "^6.4.15",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"esbuild": "^0.20.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fhg-jest": "./projects/fhg-jest",
"jasmine": "^5.1.0",
"jasmine-core": "^5.1.2",
"jasmine-ts": "^0.4.0",
"jest": "^29.7.0",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"karma-junit-reporter": "^2.0.1",
"ng-packagr": "^17.3.0",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"semantic-release": "^23.0.8",
"supertest": "^6.3.4",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}
26 changes: 11 additions & 15 deletions projects/aas-lib/src/lib/template.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*****************************************************************************/

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, map } from 'rxjs';
import { toSignal } from '@angular/core/rxjs-interop';
import { Injectable, computed } from '@angular/core';
import { Observable, map } from 'rxjs';
import { aas, Endpoint, TemplateDescriptor } from 'common';
import { encodeBase64Url } from './convert';

Expand All @@ -21,22 +22,17 @@ interface TemplateServiceState {
providedIn: 'root',
})
export class TemplateService {
private readonly state = new BehaviorSubject<TemplateServiceState>({ templates: [], timestamp: 0 });

public constructor(private readonly http: HttpClient) {
private readonly state = toSignal(
this.http
.get<TemplateDescriptor[]>('/api/v1/templates')
.pipe(map(values => this.state.next({ templates: values, timestamp: Date.now() })))
.subscribe();
}
.pipe(map(values => ({ templates: values, timestamp: Date.now() }) as TemplateServiceState)),
{ initialValue: { templates: [], timestamp: 0 } as TemplateServiceState },
);

/**
* Gets the list of available templates.
* @returns An array of `TemplateDescriptor` items.
*/
public getTemplates(): Observable<TemplateDescriptor[]> {
return this.state.asObservable().pipe(map(state => state.templates));
}
public constructor(private readonly http: HttpClient) {}

/** Gets the list of available templates. */
public readonly templates = computed(() => this.state().templates);

/**
* Gets the template from the specified endpoint.
Expand Down
16 changes: 5 additions & 11 deletions projects/aas-lib/src/test/template.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import { TestBed } from '@angular/core/testing';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { of } from 'rxjs';
import { TemplateDescriptor, aas } from 'common';

import { TemplateService } from '../lib/template.service';
import { NotifyService } from '../public-api';
import { first, of } from 'rxjs';
import { HttpClient } from '@angular/common/http';

describe('TemplateService', () => {
let service: TemplateService;
Expand Down Expand Up @@ -46,15 +46,9 @@ describe('TemplateService', () => {
expect(service).toBeTruthy();
});

describe('getTemplates', () => {
it('returns the available templates', (done: DoneFn) => {
service
.getTemplates()
.pipe(first())
.subscribe(templates => {
expect(templates).toEqual([template]);
done();
});
describe('templates', () => {
it('returns the available templates', () => {
expect(service.templates).toEqual([template]);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h4 class="modal-title text-info">
<button type="button" class="btn-close" (click)="cancel()"> </button>
</div>
<div class="modal-body">
@for (message of messages; track message) {
@for (message of messages(); track message) {
<ngb-toast [autohide]="false" class="bg-danger w-100 mb-3">
<div class="d-flex">
<div class="flex-grow-1">{{ message }}</div>
Expand All @@ -24,15 +24,15 @@ <h4 class="modal-title text-info">
}
<div class="form-floating mb-3">
<select class="form-select" id="selectModelType" [(ngModel)]="modelType" name="modelType">
@for (item of modelTypes; track item) {
@for (item of modelTypes(); track item) {
<option [ngValue]="item">{{item}}</option>
}
</select>
<label for="selectModelType" translate>LABEL_MODEL_TYPE</label>
</div>
<div class="form-floating mb-3">
<select class="form-select" id="selectTemplate" [(ngModel)]="template" name="template">
@for (item of templates | async; track item) {
@for (item of templates(); track item) {
<option [ngValue]="item">{{item.endpoint?.address}}</option>
}
</select>
Expand Down
Loading

0 comments on commit d94aaf3

Please sign in to comment.