Commit 1cce51d9 authored by Hando Lukats's avatar Hando Lukats
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Hando Lukats

See merge request teis/public-web-client!691
parents 796e60d1 7ff60902
......@@ -15,7 +15,7 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist/official",
"index": "projects/official/src/index.html",
......@@ -39,8 +39,16 @@
"src/assets/styles"
]
},
"scripts": [],
"es5BrowserSupport": true
"scripts": [
"node_modules/systemjs/dist/system.min.js",
"node_modules/systemjs/dist/extras/amd.min.js",
"node_modules/systemjs/dist/extras/named-exports.min.js",
"node_modules/systemjs/dist/extras/named-register.min.js"
],
"es5BrowserSupport": true,
"customWebpackConfig": {
"path": "projects/official/extra-webpack.config.js"
}
},
"configurations": {
"production": {
......@@ -78,7 +86,7 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "official:build"
},
......@@ -139,7 +147,7 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist/public",
"index": "projects/public/src/index.html",
......@@ -160,8 +168,16 @@
"projects/public/src/styles.scss",
"node_modules/@ska-angular/assets/assets/scss/ska_visuaal.scss"
],
"scripts": [],
"es5BrowserSupport": true
"scripts": [
"node_modules/systemjs/dist/system.min.js",
"node_modules/systemjs/dist/extras/amd.min.js",
"node_modules/systemjs/dist/extras/named-exports.min.js",
"node_modules/systemjs/dist/extras/named-register.min.js"
],
"es5BrowserSupport": true,
"customWebpackConfig": {
"path": "projects/public/extra-webpack.config.js"
}
},
"configurations": {
"production": {
......@@ -172,7 +188,7 @@
}
],
"optimization": true,
"outputHashing": "all",
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
......@@ -194,12 +210,13 @@
"replace": "projects/public/src/environments/environment.ts",
"with": "projects/public/src/environments/environment.local.ts"
}
]
],
"outputHashing": "none"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "public:build"
},
......@@ -260,7 +277,7 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist/opendata",
"index": "projects/opendata/src/index.html",
......@@ -279,7 +296,12 @@
"projects/opendata/src/styles.scss",
"node_modules/@ska-angular/assets/assets/scss/ska_visuaal.scss"
],
"scripts": [],
"scripts": [
"node_modules/systemjs/dist/system.min.js",
"node_modules/systemjs/dist/extras/amd.min.js",
"node_modules/systemjs/dist/extras/named-exports.min.js",
"node_modules/systemjs/dist/extras/named-register.min.js"
],
"es5BrowserSupport": true
},
"configurations": {
......@@ -312,7 +334,7 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "opendata:build"
},
......
Subproject commit 5e4991d2acfc14be4a5c8808d76e82fc8c289cce
Subproject commit 4e6f4436b62bfd4057c0a07d44f3c08e0a0fc375
# Application architecture
Application architecture is designed around facade design pattern.
* Follow Angular guidelines for creating NgModules: [here](https://angular.io/guide/module-types)
......@@ -18,9 +17,37 @@ Routed feature modules are lazy loaded and have their respective routing module.
The main shared module is imported once per feature module and is used by all feature modules.
## Widget modules
Widget modules are usually comprised of UI components and components derivated from those. This is to ensure when a component is used, all of its dependant parts are included.
[More info and examples](../projects/teis/src/lib/modules/README.md)
[More info and examples](../projects/teis/src/lib/widgets/README.md)
## Directive modules
Directives and their respective modules.
[More info](../projects/teis/src/lib/directives/README.md)
## Shared Feature modules
Shared features across applications.
[More info](../projects/teis/src/lib/features/README.md)
## Service modules
Services and their respective modules.
[More info and instructions](../projects/teis/src/lib/services/README.md)
## Pipes
Pipes with a singular common module.
[More info](../projects/teis/src/lib/pipes/README.md)
## Util
Global utility functions separate from angular decorators
[More info](../projects/teis/src/lib/util/README.md)
## Validators
Custom reactive form validators if native validators don't cut it
[More info](../projects/teis/src/lib/validators/README.md)
{
"name": "te-is",
"version": "1.29.0",
"version": "1.30.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@angular-builders/custom-webpack": {
"version": "9.2.1-beta.0",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/@angular-builders/custom-webpack/-/custom-webpack-9.2.1-beta.0.tgz",
"integrity": "sha1-2r1vvCrTB9kW+O4yEXHto3tYQmk=",
"dev": true,
"requires": {
"@angular-devkit/architect": ">=0.900.0 < 0.1000.0",
"@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0",
"@angular-devkit/core": "^9.0.0",
"lodash": "^4.17.10",
"ts-node": "^8.5.2",
"webpack-merge": "^4.2.1"
},
"dependencies": {
"diff": {
"version": "4.0.2",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/diff/-/diff-4.0.2.tgz",
"integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=",
"dev": true
},
"ts-node": {
"version": "8.10.2",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/ts-node/-/ts-node-8.10.2.tgz",
"integrity": "sha1-7uA3ZGM7EjTd03+NuewQt17H+40=",
"dev": true,
"requires": {
"arg": "^4.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.17",
"yn": "3.1.1"
}
},
"yn": {
"version": "3.1.1",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/yn/-/yn-3.1.1.tgz",
"integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=",
"dev": true
}
}
},
"@angular-devkit/architect": {
"version": "0.901.12",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.901.12.tgz",
......@@ -5253,6 +5294,11 @@
"integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==",
"dev": true
},
"@types/systemjs": {
"version": "6.1.1",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/@types/systemjs/-/systemjs-6.1.1.tgz",
"integrity": "sha1-6uF/KggOhn0Bot1hT1JKsifPWkE="
},
"@types/tapable": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.6.tgz",
......@@ -5812,6 +5858,12 @@
"readable-stream": "^2.0.6"
}
},
"arg": {
"version": "4.1.3",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/arg/-/arg-4.1.3.tgz",
"integrity": "sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=",
"dev": true
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
......@@ -6928,6 +6980,16 @@
"integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
"dev": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"bitsyntax": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bitsyntax/-/bitsyntax-0.1.0.tgz",
......@@ -13727,7 +13789,11 @@
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"dev": true,
"optional": true
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": {
"version": "3.1.0",
......@@ -15013,6 +15079,13 @@
"resolved": "https://registry.npmjs.org/mydatepicker/-/mydatepicker-9.0.2.tgz",
"integrity": "sha512-7rIXMHQSNjGr9dsmaqRbuaCq6Uf/V6dSqJ8vpci/xpJJUIdg7MenoPbLlQZxE/pvRzgKWvQqIsPL/lkobZoYXQ=="
},
"nan": {
"version": "2.15.0",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/nan/-/nan-2.15.0.tgz",
"integrity": "sha1-PzSkc/8Y4VwbVia2KQO1rW5mX+4=",
"dev": true,
"optional": true
},
"nanomatch": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
......@@ -20056,6 +20129,26 @@
"simplebar": "^4.2.3"
}
},
"single-spa": {
"version": "5.9.3",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/single-spa/-/single-spa-5.9.3.tgz",
"integrity": "sha1-LRUcuzsnNimlsnswo7jKhH3LpMU="
},
"single-spa-angular": {
"version": "4.9.2",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/single-spa-angular/-/single-spa-angular-4.9.2.tgz",
"integrity": "sha1-S04taGYaLxfOlQ2U1gpJ5gpO1Sw=",
"requires": {
"tslib": "^2.0.0"
},
"dependencies": {
"tslib": {
"version": "2.3.1",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha1-6KM1rdXOrlGqJh0ypJAVjvBC7wE="
}
}
},
"slack-node": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/slack-node/-/slack-node-0.2.0.tgz",
......@@ -21186,6 +21279,11 @@
}
}
},
"systemjs": {
"version": "6.10.3",
"resolved": "https://repo.tehik.ee:443/artifactory/api/npm/teis-npm/systemjs/-/systemjs-6.10.3.tgz",
"integrity": "sha1-fng/zLWCMvHZ6wXH4aZhJolFyt4="
},
"tabbable": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/tabbable/-/tabbable-4.0.0.tgz",
......@@ -22646,7 +22744,11 @@
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"dev": true,
"optional": true
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": {
"version": "3.1.0",
......@@ -23280,7 +23382,11 @@
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"dev": true,
"optional": true
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": {
"version": "3.1.0",
......
module.exports = (angularWebpackConfig, options) => {
return {
...angularWebpackConfig,
module: {
...angularWebpackConfig.module,
rules: [
...angularWebpackConfig.module.rules,
{
parser: {
system: false
}
}
]
}
};
}
......@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiOffice } from '@teis/services/api-office';
import { Observable } from 'rxjs';
import { ClaimDefinitionDto } from '@teis/services/claims/claims.model.ts';
import { ClaimDefinitionDto } from '@teis/services/claims/claims.model';
@Injectable()
export class ClaimDefinitionApiService extends ApiOffice {
......
import { ClassifierItemLightDto } from '@teis/services/classifiers/classifiers.models';
import { ObjectStatus } from '@teis/common/common.models';
import { FileReferenceDto } from '@teis/services/file/file.model';
import { RiskIndicator } from '@teis/services/risk-assessments/risk-assessments.models';
import {
RiskIndicator,
RiskIndicatorLightDto
} from '@teis/services/risk-assessments/risk-assessments.models';
export interface BusinessTypeLightDto {
category: ClassifierItemLightDto;
......@@ -56,19 +59,6 @@ export interface RiskIndicatorBody {
status: ClassifierItemLightDto;
}
export interface RiskIndicatorLightDto {
id: string;
lowerLimit: number;
upperLimit: number;
measuringInstruction: string;
name: string;
objectStatus: ObjectStatus;
recommendation: string;
riskStatementId: string;
unit: string;
status: ClassifierItemLightDto;
}
export interface RiskIndicatorDto extends RiskIndicatorLightDto{
riskStatement: RiskStatementDto;
}
......
import { Injectable } from '@angular/core';
import { PrivilegeDto, RoleDefinitionDto } from './role-definition.models';
import { ApiOffice } from '@teis/services/api-office';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { PrivilegeDto } from '@official/api-services/role-definition/role-definition.models';
import { RoleDefinitionDto } from '@teis/services/roles/roles.models';
@Injectable()
export class RoleDefinitionApiService extends ApiOffice {
......
import { ObjectStatus } from '@teis/common/common.models';
import { RoleType } from '@teis/services/roles/roles.models';
export interface RoleDefinitionDto {
defaultValidityPeriod: number;
description: string;
excludedRoleOverlap: string;
id: string;
locationLink: boolean;
mustBeEmployee: boolean;
name: string;
objectStatus: string;
requiredFromNoOfEmployees: number;
requiredNumber: number;
roleCode: string;
roleType: RoleType;
seqNo: number;
nameRU: string;
nameEN: string;
descriptionRU: string;
descriptionEN: string;
}
export enum PrivilegeType {
E = 'E',
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@teis/services/guards/auth-guard.service';
import { TiPrivilegeDefinitionCode } from '@teis/services/privileges/privilege.models';
export const routes: Routes = [
{
......@@ -15,7 +16,7 @@ export const routes: Routes = [
path: 'inspection',
loadChildren: () => import('./features/inspection/inspection.module').then(m => m.InspectionModule),
canLoad: [AuthGuard],
data: { privileges: ['TI_MANAGE_PROCEDURALACT', 'TI_VIEW_PROCEDURALACT', 'TI_VIEW_VIOLATION'] },
data: { privileges: [TiPrivilegeDefinitionCode.TiManageProceduralact, TiPrivilegeDefinitionCode.TiViewProceduralact, TiPrivilegeDefinitionCode.TiViewViolation] },
},
{
path: '**',
......
<alert *ngIf="!(authenticated$ | async) && systemNotificationPerLanguage?.value"
variant="warning"
[message]="systemNotificationPerLanguage?.value">
</alert>
<teis-alert *ngIf="!(authenticated$ | async) && systemNotificationPerLanguage?.value"
variant="warning"
[message]="systemNotificationPerLanguage?.value">
</teis-alert>
<ska-message-toaster></ska-message-toaster>
<router-outlet></router-outlet>
......@@ -2,10 +2,8 @@ import { Component, HostListener, Inject, OnDestroy, OnInit } from '@angular/cor
import { TranslateService } from '@ngx-translate/core';
import { LangContext, MessageContext } from '@ska-angular/core';
import { Router } from '@angular/router';
import { BreadcrumbsService } from '@teis/modules/breadcrumbs/services/breadcrumbs.service';
import { Title } from '@angular/platform-browser';
import { DOCUMENT } from '@angular/common';
import { RouteConfig } from '@teis/modules/breadcrumbs/services/breadcrumbs-config';
import { AuthenticationService } from '@teis/services/authentication/authentication.service';
import { FeatureFlag } from '@teis/services/feature-flags/feature-flags.model';
import { TeisFeatureFlagsService } from '@teis/services/feature-flags/feature-flags.service';
......@@ -14,6 +12,8 @@ import { ParameterDto } from '@teis/services/parameters/parameters.model';
import { ParametersCommonApiService } from '@teis/services/parameters-common/parameters-common-api.service';
import { ParameterCode } from '@teis/services/parameters-common/parameters-common.model';
import { takeUntil } from 'rxjs/operators';
import { RouteConfig } from '@teis/widgets/teis-breadcrumbs/services/breadcrumbs-config';
import { BreadcrumbsService } from '@teis/widgets/teis-breadcrumbs/services/breadcrumbs.service';
@Component({
selector: 'app-root',
......@@ -95,7 +95,10 @@ export class AppComponent implements OnInit, OnDestroy {
private getFeatureFlags() {
const featureFlags = [
FeatureFlag.INSPECTIONTOPICS_VISIBLE,
FeatureFlag.InspectionTopicsVisible,
FeatureFlag.DriversInspectionsVisible,
FeatureFlag.AccidentsMenuItemVisible,
FeatureFlag.AccidentsFunctionalityVisible,
];
this.featureFlagsService.fetchAllFeatureFlags(featureFlags);
}
......@@ -105,7 +108,7 @@ export class AppComponent implements OnInit, OnDestroy {
takeUntil(this.destroyed$)
).subscribe((parameters: ParameterDto[]) => {
this.systemNotificationPerLanguage = parameters.find(parameter => parameter.code === ParameterCode.SYSTEM_NOTIFICATION_OFFICE_LOGIN);
});
});
}
}
......@@ -10,11 +10,13 @@ import { SkaTranslateHttpLoader, SkaCoreModule, SkaMessageModule } from '@ska-an
import { HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpErrorService, PrefixService, SubmittingInterceptorService, TokenInterceptorService } from '@teis/services/interceptors';
import { SkaCommonModule } from '@ska-angular/common';
import { LoaderModule } from '@teis/modules/loader/loader.module';
import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client';
import { CommonModule } from '@angular/common';
import { TooltipModule, PopoverModule } from 'ngx-bootstrap';
import { AlertModule } from '@teis/modules/alert/alert.module';
import { TeisAlertModule } from '@teis/widgets/teis-alert/teis-alert.module';
import { TeisLoaderModule } from '@teis/widgets/teis-loader';
import { RouteReuseStrategy } from '@angular/router';
import { MicroFrontendRouteReuseStrategy } from '@teis/single-spa/services/route-reuse-strategy';
export class CommonTranslateHttpLoader extends SkaTranslateHttpLoader {
public getFolderNames(): string[] {
......@@ -41,7 +43,7 @@ const TRANSLATION_OPTIONS = {
SkaCommonModule,
SkaMessageModule,
SkaCoreModule,
LoaderModule,
TeisLoaderModule,
AppRoutingModule,
BrowserModule,
BrowserAnimationsModule,
......@@ -50,9 +52,10 @@ const TRANSLATION_OPTIONS = {
TranslateModule.forRoot(TRANSLATION_OPTIONS),
TooltipModule.forRoot(),
PopoverModule.forRoot(),
AlertModule,
TeisAlertModule,
],
providers: [
{ provide: RouteReuseStrategy, useClass: MicroFrontendRouteReuseStrategy },
{ provide: HTTP_INTERCEPTORS, useClass: SubmittingInterceptorService, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: TokenInterceptorService, multi: true },
{ provide: HTTP_INTERCEPTORS, useExisting: HttpErrorService, multi: true },
......@@ -60,4 +63,4 @@ const TRANSLATION_OPTIONS = {
],
bootstrap: [AppComponent],
})
export class AppModule { }
export class AppModule {}
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { concatMap } from 'rxjs/operators';
import { BreadcrumbsService } from '@teis/modules/breadcrumbs/services/breadcrumbs.service';
import { ModalService } from '@teis/modules/modal/modal.service';
import { PersonDto } from '@teis/services/person/persons.models';
import { PersonDto } from '@teis/services/representatives/person/persons.models';
import { LegalPersonApi } from '@teis/services/legal-person/legal-person.api.service';
import { LegalPersonService } from '@teis/services/legal-person/legal-person.service';
import { AuthenticationService } from '@teis/services/authentication/authentication.service';
import { LocationService } from '@teis/services/location/location.service';
import { LegalPersonsParams } from '@teis/services/legal-person/legal-person.models';
import { ModalService } from '@teis/widgets/teis-modal/modal.service';
import { BreadcrumbsService } from '@teis/widgets/teis-breadcrumbs/services/breadcrumbs.service';
@Injectable()
export class CompanyDetailsFacade {
......
<block>
<tehik-inner-tabs
<teis-block>
<teis-inner-tabs
[availableTabs]="availableTabs"
(active)="activateComponent($event)">
</tehik-inner-tabs>
</teis-inner-tabs>