1. Change front-end to angular7.
2. Fix ng-package. 3. Backend: remove Email To, and added to settings.
This commit is contained in:
parent
baaa1d052a
commit
dec2cfb84e
|
@ -1,68 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
||||||
"project": {
|
|
||||||
"name": "interactivemining"
|
|
||||||
},
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"root": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"assets": [
|
|
||||||
"assets",
|
|
||||||
"favicon.ico"
|
|
||||||
],
|
|
||||||
"index": "index.html",
|
|
||||||
"main": "main.ts",
|
|
||||||
"polyfills": "polyfills.ts",
|
|
||||||
"test": "test.ts",
|
|
||||||
"tsconfig": "tsconfig.app.json",
|
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
|
||||||
"prefix": "app",
|
|
||||||
"styles": [
|
|
||||||
"styles.css",
|
|
||||||
"./assets/css/interactive-mining.css",
|
|
||||||
"./assets/css/animations.css"
|
|
||||||
],
|
|
||||||
"scripts": [
|
|
||||||
"../node_modules/jquery/dist/jquery.min.js",
|
|
||||||
"../node_modules/uikit/dist/js/uikit.min.js",
|
|
||||||
"../node_modules/uikit/dist/js/uikit-icons.min.js",
|
|
||||||
"./assets/js/ResizeSensor.js",
|
|
||||||
"./assets/js/jquery.sticky-sidebar.js"
|
|
||||||
],
|
|
||||||
"environmentSource": "environments/environment.ts",
|
|
||||||
"environments": {
|
|
||||||
"dev": "environments/environment.ts",
|
|
||||||
"prod": "environments/environment.prod.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"e2e": {
|
|
||||||
"protractor": {
|
|
||||||
"config": "./protractor.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": [
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.app.json",
|
|
||||||
"exclude": "**/node_modules/**"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.spec.json",
|
|
||||||
"exclude": "**/node_modules/**"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "e2e/tsconfig.e2e.json",
|
|
||||||
"exclude": "**/node_modules/**"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"test": {
|
|
||||||
"karma": {
|
|
||||||
"config": "./karma.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaults": {
|
|
||||||
"styleExt": "css",
|
|
||||||
"component": {}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"interactivemining": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.css",
|
||||||
|
"src/assets/css/interactive-mining.css",
|
||||||
|
"src/assets/css/animations.css"
|
||||||
|
],
|
||||||
|
"scripts": [
|
||||||
|
"node_modules/jquery/dist/jquery.min.js",
|
||||||
|
"node_modules/uikit/dist/js/uikit.min.js",
|
||||||
|
"node_modules/uikit/dist/js/uikit-icons.min.js",
|
||||||
|
"src/assets/js/ResizeSensor.js",
|
||||||
|
"src/assets/js/jquery.sticky-sidebar.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "interactivemining:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "interactivemining:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "interactivemining:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"karmaConfig": "./karma.conf.js",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "src/tsconfig.spec.json",
|
||||||
|
"scripts": [
|
||||||
|
"node_modules/jquery/dist/jquery.min.js",
|
||||||
|
"node_modules/uikit/dist/js/uikit.min.js",
|
||||||
|
"node_modules/uikit/dist/js/uikit-icons.min.js",
|
||||||
|
"src/assets/js/ResizeSensor.js",
|
||||||
|
"src/assets/js/jquery.sticky-sidebar.js"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.css",
|
||||||
|
"src/assets/css/interactive-mining.css",
|
||||||
|
"src/assets/css/animations.css"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"src/tsconfig.app.json",
|
||||||
|
"src/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"interactivemining-e2e": {
|
||||||
|
"root": "e2e",
|
||||||
|
"sourceRoot": "e2e",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "./protractor.conf.js",
|
||||||
|
"devServerTarget": "interactivemining:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"e2e/tsconfig.e2e.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "interactivemining",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"prefix": "app",
|
||||||
|
"styleext": "css"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"prefix": "app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,24 +4,22 @@
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
frameworks: ['jasmine', '@angular/cli'],
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
plugins: [
|
plugins: [
|
||||||
require('karma-jasmine'),
|
require('karma-jasmine'),
|
||||||
require('karma-chrome-launcher'),
|
require('karma-chrome-launcher'),
|
||||||
require('karma-jasmine-html-reporter'),
|
require('karma-jasmine-html-reporter'),
|
||||||
require('karma-coverage-istanbul-reporter'),
|
require('karma-coverage-istanbul-reporter'),
|
||||||
require('@angular/cli/plugins/karma')
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
],
|
],
|
||||||
client:{
|
client:{
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
reports: [ 'html', 'lcovonly' ],
|
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||||
fixWebpackSourcePaths: true
|
fixWebpackSourcePaths: true
|
||||||
},
|
},
|
||||||
angularCli: {
|
|
||||||
environment: 'dev'
|
|
||||||
},
|
|
||||||
reporters: ['progress', 'kjhtml'],
|
reporters: ['progress', 'kjhtml'],
|
||||||
port: 9876,
|
port: 9876,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||||
"name": "interactive-mining",
|
"name": "interactive-mining",
|
||||||
|
"version": "1.0.0",
|
||||||
"ngPackage": {
|
"ngPackage": {
|
||||||
"lib": {
|
"lib": {
|
||||||
"entryFile": "public_api.ts",
|
"entryFile": "public_api.ts",
|
||||||
|
@ -8,5 +9,8 @@
|
||||||
"externals": {"ng2-nouislider": "ng2-nouislider"}
|
"externals": {"ng2-nouislider": "ng2-nouislider"}
|
||||||
},
|
},
|
||||||
"dest": "../../dist/interactive-mining-lib"
|
"dest": "../../dist/interactive-mining-lib"
|
||||||
}
|
},
|
||||||
|
"whitelistedNonPeerDependencies": [
|
||||||
|
"."
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,46 +13,50 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^4.2.4",
|
"@angular/animations": "^7.2.14",
|
||||||
"@angular/common": "^4.2.4",
|
"@angular/common": "^7.2.14",
|
||||||
"@angular/compiler": "^4.2.4",
|
"@angular/compiler": "^7.2.14",
|
||||||
"@angular/core": "^4.2.4",
|
"@angular/core": "^7.2.14",
|
||||||
"@angular/forms": "^4.2.4",
|
"@angular/forms": "^7.2.14",
|
||||||
"@angular/http": "^4.2.4",
|
"@angular/http": "^7.2.14",
|
||||||
"@angular/platform-browser": "^4.2.4",
|
"@angular/platform-browser": "^7.2.14",
|
||||||
"@angular/platform-browser-dynamic": "^4.2.4",
|
"@angular/platform-browser-dynamic": "^7.2.14",
|
||||||
"@angular/router": "^4.2.4",
|
"@angular/router": "^7.2.14",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"file-saver": "^1.3.3",
|
"file-saver": "^2.0.2",
|
||||||
"jquery": "^3.2.1",
|
"jquery": "^3.4.1",
|
||||||
"ng-focus-if": "^1.0.7",
|
"ng-focus-if": "^1.0.7",
|
||||||
"ng2-nouislider": "^1.7.7",
|
"ng2-nouislider": "^1.8.2",
|
||||||
"ngx-pagination": "^3.1.0",
|
"ngx-pagination": "^3.2.1",
|
||||||
"nouislider": "^11.1.0",
|
"nouislider": "^13.1.5",
|
||||||
"rxjs": "^5.5.6",
|
"tslib": "^1.9.0",
|
||||||
"uikit": "^3.0.0-beta.38",
|
"uikit": "^3.1.5",
|
||||||
"zone.js": "^0.8.19"
|
"zone.js": "^0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "^1.3.0",
|
"@angular-devkit/build-angular": "~0.13.0",
|
||||||
"@angular/compiler-cli": "^4.2.4",
|
"@angular/cli": "^7.3.9",
|
||||||
"@angular/language-service": "^4.2.4",
|
"@angular/compiler-cli": "^7.2.14",
|
||||||
"@types/jasmine": "~2.8.3",
|
"@angular/language-service": "^7.2.14",
|
||||||
"@types/jasminewd2": "~2.0.2",
|
"@types/file-saver": "^2.0.1",
|
||||||
"@types/node": "~8.0.30",
|
"@types/jasmine": "~3.3.13",
|
||||||
"codelyzer": "^4.0.1",
|
"@types/jasminewd2": "~2.0.6",
|
||||||
"jasmine-core": "~2.8.0",
|
"@types/node": "~12.0.3",
|
||||||
|
"codelyzer": "^5.0.1",
|
||||||
|
"jasmine-core": "~3.4.0",
|
||||||
"jasmine-spec-reporter": "~4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"karma": "~2.0.0",
|
"karma": "~4.1.0",
|
||||||
"karma-chrome-launcher": "~2.2.0",
|
"karma-chrome-launcher": "~2.2.0",
|
||||||
"karma-cli": "~1.0.1",
|
"karma-cli": "~2.0.0",
|
||||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
"karma-coverage-istanbul-reporter": "^2.0.5",
|
||||||
"karma-jasmine": "~1.1.0",
|
"karma-jasmine": "~2.0.1",
|
||||||
"karma-jasmine-html-reporter": "^0.2.2",
|
"karma-jasmine-html-reporter": "^1.4.2",
|
||||||
"ng-packagr": "^1.6.0",
|
"ng-packagr": "^5.2.0",
|
||||||
"protractor": "~5.1.2",
|
"protractor": "~5.4.2",
|
||||||
"ts-node": "~4.1.0",
|
"rxjs": "6.5.1",
|
||||||
"tslint": "~5.9.1",
|
"rxjs-compat": "^6.5.1",
|
||||||
"typescript": "~2.3.3"
|
"ts-node": "~8.2.0",
|
||||||
|
"tslint": "~5.16.0",
|
||||||
|
"typescript": "~3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
export * from './src/app/interactivemining/interactive-mining.module';
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, OnInit, AfterViewInit } from '@angular/core';
|
import { Component, OnInit, AfterViewInit } from '@angular/core';
|
||||||
import UIkit from 'uikit';
|
import UIkit from 'uikit';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-configuration',
|
selector: 'app-configuration',
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
import {Settings} from './settings/settings';
|
import {Settings} from './settings/settings';
|
||||||
import {DocSamplesMetadata} from './doc-samples-metadata';
|
import {DocSamplesMetadata} from './doc-samples-metadata';
|
||||||
import {Util} from '../util';
|
import {Util} from '../util';
|
||||||
|
import { map, catchError } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ConfigurationService {
|
export class ConfigurationService {
|
||||||
|
@ -27,8 +28,8 @@ export class ConfigurationService {
|
||||||
|
|
||||||
getDocSamples(): Observable<DocSamplesMetadata[]> {
|
getDocSamples(): Observable<DocSamplesMetadata[]> {
|
||||||
return this.http.get(this.backendServerAddress + this.getDocSamplesUrl + `?user=${this.userId}`)
|
return this.http.get(this.backendServerAddress + this.getDocSamplesUrl + `?user=${this.userId}`)
|
||||||
.map(data => data['documents'])
|
.pipe(map(data => data['documents']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadDocuments(file: File): Observable<number> {
|
uploadDocuments(file: File): Observable<number> {
|
||||||
|
@ -42,32 +43,32 @@ export class ConfigurationService {
|
||||||
reportProgress: true
|
reportProgress: true
|
||||||
};
|
};
|
||||||
return this.http.post(this.backendServerAddress + this.uploadDocumentsUrl, formData, options)
|
return this.http.post(this.backendServerAddress + this.uploadDocumentsUrl, formData, options)
|
||||||
.map(res => res['data'])
|
.pipe(map(res => res['data']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
chooseDocumentsSample(choise: string): Observable<number> {
|
chooseDocumentsSample(choise: string): Observable<number> {
|
||||||
return this.http.post(this.backendServerAddress + this.chooseSampleUrl, {user: this.userId, docsample: choise})
|
return this.http.post(this.backendServerAddress + this.chooseSampleUrl, {user: this.userId, docsample: choise})
|
||||||
.map(res => res['data'])
|
.pipe(map(res => res['data']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
getLoadedDocumentsNumber(): Observable<any> {
|
getLoadedDocumentsNumber(): Observable<any> {
|
||||||
return this.http.get(this.backendServerAddress + this.alreadyDocumentsUrl + `?user=${this.userId}`)
|
return this.http.get(this.backendServerAddress + this.alreadyDocumentsUrl + `?user=${this.userId}`)
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
runMining(parameters: Settings): Observable<any> {
|
runMining(parameters: Settings): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.runMiningUrl,
|
return this.http.post(this.backendServerAddress + this.runMiningUrl,
|
||||||
{user: this.userId, parameters: parameters})
|
{user: this.userId, parameters: parameters})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
saveProfileParameters(parameters: Settings): Observable<any> {
|
saveProfileParameters(parameters: Settings): Observable<any> {
|
||||||
const concepts = localStorage.getItem('concepts');
|
const concepts = localStorage.getItem('concepts');
|
||||||
return this.http.post(this.backendServerAddress + this.prepareSavedProfileUrl,
|
return this.http.post(this.backendServerAddress + this.prepareSavedProfileUrl,
|
||||||
{user: this.userId, concepts: concepts, parameters: parameters})
|
{user: this.userId, concepts: concepts, parameters: parameters})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@
|
||||||
<div id="cm-run-test-section">
|
<div id="cm-run-test-section">
|
||||||
<div class="uk-display-inline">
|
<div class="uk-display-inline">
|
||||||
<button id="run-mining-btn" class="uk-button cm-run-test-button" [disabled]="documentsLoaded<1" (click)="runMining()">Run rules test</button>
|
<button id="run-mining-btn" class="uk-button cm-run-test-button" [disabled]="documentsLoaded<1" (click)="runMining()">Run rules test</button>
|
||||||
<span *ngIf="matches_number !== ''" id="results-number" class="cm-coloured-text uk-margin-left uk-text-bottom">{{matches_number}} matche{{matches_number===1?'':'s'}} found</span>
|
<span *ngIf="matches_number !== ''" id="results-number" class="cm-coloured-text uk-margin-left uk-text-bottom">{{matches_number}} matche{{matches_number == '1'?'':'s'}} found</span>
|
||||||
<span *ngIf="prev_matches_number !== ''" id="results-number-previous" class="cm-text-muted uk-text-bottom">, {{prev_matches_number}} matche{{prev_matches_number===1?'':'s'}} found previously</span>
|
<span *ngIf="prev_matches_number !== ''" id="results-number-previous" class="cm-text-muted uk-text-bottom">, {{prev_matches_number}} matche{{prev_matches_number == '1'?'':'s'}} found previously</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="results-section" class="cm-results-rows">
|
<div id="results-section" class="cm-results-rows">
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class AutosizeDirective implements AfterContentChecked {
|
||||||
|
|
||||||
constructor(public element: ElementRef) {}
|
constructor(public element: ElementRef) {}
|
||||||
|
|
||||||
@HostListener('input', ['$event.target'])
|
@HostListener('input')
|
||||||
public onInput() {
|
public onInput() {
|
||||||
this.resize();
|
this.resize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {Content} from './content';
|
import {Content} from './content';
|
||||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||||
import 'rxjs/add/operator/map';
|
import { Observable } from 'rxjs';
|
||||||
import 'rxjs/add/operator/catch';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import {Observable} from 'rxjs/Observable';
|
|
||||||
import {Util} from '../util';
|
import {Util} from '../util';
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,9 +26,9 @@ export class ContentsService {
|
||||||
|
|
||||||
getContent(): Observable<Content[]> {
|
getContent(): Observable<Content[]> {
|
||||||
this.concepts = localStorage.getItem('concepts');
|
this.concepts = localStorage.getItem('concepts');
|
||||||
return this.http.get(this.backendServerAddress + this.getContentUrl + `?user=${this.userId}&concepts=${this.concepts}`)
|
return this.http.get<Content[]> (this.backendServerAddress + this.getContentUrl + `?user=${this.userId}&concepts=${this.concepts}`)
|
||||||
.map((data) => this.contentsJsonToArray(data['data']))
|
.pipe(map((data: Content[]) => this.contentsJsonToArray(data['data'])))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
contentsJsonToArray(json): Content[] {
|
contentsJsonToArray(json): Content[] {
|
||||||
|
@ -56,19 +55,19 @@ export class ContentsService {
|
||||||
reportProgress: true
|
reportProgress: true
|
||||||
};
|
};
|
||||||
return this.http.post(this.backendServerAddress + this.uploadContentFileUrl, formData, options)
|
return this.http.post(this.backendServerAddress + this.uploadContentFileUrl, formData, options)
|
||||||
.map((data) => this.contentsJsonToArray(data['data']))
|
.pipe(map((data: Content[]) => this.contentsJsonToArray(data['data'])))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateContent(content: Array<Content>): Observable<any> {
|
updateContent(content: Array<Content>): Observable<any> {
|
||||||
// transform data to json string
|
// transform data to json string
|
||||||
var hashmap = {};
|
const hashmap = {};
|
||||||
content.forEach(function (element) {
|
content.forEach(function (element) {
|
||||||
hashmap[element.keyword] = element.context;
|
hashmap[element.keyword] = element.context;
|
||||||
});
|
});
|
||||||
return this.http.post(this.backendServerAddress + this.updateContentUrl, {user: this.userId, concepts: JSON.stringify(hashmap)})
|
return this.http.post(this.backendServerAddress + this.updateContentUrl, {user: this.userId, concepts: JSON.stringify(hashmap)})
|
||||||
.map((data) => data['concepts'])
|
.pipe(map((data) => data['concepts']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ export class FileUploadDirective {
|
||||||
@Input() private maxFileSize = 104857600;
|
@Input() private maxFileSize = 104857600;
|
||||||
@Output() private filesChange: EventEmitter<File> = new EventEmitter();
|
@Output() private filesChange: EventEmitter<File> = new EventEmitter();
|
||||||
@Output() private filesInvalid: EventEmitter<File> = new EventEmitter();
|
@Output() private filesInvalid: EventEmitter<File> = new EventEmitter();
|
||||||
@HostBinding('class') private background = 'uk-placeholder cm-file-drop-area cm-coloured-text';
|
@HostBinding('class') public background = 'uk-placeholder cm-file-drop-area cm-coloured-text';
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,11 @@ import {Injectable} from '@angular/core';
|
||||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||||
import {ProfileData} from './profile-data';
|
import {ProfileData} from './profile-data';
|
||||||
import {Util} from '../util';
|
import {Util} from '../util';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
import {ProfileMetadata} from './profile-metadata';
|
import {ProfileMetadata} from './profile-metadata';
|
||||||
import {ExampleProfilesMetadata} from './example-profiles-metadata';
|
import {ExampleProfilesMetadata} from './example-profiles-metadata';
|
||||||
import {UsersMetadata} from './users-metadata';
|
import {UsersMetadata} from './users-metadata';
|
||||||
|
import { map, catchError } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ManageprofilesService {
|
export class ManageprofilesService {
|
||||||
|
@ -37,56 +38,57 @@ export class ManageprofilesService {
|
||||||
|
|
||||||
initialServerHandshake(communityId: string): Observable<any> {
|
initialServerHandshake(communityId: string): Observable<any> {
|
||||||
return this.http.get(this.backendServerAddress + this.initServerHandshake + `?user=${this.userId}&communityId=${communityId}`)
|
return this.http.get(this.backendServerAddress + this.initServerHandshake + `?user=${this.userId}&communityId=${communityId}`)
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getUsersProfiles(): Observable<UsersMetadata[]> {
|
getUsersProfiles(): Observable<UsersMetadata[]> {
|
||||||
return this.http.get(this.backendServerAddress + this.getusersProfilesUrl + `?isinadministrators=${this.isCommunityManager}`)
|
return this.http.get(this.backendServerAddress + this.getusersProfilesUrl + `?isinadministrators=${this.isCommunityManager}`)
|
||||||
.map(data => data['profiles'])
|
.pipe(map(data => data['profiles']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateProfileStatus(userId: string, profileId: string, status: string): Observable<any> {
|
updateProfileStatus(userId: string, profileId: string, status: string): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.updateProfileStatusUrl, {isinadministrators: this.isCommunityManager, user: userId, id: profileId, status: status})
|
return this.http.post(this.backendServerAddress + this.updateProfileStatusUrl,
|
||||||
.catch(this.util.handleError);
|
{isinadministrators: this.isCommunityManager, user: userId, id: profileId, status: status})
|
||||||
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadUserProfileAdmin(userId: string, profileId: string): Observable<any> {
|
downloadUserProfileAdmin(userId: string, profileId: string): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
||||||
{user: userId, id: profileId}, {responseType: 'blob'})
|
{user: userId, id: profileId}, {responseType: 'blob'})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadUserProfileAdmin(userId: string, profileId: string): Observable<ProfileData> {
|
loadUserProfileAdmin(userId: string, profileId: string): Observable<ProfileData> {
|
||||||
return this.http.post<ProfileData>(this.backendServerAddress + this.loadSavedProfileUrl, {user: userId, id: profileId})
|
return this.http.post<ProfileData>(this.backendServerAddress + this.loadSavedProfileUrl, {user: userId, id: profileId})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadProfile(profileId: string): Observable<any> {
|
downloadProfile(profileId: string): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
||||||
{user: this.userId, id: profileId}, {responseType: 'blob'})
|
{user: this.userId, id: profileId}, {responseType: 'blob'})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteProfile(profileId: string): Observable<any> {
|
deleteProfile(profileId: string): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.DeleteuserProfileUrl, {user: this.userId, id: profileId})
|
return this.http.post(this.backendServerAddress + this.DeleteuserProfileUrl, {user: this.userId, id: profileId})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
createNewProfile(): Observable<any> {
|
createNewProfile(): Observable<any> {
|
||||||
return this.http.get(this.backendServerAddress + this.createNewProfileUrl + `?user=${this.userId}`)
|
return this.http.get(this.backendServerAddress + this.createNewProfileUrl + `?user=${this.userId}`)
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSavedProfile(profileId: string): Observable<ProfileData> {
|
loadSavedProfile(profileId: string): Observable<ProfileData> {
|
||||||
return this.http.post<ProfileData>(this.backendServerAddress + this.loadSavedProfileUrl, {user: this.userId, id: profileId})
|
return this.http.post<ProfileData>(this.backendServerAddress + this.loadSavedProfileUrl, {user: this.userId, id: profileId})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadExampleProfile(name: string): Observable<ProfileData> {
|
loadExampleProfile(name: string): Observable<ProfileData> {
|
||||||
return this.http.post<ProfileData>(this.backendServerAddress + this.loadExampleProfileUrl, {user: this.userId, name: name})
|
return this.http.post<ProfileData>(this.backendServerAddress + this.loadExampleProfileUrl, {user: this.userId, name: name})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadFile(file: File): Observable<ProfileData> {
|
uploadFile(file: File): Observable<ProfileData> {
|
||||||
|
@ -100,24 +102,24 @@ export class ManageprofilesService {
|
||||||
reportProgress: true
|
reportProgress: true
|
||||||
};
|
};
|
||||||
return this.http.post<ProfileData>(this.backendServerAddress + this.uploadProfileUrl, formData, options)
|
return this.http.post<ProfileData>(this.backendServerAddress + this.uploadProfileUrl, formData, options)
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
getSavedProfiles(): Observable<ProfileMetadata[]> {
|
getSavedProfiles(): Observable<ProfileMetadata[]> {
|
||||||
return this.http.get(this.backendServerAddress + this.getSavedProfilesUrl + `?user=${this.userId}`)
|
return this.http.get(this.backendServerAddress + this.getSavedProfilesUrl + `?user=${this.userId}`)
|
||||||
.map(data => data['profiles'])
|
.pipe(map(data => data['profiles']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
getExampleProfiles(): Observable<ExampleProfilesMetadata[]> {
|
getExampleProfiles(): Observable<ExampleProfilesMetadata[]> {
|
||||||
return this.http.get(this.backendServerAddress + this.getExampleProfilesUrl)
|
return this.http.get(this.backendServerAddress + this.getExampleProfilesUrl)
|
||||||
.map(data => data['profiles'])
|
.pipe(map(data => data['profiles']))
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyProfile(communityId: string, profileId: string): Observable<any> {
|
notifyProfile(communityId: string, profileId: string): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.notifyProfileUrl, {community: communityId, user: this.userId, id: profileId})
|
return this.http.post(this.backendServerAddress + this.notifyProfileUrl, {community: communityId, user: this.userId, id: profileId})
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {Util} from '../util';
|
import {Util} from '../util';
|
||||||
|
import {catchError} from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SaveprofileService {
|
export class SaveprofileService {
|
||||||
|
@ -21,7 +22,7 @@ export class SaveprofileService {
|
||||||
saveProfile(name: string, id: string, docName: string, dosNumber: number): Observable<any> {
|
saveProfile(name: string, id: string, docName: string, dosNumber: number): Observable<any> {
|
||||||
return this.http.post(this.backendServerAddress + this.saveProfileUrl,
|
return this.http.post(this.backendServerAddress + this.saveProfileUrl,
|
||||||
{user: this.userId, name: name, id: id, docname: docName, docsnumber: dosNumber })
|
{user: this.userId, name: name, id: id, docname: docName, docsnumber: dosNumber })
|
||||||
.catch(this.util.handleError);
|
.pipe(catchError(this.util.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
import UIkit from 'uikit';
|
import UIkit from 'uikit';
|
||||||
import {HttpErrorResponse} from '@angular/common/http';
|
import {HttpErrorResponse, HttpResponse} from '@angular/common/http';
|
||||||
import { saveAs } from 'file-saver/FileSaver';
|
|
||||||
import { Response } from '@angular/http';
|
|
||||||
import {ErrorObservable} from 'rxjs/observable/ErrorObservable';
|
import {ErrorObservable} from 'rxjs/observable/ErrorObservable';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import {Observable} from 'rxjs';
|
import {throwError} from 'rxjs/internal/observable/throwError';
|
||||||
|
import {saveAs} from 'file-saver';
|
||||||
|
|
||||||
export class Util {
|
export class Util {
|
||||||
|
|
||||||
public handleError (err: HttpErrorResponse): ErrorObservable {
|
public handleError (err: HttpErrorResponse): ErrorObservable<never> {
|
||||||
if (err.error instanceof Error) {
|
if (err.error instanceof Error) {
|
||||||
console.error('Client-side error occured.');
|
console.error('Client-side error occured.');
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,7 +20,7 @@ export class Util {
|
||||||
pos: 'top-center',
|
pos: 'top-center',
|
||||||
timeout: 0
|
timeout: 0
|
||||||
});
|
});
|
||||||
return Observable.throw(err || 'Server error');
|
return throwError(err || 'Server error');
|
||||||
}
|
}
|
||||||
|
|
||||||
public getUserId(): string {
|
public getUserId(): string {
|
||||||
|
@ -54,7 +53,7 @@ export const saveFile = (blobContent: Blob, fileName: string) => {
|
||||||
* by looking inside content-disposition
|
* by looking inside content-disposition
|
||||||
* @param res http Response
|
* @param res http Response
|
||||||
*/
|
*/
|
||||||
export const getFileNameFromResponseContentDisposition = (res: Response) => {
|
export const getFileNameFromResponseContentDisposition = (res: HttpResponse<any>) => {
|
||||||
const contentDisposition = res.headers.get('content-disposition') || '';
|
const contentDisposition = res.headers.get('content-disposition') || '';
|
||||||
const matches = /filename=([^;]+)/ig.exec(contentDisposition);
|
const matches = /filename=([^;]+)/ig.exec(contentDisposition);
|
||||||
const fileName = (matches[1] || 'untitled').trim();
|
const fileName = (matches[1] || 'untitled').trim();
|
||||||
|
|
|
@ -1081,7 +1081,7 @@ header.uk-sticky-fixed .cm-results-count-section {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-webkit-align-items: start;
|
-webkit-align-items: start;
|
||||||
align-items: start;
|
align-items: flex-start;
|
||||||
margin-bottom: 64px;
|
margin-bottom: 64px;
|
||||||
}
|
}
|
||||||
#child1 {
|
#child1 {
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
miningbackendserveraddress: 'http://localhost:8080'
|
miningbackendserveraddress: 'http://localhost'
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
|
|
||||||
/** Evergreen browsers require these. **/
|
/** Evergreen browsers require these. **/
|
||||||
import 'core-js/es6/reflect';
|
import 'core-js/es6/reflect';
|
||||||
import 'core-js/es7/reflect';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './app/interactivemining/interactive-mining.module';
|
||||||
|
export * from './app/interactivemining/interactive-mining-routing.module';
|
|
@ -11,7 +11,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"test.ts"
|
"test.ts",
|
||||||
|
"polyfills.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"importHelpers": true,
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
|
@ -14,6 +15,8 @@
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2017",
|
"es2017",
|
||||||
"dom"
|
"dom"
|
||||||
]
|
],
|
||||||
|
"module": "es2015",
|
||||||
|
"baseUrl": "./"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,8 +14,7 @@
|
||||||
"eofline": true,
|
"eofline": true,
|
||||||
"forin": true,
|
"forin": true,
|
||||||
"import-blacklist": [
|
"import-blacklist": [
|
||||||
true,
|
true
|
||||||
"rxjs"
|
|
||||||
],
|
],
|
||||||
"import-spacing": true,
|
"import-spacing": true,
|
||||||
"indent": [
|
"indent": [
|
||||||
|
|
|
@ -1695,7 +1695,7 @@ class NotifyHandler(BaseHandler):
|
||||||
s.starttls()
|
s.starttls()
|
||||||
s.ehlo()
|
s.ehlo()
|
||||||
s.login(msettings.SMTP_USERNAME, msettings.SMTP_PASSWORD)
|
s.login(msettings.SMTP_USERNAME, msettings.SMTP_PASSWORD)
|
||||||
s.sendmail(msettings.SMTP_FROM, 'sospioneer2002@gmail.com', message)
|
s.sendmail(msettings.SMTP_FROM, msettings.SMTP_TO, message)
|
||||||
s.quit()
|
s.quit()
|
||||||
|
|
||||||
# write new profile to database
|
# write new profile to database
|
||||||
|
|
Loading…
Reference in New Issue