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) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular/cli'],
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular/cli/plugins/karma')
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
angularCli: {
|
||||
environment: 'dev'
|
||||
},
|
||||
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||
"name": "interactive-mining",
|
||||
"version": "1.0.0",
|
||||
"ngPackage": {
|
||||
"lib": {
|
||||
"entryFile": "public_api.ts",
|
||||
|
@ -8,5 +9,8 @@
|
|||
"externals": {"ng2-nouislider": "ng2-nouislider"}
|
||||
},
|
||||
"dest": "../../dist/interactive-mining-lib"
|
||||
}
|
||||
},
|
||||
"whitelistedNonPeerDependencies": [
|
||||
"."
|
||||
]
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,46 +13,50 @@
|
|||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^4.2.4",
|
||||
"@angular/common": "^4.2.4",
|
||||
"@angular/compiler": "^4.2.4",
|
||||
"@angular/core": "^4.2.4",
|
||||
"@angular/forms": "^4.2.4",
|
||||
"@angular/http": "^4.2.4",
|
||||
"@angular/platform-browser": "^4.2.4",
|
||||
"@angular/platform-browser-dynamic": "^4.2.4",
|
||||
"@angular/router": "^4.2.4",
|
||||
"@angular/animations": "^7.2.14",
|
||||
"@angular/common": "^7.2.14",
|
||||
"@angular/compiler": "^7.2.14",
|
||||
"@angular/core": "^7.2.14",
|
||||
"@angular/forms": "^7.2.14",
|
||||
"@angular/http": "^7.2.14",
|
||||
"@angular/platform-browser": "^7.2.14",
|
||||
"@angular/platform-browser-dynamic": "^7.2.14",
|
||||
"@angular/router": "^7.2.14",
|
||||
"core-js": "^2.4.1",
|
||||
"file-saver": "^1.3.3",
|
||||
"jquery": "^3.2.1",
|
||||
"file-saver": "^2.0.2",
|
||||
"jquery": "^3.4.1",
|
||||
"ng-focus-if": "^1.0.7",
|
||||
"ng2-nouislider": "^1.7.7",
|
||||
"ngx-pagination": "^3.1.0",
|
||||
"nouislider": "^11.1.0",
|
||||
"rxjs": "^5.5.6",
|
||||
"uikit": "^3.0.0-beta.38",
|
||||
"zone.js": "^0.8.19"
|
||||
"ng2-nouislider": "^1.8.2",
|
||||
"ngx-pagination": "^3.2.1",
|
||||
"nouislider": "^13.1.5",
|
||||
"tslib": "^1.9.0",
|
||||
"uikit": "^3.1.5",
|
||||
"zone.js": "^0.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "^1.3.0",
|
||||
"@angular/compiler-cli": "^4.2.4",
|
||||
"@angular/language-service": "^4.2.4",
|
||||
"@types/jasmine": "~2.8.3",
|
||||
"@types/jasminewd2": "~2.0.2",
|
||||
"@types/node": "~8.0.30",
|
||||
"codelyzer": "^4.0.1",
|
||||
"jasmine-core": "~2.8.0",
|
||||
"@angular-devkit/build-angular": "~0.13.0",
|
||||
"@angular/cli": "^7.3.9",
|
||||
"@angular/compiler-cli": "^7.2.14",
|
||||
"@angular/language-service": "^7.2.14",
|
||||
"@types/file-saver": "^2.0.1",
|
||||
"@types/jasmine": "~3.3.13",
|
||||
"@types/jasminewd2": "~2.0.6",
|
||||
"@types/node": "~12.0.3",
|
||||
"codelyzer": "^5.0.1",
|
||||
"jasmine-core": "~3.4.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~2.0.0",
|
||||
"karma": "~4.1.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"ng-packagr": "^1.6.0",
|
||||
"protractor": "~5.1.2",
|
||||
"ts-node": "~4.1.0",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "~2.3.3"
|
||||
"karma-cli": "~2.0.0",
|
||||
"karma-coverage-istanbul-reporter": "^2.0.5",
|
||||
"karma-jasmine": "~2.0.1",
|
||||
"karma-jasmine-html-reporter": "^1.4.2",
|
||||
"ng-packagr": "^5.2.0",
|
||||
"protractor": "~5.4.2",
|
||||
"rxjs": "6.5.1",
|
||||
"rxjs-compat": "^6.5.1",
|
||||
"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 UIkit from 'uikit';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-configuration',
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
import {Settings} from './settings/settings';
|
||||
import {DocSamplesMetadata} from './doc-samples-metadata';
|
||||
import {Util} from '../util';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class ConfigurationService {
|
||||
|
@ -27,8 +28,8 @@ export class ConfigurationService {
|
|||
|
||||
getDocSamples(): Observable<DocSamplesMetadata[]> {
|
||||
return this.http.get(this.backendServerAddress + this.getDocSamplesUrl + `?user=${this.userId}`)
|
||||
.map(data => data['documents'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(data => data['documents']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
uploadDocuments(file: File): Observable<number> {
|
||||
|
@ -42,32 +43,32 @@ export class ConfigurationService {
|
|||
reportProgress: true
|
||||
};
|
||||
return this.http.post(this.backendServerAddress + this.uploadDocumentsUrl, formData, options)
|
||||
.map(res => res['data'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(res => res['data']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
chooseDocumentsSample(choise: string): Observable<number> {
|
||||
return this.http.post(this.backendServerAddress + this.chooseSampleUrl, {user: this.userId, docsample: choise})
|
||||
.map(res => res['data'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(res => res['data']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
getLoadedDocumentsNumber(): Observable<any> {
|
||||
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> {
|
||||
return this.http.post(this.backendServerAddress + this.runMiningUrl,
|
||||
{user: this.userId, parameters: parameters})
|
||||
.catch(this.util.handleError);
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
saveProfileParameters(parameters: Settings): Observable<any> {
|
||||
const concepts = localStorage.getItem('concepts');
|
||||
return this.http.post(this.backendServerAddress + this.prepareSavedProfileUrl,
|
||||
{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 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>
|
||||
<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="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>
|
||||
</div>
|
||||
</div>
|
||||
<div id="results-section" class="cm-results-rows">
|
||||
|
|
|
@ -7,7 +7,7 @@ export class AutosizeDirective implements AfterContentChecked {
|
|||
|
||||
constructor(public element: ElementRef) {}
|
||||
|
||||
@HostListener('input', ['$event.target'])
|
||||
@HostListener('input')
|
||||
public onInput() {
|
||||
this.resize();
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Content} from './content';
|
||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
import 'rxjs/add/operator/catch';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import {Util} from '../util';
|
||||
|
||||
|
||||
|
@ -27,9 +26,9 @@ export class ContentsService {
|
|||
|
||||
getContent(): Observable<Content[]> {
|
||||
this.concepts = localStorage.getItem('concepts');
|
||||
return this.http.get(this.backendServerAddress + this.getContentUrl + `?user=${this.userId}&concepts=${this.concepts}`)
|
||||
.map((data) => this.contentsJsonToArray(data['data']))
|
||||
.catch(this.util.handleError);
|
||||
return this.http.get<Content[]> (this.backendServerAddress + this.getContentUrl + `?user=${this.userId}&concepts=${this.concepts}`)
|
||||
.pipe(map((data: Content[]) => this.contentsJsonToArray(data['data'])))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
contentsJsonToArray(json): Content[] {
|
||||
|
@ -56,19 +55,19 @@ export class ContentsService {
|
|||
reportProgress: true
|
||||
};
|
||||
return this.http.post(this.backendServerAddress + this.uploadContentFileUrl, formData, options)
|
||||
.map((data) => this.contentsJsonToArray(data['data']))
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map((data: Content[]) => this.contentsJsonToArray(data['data'])))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
updateContent(content: Array<Content>): Observable<any> {
|
||||
// transform data to json string
|
||||
var hashmap = {};
|
||||
const hashmap = {};
|
||||
content.forEach(function (element) {
|
||||
hashmap[element.keyword] = element.context;
|
||||
});
|
||||
return this.http.post(this.backendServerAddress + this.updateContentUrl, {user: this.userId, concepts: JSON.stringify(hashmap)})
|
||||
.map((data) => data['concepts'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map((data) => data['concepts']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ export class FileUploadDirective {
|
|||
@Input() private maxFileSize = 104857600;
|
||||
@Output() private filesChange: 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() { }
|
||||
|
||||
|
|
|
@ -2,10 +2,11 @@ import {Injectable} from '@angular/core';
|
|||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||
import {ProfileData} from './profile-data';
|
||||
import {Util} from '../util';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
import {ProfileMetadata} from './profile-metadata';
|
||||
import {ExampleProfilesMetadata} from './example-profiles-metadata';
|
||||
import {UsersMetadata} from './users-metadata';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class ManageprofilesService {
|
||||
|
@ -37,56 +38,57 @@ export class ManageprofilesService {
|
|||
|
||||
initialServerHandshake(communityId: string): Observable<any> {
|
||||
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[]> {
|
||||
return this.http.get(this.backendServerAddress + this.getusersProfilesUrl + `?isinadministrators=${this.isCommunityManager}`)
|
||||
.map(data => data['profiles'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(data => data['profiles']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
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})
|
||||
.catch(this.util.handleError);
|
||||
return this.http.post(this.backendServerAddress + this.updateProfileStatusUrl,
|
||||
{isinadministrators: this.isCommunityManager, user: userId, id: profileId, status: status})
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
downloadUserProfileAdmin(userId: string, profileId: string): Observable<any> {
|
||||
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
||||
{user: userId, id: profileId}, {responseType: 'blob'})
|
||||
.catch(this.util.handleError);
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
loadUserProfileAdmin(userId: string, profileId: string): Observable<ProfileData> {
|
||||
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> {
|
||||
return this.http.post(this.backendServerAddress + this.downloadProfileUrl,
|
||||
{user: this.userId, id: profileId}, {responseType: 'blob'})
|
||||
.catch(this.util.handleError);
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
deleteProfile(profileId: string): Observable<any> {
|
||||
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> {
|
||||
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> {
|
||||
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> {
|
||||
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> {
|
||||
|
@ -100,24 +102,24 @@ export class ManageprofilesService {
|
|||
reportProgress: true
|
||||
};
|
||||
return this.http.post<ProfileData>(this.backendServerAddress + this.uploadProfileUrl, formData, options)
|
||||
.catch(this.util.handleError);
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
getSavedProfiles(): Observable<ProfileMetadata[]> {
|
||||
return this.http.get(this.backendServerAddress + this.getSavedProfilesUrl + `?user=${this.userId}`)
|
||||
.map(data => data['profiles'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(data => data['profiles']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
getExampleProfiles(): Observable<ExampleProfilesMetadata[]> {
|
||||
return this.http.get(this.backendServerAddress + this.getExampleProfilesUrl)
|
||||
.map(data => data['profiles'])
|
||||
.catch(this.util.handleError);
|
||||
.pipe(map(data => data['profiles']))
|
||||
.pipe(catchError(this.util.handleError));
|
||||
}
|
||||
|
||||
notifyProfile(communityId: string, profileId: string): Observable<any> {
|
||||
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 {Observable} from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Util} from '../util';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class SaveprofileService {
|
||||
|
@ -21,7 +22,7 @@ export class SaveprofileService {
|
|||
saveProfile(name: string, id: string, docName: string, dosNumber: number): Observable<any> {
|
||||
return this.http.post(this.backendServerAddress + this.saveProfileUrl,
|
||||
{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 {HttpErrorResponse} from '@angular/common/http';
|
||||
import { saveAs } from 'file-saver/FileSaver';
|
||||
import { Response } from '@angular/http';
|
||||
import {HttpErrorResponse, HttpResponse} from '@angular/common/http';
|
||||
import {ErrorObservable} from 'rxjs/observable/ErrorObservable';
|
||||
import { environment } from '../environments/environment';
|
||||
import {Observable} from 'rxjs';
|
||||
import {throwError} from 'rxjs/internal/observable/throwError';
|
||||
import {saveAs} from 'file-saver';
|
||||
|
||||
export class Util {
|
||||
|
||||
public handleError (err: HttpErrorResponse): ErrorObservable {
|
||||
public handleError (err: HttpErrorResponse): ErrorObservable<never> {
|
||||
if (err.error instanceof Error) {
|
||||
console.error('Client-side error occured.');
|
||||
} else {
|
||||
|
@ -21,7 +20,7 @@ export class Util {
|
|||
pos: 'top-center',
|
||||
timeout: 0
|
||||
});
|
||||
return Observable.throw(err || 'Server error');
|
||||
return throwError(err || 'Server error');
|
||||
}
|
||||
|
||||
public getUserId(): string {
|
||||
|
@ -54,7 +53,7 @@ export const saveFile = (blobContent: Blob, fileName: string) => {
|
|||
* by looking inside content-disposition
|
||||
* @param res http Response
|
||||
*/
|
||||
export const getFileNameFromResponseContentDisposition = (res: Response) => {
|
||||
export const getFileNameFromResponseContentDisposition = (res: HttpResponse<any>) => {
|
||||
const contentDisposition = res.headers.get('content-disposition') || '';
|
||||
const matches = /filename=([^;]+)/ig.exec(contentDisposition);
|
||||
const fileName = (matches[1] || 'untitled').trim();
|
||||
|
|
|
@ -1081,7 +1081,7 @@ header.uk-sticky-fixed .cm-results-count-section {
|
|||
flex-wrap: wrap;
|
||||
-ms-flex-align: start;
|
||||
-webkit-align-items: start;
|
||||
align-items: start;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 64px;
|
||||
}
|
||||
#child1 {
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
|
||||
export const environment = {
|
||||
production: false,
|
||||
miningbackendserveraddress: 'http://localhost:8080'
|
||||
miningbackendserveraddress: 'http://localhost'
|
||||
};
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
/** Evergreen browsers require these. **/
|
||||
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": [
|
||||
"test.ts"
|
||||
"test.ts",
|
||||
"polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"importHelpers": true,
|
||||
"outDir": "./dist/out-tsc",
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
|
@ -14,6 +15,8 @@
|
|||
"lib": [
|
||||
"es2017",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
"module": "es2015",
|
||||
"baseUrl": "./"
|
||||
}
|
||||
}
|
|
@ -14,8 +14,7 @@
|
|||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
true
|
||||
],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
|
|
|
@ -1695,7 +1695,7 @@ class NotifyHandler(BaseHandler):
|
|||
s.starttls()
|
||||
s.ehlo()
|
||||
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()
|
||||
|
||||
# write new profile to database
|
||||
|
|
Loading…
Reference in New Issue