Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 992a196a authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Pull request #217: Merge development to master for Relesase 4.2-RC1

Merge in EDELIVERY/smp from development to master

* commit '9d18392a7f96f56daf8781a56cf722df4f0b8ab7': (203 commits)
  Fix create new username
  add wls deployment module
  Fix citnet bamboo unit tests
  Fix citnet bamboo plans
  add logging to API utils
  fix npm bamboo build
  fix npm bamboo build
  fix npm build
  Implement option to build angular from preinstalled NodeJS.
  Fix serialization of the certificate on user update
  deploy root, api and spi modules to nexus and update README.md
  Implement configuration option to automatically trust certificate when user changes it.
  Implement TLS truststore option property (Default vs SMP truststore)
  Implement TLS truststore option property (Default vs SMP truststore)
  update oracle migration script
  Upgrade libraries
  Fix reload cron expresion and small updates for alert table
  Fix RP the serialNumber mismatch for long (16+) serial numbers
  add migration scripts
  fix jackson lib version for weblogic
  ...
parents f83c08bc 7dd8a98f
No related branches found
No related tags found
No related merge requests found
Showing
with 30353 additions and 7552 deletions
common/cipa-commons-busdox/target/
common/cipa-edelivery-common/target/classes/eu/europa/ec/cipa/common/business/AbstractBusinessImpl.class
common/cipa-edelivery-common/target/classes/eu/europa/ec/cipa/common/exception/BusinessException.class
common/cipa-edelivery-common/target/classes/eu/europa/ec/cipa/common/logging/ILogEvent.class
common/cipa-edelivery-common/target/classes/eu/europa/ec/cipa/common/logging/impl/AbstractLoggerImpl.class
common/cipa-edelivery-common/target/classes/eu/europa/ec/cipa/common/logging/impl/LoggingServiceImpl.class
common/cipa-edelivery-common/target/
common/cipa-peppol-types/target/
sml/cipa-sml-client-library/target/
sml/cipa-sml-server-library/target/
sml/cipa-sml-webapp/target/
smp/.idea/libraries/Maven__com_sun_jersey_jersey_client_1_17_1.xml
smp/.idea/libraries/
smp/cipa-smp-client-library/target/
smp/cipa-smp-full-webapp/target/
smp/cipa-smp-readonly-webapp/target/
smp/cipa-smp-server-library/target/
smp/.idea/
smp-api/target/
smp-api/.idea/copyright/profiles_settings.xml
smp-api/.idea/libraries/Maven__junit_junit_4_12.xml
smp-api/.idea/libraries/
smp-api/.idea/
*.iml
addons/cipa-sml-util/.idea/
addons/cipa-sml-util/target/
addons/cipa-sml-migration/target/test-classes/global-truststore.jks
addons/cipa-sml-migration/target/classes/
addons/cipa-sml-migration/target/
addons/cipa-sml-migration/.idea/
## Eclipse config files ##
.settings/
.classpath
.project
## PMD Eclipse plugin files ##
.pmd
## Maven output folder ##
target/
#temporary output of the cargo plugin
cargo
## Compiled java classes ##
*.class
*.jar
*.war
*.ear
## generic files to ignore
*~
*.lock
*.DS_Store
*.swp
*.out
*.tmp
*.log
## Intellij IDEA files
.idea/
code-coverage
\ No newline at end of file
*.iml
*.ipr
*.iws
## Files generated by checksum plugin
*.sha256
## maven-shade-plugin generated files
dependency-reduced-pom.xml
/.idea/
......@@ -5,41 +5,27 @@
[https://webgate.ec.europa.eu/CITnet/bamboo/browse/EDELIVERY-SMPDEV]
## Building SMP
SMP requires Maven 3.0 and Java 1.7.
SMP requires Maven 3.6+ and Java 1.8.
Integration tests included into build process require access to DB. By default it is a local instance of MySQL with preconfigured schema:
[https://ec.europa.eu/cefdigital/code/projects/EDELIVERY/repos/smp/browse/smp-server-library/database]
Any remote DB with preconfigured schema might be used as well. Sample build command:
mvn clean install \
-Djdbc.driver=oracle.jdbc.OracleDriver \
-Djdbc.url=jdbc:oracle:thin:<HOST_AND_PORT_AND_SERVICENAME> \
-Djdbc.user=<USERNAME> \
-Djdbc.password=<PASSWORD> \
-Dtarget-database=Oracle \
-Djdbc.read-connections.max=10
## Source code history
This is a continuation of CIPA SMP Joinup repository, which was migrated here to GIT on 07.12.2016:
[https://joinup.ec.europa.eu/svn/cipaedelivery/trunk]
## To run with SoapUI code coverage (from Bamboo, etc)
## Build SMP
Step 1:
mvn clean install -Prun-soapui -Pdeploy-war
-Djdbc.driver=oracle.jdbc.OracleDriver
-Djdbc.url=jdbc:oracle:thin:<HOST_AND_PORT_AND_SERVICENAME>
-Djdbc.user=<USERNAME>
"-Djdbc.password=<PASSWORD>"
-Dtarget-database=Oracle
-DjacocoRemotePort=65000
-DjacocoRemoteAddress=localhost
"-Durl=http://localhost:7001/smp"
-DdeployWarFolder=/home/edelivery/oracle/middleware/domains/bdmsl/autodeploy/
mvn clean install
Step 2:
mvn sonar:sonar
## Execute integartion tests
By default integrations tests are executes on H2 database.
Any remote DB with preconfigured schema might be used as well. Sample build command:
mvn clean install \
-Djdbc.driver=oracle.jdbc.OracleDriver \
-Djdbc.url=jdbc:oracle:thin:<HOST_AND_PORT_AND_SERVICENAME> \
-Djdbc.user=<USERNAME> \
-Djdbc.password=<PASSWORD> \
-Dtarget-database=Oracle \
-Djdbc.read-connections.max=10
\ No newline at end of file
eDelivery SMP 4.2
- added new properties:
smp.passwordPolicy.validationRegex: Regular expression do define password minimum complexity rules!
smp.passwordPolicy.validationMessage: The error message shown to the user in case the password does not follow the regex put in the domibus.passwordPolicy.pattern property"
smp.ui.authentication.types: Set list of '|' separated UI authentication types. Currently supported PASSWORD, SSO: ex. PASSWORD|SSO
smp.automation.authentication.types: Set list of '|' separated automation authentication types (Web-Service integration). Currently supported PASSWORD, CERT: ex. PASSWORD|CERT
smp.http.forwarded.headers.enabled to control usage of Forwarded parameters RP/LoadBalancer.
smp.ui.session.secure: Cookie is only sent to the server when a request is made with the https: scheme (except on localhost), and therefore is more resistant to man-in-the-middle attacks.
smp.ui.session.max-age: Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. Empty value will not set parameter
smp.ui.session.strict: Controls whether a cookie is sent with cross-origin requests, providing some protection against cross-site request forgery attacks. Possible values are: Strict, None, Lax. (Cookies with SameSite=None require a secure context/HTTPS)!!)
smp.ui.session.path: A path that must exist in the requested URL, or the browser won't send the Cookie header. Null/Empty value sets the authentication requests context by default. The forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for Path=/docs, /docs, /docs/Web/, and /docs/Web/HTTP will all match.
smp.ui.session.idle_timeout.admin: Specifies the time, in seconds, between client requests before the SMP will invalidate session for ADMIN users (System)!
smp.ui.session.idle_timeout.user: Specifies the time, in seconds, between client requests before the SMP will invalidate session for users (Service group, SMP Admin)
smp.sso.cas.ui.label: The SSO service provider label.
smp.sso.cas.url: The SSO CAS URL enpoint
smp.sso.cas.urlpath.login: The CAS URL path for login. Complete URL is composed from parameters: ${smp.sso.cas.url}/${smp.sso.cas.urlpath.login}.
smp.sso.cas.callback.url: The URL is the callback URL belonging to the local SMP Security System. If using RP make sure it target SMP path '/ui/rest/security/cas'
smp.sso.cas.token.validation.urlpath: The CAS URL path for login. Complete URL is composed from parameters: ${smp.sso.cas.url}/${smp.sso.cas.urlpath.token.validation}.
smp.sso.cas.token.validation.params: The CAS token validation key:value properties separated with '|'.Ex: 'acceptStrengths:BASIC,CLIENT_CERT|assuranceLevel:TOP'
smp.sso.cas.token.validation.groups: The '|' separated CAS groups user must belong to.
smp.http.httpStrictTransportSecurity.maxAge: How long(in seconds) HSTS should last in the browser's cache(default one year)
smp.http.header.security.policy: Http header content security policy
contextPath.output - added now as database configuration option
smp.cluster.enabled: if smp is deployed on cluster. If property is not enabled then all properties are refreshed on SetProperty. Otherwise properties are refreshed by cron task for all nodes at the same time
authentication.blueCoat.enabled - deprecated and replaced with smp.automation.authentication.external.tls.clientCert.enabled
smp.automation.authentication.external.tls.SSLClientCert.enabled Authentication with external module as: reverse proxy. Authenticated certificate is send to application using 'SSLClientCert' HTTP header. Do not enable this feature without properly configured reverse-proxy!
identifiersBehaviour.ParticipantIdentifierScheme.ebCoreId.concatenate: Concatenate ebCore party id in XML responses <ParticipantIdentifier >urn:oasis:names:tc:ebcore:partyid-type:unregistered:test-ebcore-id</ParticipantIdentifier>
smp.passwordPolicy.expired.forceChange: Force change password at UI login if expired
smp.passwordPolicy.warning.beforeExpiration: How many days before expiration should the UI warn users at login
- new application configuration property
libraries.folder: add external SPI beans libraries folder loaded at the startup of the SMP!
- removed deprecated properties
bdmsl.integration.keystore.password
bdmsl.integration.keystore.path
xmldsig.keystore.password
xmldsig.keystore.classpath
bdmsl.integration.proxy.server
bdmsl.integration.proxy.port
bdmsl.integration.proxy.user
bdmsl.integration.proxy.password
- added new table SMP_ALERT
\ No newline at end of file
This diff is collapsed.
......@@ -25,6 +25,7 @@
!.vscode/extensions.json
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage/*
......
# SMP UI implementation
The module is SMP user frontend.
# Development
For development use
npm start
Access the development pages via URL:
http://localhost:4200/#/
......@@ -31,7 +31,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
......@@ -43,13 +42,33 @@
"with": "src/environments/environment.prod.ts"
}
]
},
"development": {
"optimization": false,
"sourceMap": true,
"namedChunks": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "6mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "SMP-UI:build"
"browserTarget": "SMP-UI:build:development"
},
"configurations": {
"production": {
......@@ -80,16 +99,6 @@
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
......@@ -104,15 +113,6 @@
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "SMP-UI:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
......
This diff is collapsed.
{
"name": "smp-web",
"version": "4.0.0",
"license": "MIT",
"version": "4.2.0",
"license": "EUPL 1.2",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy-config.json",
"start:dev": "ng serve -c dev --proxy-config proxy-config.json",
"build": "ng build --dev --base-href /smp/",
"prod": "ng build --prod --output-path=./src/main/resources/META-INF/resources/ui/",
"prod": "ng build --configuration production --output-path=./src/main/resources/META-INF/resources/ui/",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/flex-layout": "^6.0.0-beta.16",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/platform-server": "^6.1.0",
"@angular/router": "^6.1.0",
"@swimlane/ngx-datatable": "^13.0.0",
"codelyzer": "^4.5.0",
"core-js": "^2.5.7",
"file-saver": "1.3.3",
"hammerjs": "^2.0.8",
"rxjs": "^6.3.3",
"@angular/animations": "^13.2.3",
"@angular/cdk": "^13.2.3",
"@angular/common": "^13.2.3",
"@angular/compiler": "^13.2.3",
"@angular/core": "^13.2.3",
"@angular/flex-layout": "^12.0.0-beta.35",
"@angular/forms": "^13.2.3",
"@angular/http": "^7.2.16",
"@angular/material": "^13.2.3",
"@angular/platform-browser": "^13.2.3",
"@angular/platform-browser-dynamic": "^13.2.3",
"@angular/platform-server": "^13.2.3",
"@angular/router": "^13.2.3",
"@swimlane/ngx-datatable": "~20.0.0",
"core-js": "^3.18.3",
"file-saver": "^2.0.5",
"rxjs": "^6.6.3",
"ts-helpers": "^1.1.2",
"zone.js": "^0.8.26"
"tslib": "^2.3.1",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "^6.2.5",
"@angular/compiler-cli": "^6.1.10",
"@types/file-saver": "1.3.1",
"@types/jasmine": "2.8.9",
"@types/node": "^10.11.7",
"jasmine-core": "3.2.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "^3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "^5.4.1",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^2.9.0"
"@angular-devkit/build-angular": "^13.2.4",
"@angular/cli": "^13.3.7",
"@angular/compiler-cli": "^13.2.3",
"@types/file-saver": "2.0.3",
"@types/jasmine": "3.9.1",
"@types/node": "^16.11.1",
"codelyzer": "^6.0.2",
"hammerjs": "^2.0.8",
"jasmine-core": "3.9.0",
"jasmine-spec-reporter": "7.0.0",
"karma": "^6.3.16",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-jasmine": "^4.0.1",
"ng-packagr": "^13.2.1",
"postcss": "^8.3.9",
"protractor": "^7.0.0",
"ts-node": "^10.3.0",
"tslint": "^6.1.3",
"typescript": "~4.5.5"
},
"peerDependencies": {
"postcss": "^8.3.9"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>eu.europa.ec.edelivery</groupId>
<artifactId>smp-parent-pom</artifactId>
<version>4.1.3-SNAPSHOT</version>
<relativePath>../smp-parent-pom/pom.xml</relativePath>
<artifactId>smp-modules</artifactId>
<version>4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>smp-angular</artifactId>
<packaging>jar</packaging>
<name>SMP Angular UI</name>
<properties>
<frontend-maven-plugin.version>1.3</frontend-maven-plugin.version>
<node.version>v8.9.1</node.version>
<npm.version>5.3.0</npm.version>
<!-- Only selected modules are deployed -->
<maven.deploy.skip>false</maven.deploy.skip>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<node.version>v14.18.0</node.version>
<npm.version>7.24.2</npm.version>
<!--set variable to force use of pre-installed npm-->
<!-- To build with preinstalled nodejs build with usePreInstalledNpm argument as example
(works only on linux for windows update arguments in exec plugin below)
mvn clean install -DusePreInstalledNpm -Dnpm.path=/opt/programs/node-v14.17.0-linux-x64/bin
-->
<npm.path>/opt/programs/node-v14.17.0-linux-x64/bin</npm.path>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --unsafe-perm</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -60,7 +38,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
......@@ -72,22 +49,116 @@
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>prod</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script prod</arguments>
</configuration>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>defaultAngularBuild</id>
<activation>
<property>
<name>!usePreInstalledNpm</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --unsafe-perm</arguments>
</configuration>
</execution>
<execution>
<id>prod</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script prod</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>usePreInstalledNpm</id>
<activation>
<property>
<name>usePreInstalledNpm</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>${npm.path}/npm</argument>
<argument>install</argument>
<argument>@angular/cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>angular build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>${npm.path}/npm</argument>
<argument>run-script</argument>
<argument>prod</argument>
</arguments>
</configuration>
</execution>
</executions>
<configuration>
<executable>${npm.path}/node</executable>
</configuration>
<!--configuration>
<executable>${npm.path}/node</executable>
<arguments>
<argument>${npm.path}/npm</argument>
<argument>run-script</argument>
<argument>prod</argument>
</arguments>
</configuration-->
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
{
"/rest/**": {
"target": "http://localhost:8080/smp/ui/",
"target" : "http://localhost:8080/",
"secure" : "false",
"pathRewrite": {
"^/rest": "/smp/ui/rest"
},
"logLevel": "debug",
"changeOrigin": true,
"secure": true ,
"logLevel": "debug"
"cookiePathRewrite": {
"/smp": "/"
},
"cookieDomainRewrite": "localhost"
},
"/public/**": {
"target" : "http://localhost:8080/",
"secure" : "false",
"pathRewrite": {
"^/public": "/smp/ui/public"
},
"logLevel": "debug",
"changeOrigin": true,
"cookiePathRewrite": {
"/smp": "/"
},
"cookieDomainRewrite": "localhost"
},
"/internal/**": {
"target" : "http://localhost:8080/",
"secure" : "false",
"pathRewrite": {
"^/internal": "/smp/ui/internal"
},
"logLevel": "debug",
"changeOrigin": true,
"cookiePathRewrite": {
"/smp": "/"
},
"cookieDomainRewrite": "localhost"
}
}
import {SearchTableController} from '../common/search-table/search-table-controller';
import {MatDialog, MatDialogConfig, MatDialogRef} from '@angular/material/dialog';
import {GlobalLookups} from "../common/global-lookups";
import {SearchTableEntity} from "../common/search-table/search-table-entity.model";
import {HttpClient} from "@angular/common/http";
import {ObjectPropertiesDialogComponent} from "../common/dialogs/object-properties-dialog/object-properties-dialog.component";
export class AlertController implements SearchTableController {
constructor(protected http: HttpClient, protected lookups: GlobalLookups, public dialog: MatDialog) {
}
validateDeleteOperation(rows: SearchTableEntity[]) {
return null;
}
newRow(): SearchTableEntity {
return null;
}
dataSaved() {
}
isRecordChanged(oldModel: any, newModel: any): boolean {
return false;
}
isRowExpanderDisabled(row: SearchTableEntity): boolean {
return true;
}
public showDetails(row: any) {
this.dialog.open(ObjectPropertiesDialogComponent, {
data: {
title: "Alert details!",
object: row.alertDetails,
}
});
}
public edit(row: any) {
this.dialog.open(ObjectPropertiesDialogComponent, {
data: {
title: "Alert details!",
object: row.alertDetails,
}
});
}
public delete(row: any) {
}
newDialog(config?: MatDialogConfig): MatDialogRef<any> {
return this.dialog.open(ObjectPropertiesDialogComponent, config);
}
}
import {AlertRo} from './alert-ro.model';
export interface AlertResult {
serviceEntities: Array<AlertRo>;
pageSize: number;
count: number;
filter: any;
}
import {SearchTableEntity} from '../common/search-table/search-table-entity.model';
export interface AlertRo extends SearchTableEntity {
sid: string;
alertType: string;
alertStatus: string;
alertStatusDesc?:string;
alertLevel: string;
processedTime?: Date;
reportingTime: Date;
mailTo?:string;
alertDetails?: Object;
}
.alert {
padding: 20px;
color: white;
opacity: 1;
transition: opacity 0.6s;
margin-bottom: 15px;
z-index: 1000;
/* --- Select ---*/
.mat-select{
padding:20px 0;
}
.alert-error {background-color: #f44336;}
.alert-success {background-color: #4CAF50;}
.alert-info {background-color: #2196F3;}
.alert-warning {background-color: #ff9800;}
/* --- Button ---*/
.group-btn {
margin-top:20px;
}
.closebtn {
margin-left: 15px;
color: white;
#hiddenButtonId {
position: fixed;
}
::ng-deep .missingKey {
text-decoration: line-through !important;
font-weight: bold;
color:red;
}
::ng-deep .deleted {
text-decoration: line-through !important;
font-weight: bold;
float: right;
font-size: 24px;
line-height: 24px;
cursor: pointer;
transition: 0.3s;
}
::ng-deep .table-row-new {
color: darkgreen !important;
font-weight: bold;
}
::ng-deep .table-row-updated {
font-weight: bold;
}
::ng-deep .table-row {
font-weight: normal;
}
.closebtn:hover {
color: black;
.truncate-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<div *ngIf="message" [ngClass]="{ 'alert': message, 'alert-success': message.type === 'success', 'alert-error': message.type === 'error' }" id="alertmessage_id">
<span class="closebtn" (click)="clearAlert()">&times;</span>
{{message.text}}
</div>
<smp-search-table
#searchTable
page_id='alert_id'
[title]="'Alerts'"
[columnPicker]="columnPicker"
[url]="baseUrl"
[additionalToolButtons]="additionalToolButtons"
[searchTableController]="alertController"
[showSearchPanel]="false"
[filter]="filter"
[allowNewItems]="false"
[allowDeleteItems]="false"
[allowEditItems]="true"
[showActionButtons]="false"
>
<ng-template #additionalToolButtons>
<span style="width: 2px;background-color: deepskyblue;">&nbsp;</span>
</ng-template>
<ng-template #dateTimeColumn let-value="value" ngx-datatable-cell-template>
<div class='truncate-text' title="{{value | date:dateTimeFormat}}" >{{value | date:dateFormat}}</div></ng-template>
<ng-template #truncateText let-value="value" ngx-datatable-cell-template>
<div class='truncate-text' title="{{value}}" >{{value}}</div>
</ng-template>
<ng-template #forUser let-row="row" let-value="value" ngx-datatable-cell-template>
<div class='truncate-text' title="{{value}} (Email:'{{row.mailTo}}')" >{{value}}</div>
</ng-template>
<ng-template #credentialType let-row="row" let-value="value" ngx-datatable-cell-template>
<div class='truncate-text' >{{value['CREDENTIAL_TYPE']}}</div>
</ng-template>
</smp-search-table>
import {Component, OnInit} from '@angular/core';
import {AlertService} from './alert.service';
import {AfterViewInit, Component, TemplateRef, ViewChild} from '@angular/core';
import {ColumnPicker} from '../common/column-picker/column-picker.model';
import {MatDialog} from '@angular/material/dialog';
import {AlertMessageService} from '../common/alert-message/alert-message.service';
import {AlertController} from './alert-controller';
import {HttpClient} from '@angular/common/http';
import {SmpConstants} from "../smp.constants";
import {GlobalLookups} from "../common/global-lookups";
import {SearchTableComponent} from "../common/search-table/search-table.component";
import {SecurityService} from "../security/security.service";
import {ObjectPropertiesDialogComponent} from "../common/dialogs/object-properties-dialog/object-properties-dialog.component";
@Component({
moduleId: module.id,
selector: 'alert',
templateUrl: './alert.component.html',
styleUrls: ['./alert.component.css']
})
export class AlertComponent implements AfterViewInit {
@ViewChild('rowMetadataAction') rowMetadataAction: TemplateRef<any>;
@ViewChild('rowActions') rowActions: TemplateRef<any>;
@ViewChild('searchTable') searchTable: SearchTableComponent;
@ViewChild('dateTimeColumn') dateTimeColumn:TemplateRef<any>;
@ViewChild('truncateText') truncateText:TemplateRef<any>;
@ViewChild('credentialType') credentialType:TemplateRef<any>;
@ViewChild('forUser') forUser:TemplateRef<any>;
export class AlertComponent implements OnInit {
message: any;
readonly dateTimeFormat: string = SmpConstants.DATE_TIME_FORMAT;
readonly dateFormat: string = SmpConstants.DATE_FORMAT;
public static readonly MAX_COUNT_CSV: number = 10000;
baseUrl = SmpConstants.REST_INTERNAL_ALERT_MANAGE;
columnPicker: ColumnPicker = new ColumnPicker();
alertController: AlertController;
filter: any = {};
isSMPIntegrationOn: boolean = false;
constructor(private alertService: AlertService) { }
ngOnInit() {
this.alertService.getMessage().subscribe(message => { this.message = message; });
constructor(public securityService: SecurityService,
protected lookups: GlobalLookups,
protected http: HttpClient,
protected alertService: AlertMessageService,
public dialog: MatDialog) {
}
clearAlert():void {
this.alertService.clearAlert();
ngAfterViewInit() {
this.alertController = new AlertController(this.http, this.lookups, this.dialog);
this.columnPicker.allColumns = [
{
name: 'Alert date',
title: "Alert date",
prop: 'reportingTime',
showInitially: true,
maxWidth:100,
cellTemplate: this.dateTimeColumn,
},
{
name: 'For User',
title: "For User",
prop: 'username',
cellTemplate: this.forUser,
maxWidth:200,
showInitially: true,
},
{
name: 'Credential type',
title: "Credential type.",
prop: 'alertDetails',
maxWidth:200,
cellTemplate: this.credentialType,
showInitially: true,
},
{
name: 'Alert type',
title: "Alert type.",
prop: 'alertType',
cellTemplate: this.truncateText,
showInitially: true,
},
{
name: 'Alert status',
title: "Alert status.",
prop: 'alertStatus',
showInitially: true,
maxWidth:100,
},
{
name: 'Status desc.',
title: "Status desc.",
prop: 'alertStatusDesc',
cellTemplate: this.truncateText,
showInitially: true,
},
{
name: 'Alert level',
title: "Alert level.",
prop: 'alertLevel',
showInitially: true,
maxWidth:80,
},
];
this.searchTable.tableColumnInit();
this.columnPicker.selectedColumns = this.columnPicker.allColumns.filter(col => col.showInitially);
}
details(row: any) {
this.dialog.open(ObjectPropertiesDialogComponent, {
data: {
title: "Alert details!",
object: row.alertDetails,
}
});
}
// for dirty guard...
isDirty(): boolean {
return this.searchTable.isDirty();
}
}
export interface AlertsEntry {
processed: boolean;
alertId: string;
alertType: string;
alertLevel: string;
alertText: string;
creationTime: Date;
reportingTime: Date;
parameters: string[];
}
import {AlertsEntry} from './alerts-entry.model';
export interface AlertsResult {
alertsEntries: Array<AlertsEntry>;
pageSize: number;
count: number;
filter: any;
alertsType: Array<string>;
alertsLevels: Array<string>;
}
<page-header id="alertsheader_id">Alerts</page-header>
<div class="selectionCriteria">
<mat-card>
<mat-card-content>
<div class="panel">
<form name="filterForm" #filterForm="ngForm" (ngSubmit)="search()">
<!-- Processed -->
<mat-select placeholder="Processed" [(ngModel)]="filter.processed" name="processed" id="processed_id">
<mat-option [value]="''"></mat-option>
<mat-option *ngFor="let aprocessed of aProcessedValues" [value]="aprocessed">
{{aprocessed}}
</mat-option>
</mat-select>
<!-- Alert Type (Basic) -->
<mat-select placeholder="Alert Type" [(ngModel)]="filter.alertType" name="alertType"
id="alerttype_id" (change)="onAlertTypeChanged(filter.alertType)">
<mat-option [value]="''"></mat-option>
<mat-option *ngFor="let atype of aTypes" [value]="atype">
{{atype}}
</mat-option>
</mat-select>
<!-- Alert Id (Advanced) -->
<mat-form-field *ngIf="advancedSearch">
<input matInput placeholder="Alert Id" name="alertId" [(ngModel)]="filter.alertId"
#alertId="ngModel" id="alertid_id">
</mat-form-field>
<!-- Alert Level (Basic) -->
<mat-select placeholder="Alert Level" [(ngModel)]="filter.alertLevel" name="alertLevel"
id="alertlevel_id">
<mat-option [value]="''">
</mat-option>
<mat-option *ngFor="let alevel of aLevels" [value]="alevel">
{{alevel}}
</mat-option>
</mat-select>
<!-- Creation From (Basic) -->
<input [matDatepicker]="creationFromDatePicker"
placeholder="Creation From:"
appClearInvalid
[(ngModel)]="filter.creationFrom"
name="creationFrom"
[max]="timestampCreationFromMaxDate"
(dateChange)='onTimestampCreationFromChange($event)'
[type]="'datetime'" #timestampControl="ngModel" id="creationfrom_id" />
<mat-datepicker #creationFromDatePicker></mat-datepicker>
<!-- Creation To (Basic) -->
<input [matDatepicker]="creationToDatePicker"
placeholder="Creation To:" appClearInvalid
[(ngModel)]="filter.creationTo"
name="creationTo"
[min]="timestampCreationToMinDate"
[max]="timestampCreationToMaxDate"
(dateChange)='onTimestampCreationToChange($event)'
[type]="'datetime'"
#timestampControl="ngModel" id="creationto_id"/>
<mat-datepicker #creationToDatePicker></mat-datepicker>
<!-- Reporting From -->
<input [matDatepicker]="reportingFromDatePicker"
placeholder="Reporting From:" appClearInvalid
[(ngModel)]="filter.reportingFrom"
name="reportingFrom"
[max]="timestampReportingFromMaxDate"
(dateChange)='onTimestampReportingFromChange($event)'
[type]="'datetime'"
#timestampControl="ngModel" id="reportingfrom_id" *ngIf="advancedSearch" />
<mat-datepicker #reportingFromDatePicker></mat-datepicker>
<!-- Reporting To -->
<input [matDatepicker]="reportingToDatePicker"
placeholder="Reporting To:" appClearInvalid
[(ngModel)]="filter.reportingTo"
name="reportingTo"
[min]="timestampReportingToMinDate"
[max]="timestampReportingToMaxDate"
(dateChange)='onTimestampReportingToChange($event)'
[type]="'datetime'"
#timestampControl="ngModel" id="reportingto_id" *ngIf="advancedSearch" />
<mat-datepicker #reportingToDatePicker></mat-datepicker>
<!-- Alert Type Criteria -->
<div class="panel" *ngIf="isAlertTypeDefined()">
<mat-card>
<div>
<mat-card-title>
{{filter.alertType}}
</mat-card-title>
</div>
<mat-card-content>
<mat-form-field *ngFor="let item of items; let i = index">
<input matInput placeholder={{item}} name={{item}} [(ngModel)]="dynamicFilters[i]"
#{{item}}="ngModel" id={{item}}_id>
</mat-form-field>
</mat-card-content>
</mat-card>
</div>
<!-- Search Button and Basic/Advanced Search-->
<div class="searchArea">
<button mat-raised-button color="primary" [disabled]="!filterForm.form.valid" id="searchbutton_id">
<mat-icon>search</mat-icon>
<span>Search</span>
</button>
<a href="#" *ngIf="!advancedSearch" (click)="toggleAdvancedSearch()" id="advancedlink_id">Advanced</a>
<a href="#" *ngIf="advancedSearch" (click)="toggleAdvancedSearch()" id="basiclink_id">Basic</a>
</div>
</form>
</div>
</mat-card-content>
</mat-card>
<ng-template #rowProcessed let-row="row" let-value="value" ngx-datatable-cell-template>
<input autofocus type="checkbox" [checked]="value" id="processed{{row.$$index}}_id" (click)="setProcessedValue(row)"/>
</ng-template>
</div>
<div class="panel">
<div class="group-filter-button">
<span class="row-button">
<app-row-limiter [pageSizes]="rowLimiter.pageSizes"
(onPageSizeChanged)="changePageSize($event.value)"></app-row-limiter>
</span>
<span class="column-filter-button">
<app-column-picker [allColumns]="columnPicker.allColumns" [selectedColumns]="columnPicker.selectedColumns"
(onSelectedColumnsChanged)="columnPicker.changeSelectedColumns($event)"></app-column-picker>
</span>
<button mat-icon-button color="primary" [disabled]="!isSaveAsCSVButtonEnabled()" (click)="saveAsCSV()"
id="saveascsvbutton_id" matTooltip="Export as CSV">
<img src="assets/images/exportCSV.svg" width="30" height="30">
</button>
</div>
<!-- Data Table -->
<ngx-datatable
id="alertsTable"
class="material striped"
[rows]="rows"
[columns]="columnPicker.selectedColumns"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[rowHeight]="'auto'"
[scrollbarH]="true"
[externalPaging]="true"
[externalSorting]="true"
[loadingIndicator]="loading"
[count]="count"
[offset]="offset"
[limit]="rowLimiter.pageSize"
[sorts]="[{prop: 'Creation Time', dir: 'desc'}]"
(page)='onPage($event)'
(sort)="onSort($event)"
(activate)="onActivate($event)">
</ngx-datatable>
<div class="group-action-button">
<button id="alertsCancelButton" mat-raised-button color="primary" (click)="cancel()"
[disabled]="buttonsDisabled">
<mat-icon>cancel</mat-icon>
<span>Cancel</span>
</button>
<button id="alertsSaveButton" mat-raised-button color="primary" (click)="save(false)"
[disabled]="buttonsDisabled">
<mat-icon>save</mat-icon>
<span>Save</span>
</button>
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment