Change version to 1.0.0

This commit is contained in:
kostis30fyllou 2019-05-31 15:30:55 +03:00
parent eb94b1ace3
commit cbfe3c2e6e
5 changed files with 67 additions and 58 deletions

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../environments/environment.prod';
@Component({
selector: 'app-root',
@ -8,7 +9,7 @@ import { Component, OnInit } from '@angular/core';
export class AppComponent implements OnInit {
private _userid = 'user5649231';
private _backendserveraddress = 'https://beta.services.openaire.eu/interactive-mining';
private _backendserveraddress = environment.miningbackendserveraddress;
private _isCommunityManager = 'true';
title = 'app';

View File

@ -17,7 +17,7 @@
<tfoot>
</tfoot>
<tbody>
<tr *ngFor="let profile of allUsersProfiles | paginate: config; let i = index">
<tr *ngFor="let profile of allUsersProfiles | paginate: allProfiles; let i = index">
<td class="uk-text-nowrap">{{profile.user}}</td>
<td class="uk-table-link">
<a class="uk-link-reset" (click)="loadUserProfileAdmin(profile.userId, profile.profileId, profile.profile)">{{profile.profile}}</a>
@ -36,8 +36,8 @@
</tbody>
</table>
<pagination-template *ngIf="allUsersProfiles.length" #p="paginationApi"
[id]="config.id"
(pageChange)="config.currentPage = $event">
[id]="allProfiles.id"
(pageChange)="allProfiles.currentPage = $event">
<ul class="uk-pagination uk-flex-center" uk-margin>
<li [class.uk-disabled]="p.isFirstPage()"><a (click)="p.previous()"><span uk-pagination-previous></span></a></li>
<li *ngFor="let page of p.pages" [class.uk-active]="p.getCurrent() === page.value">
@ -89,7 +89,7 @@
</div>
</td>
</tr>
<tr *ngFor="let profile of userSavedProfiles | paginate: config; let i = index">
<tr *ngFor="let profile of userSavedProfiles| paginate: userProfiles; let i = index" >
<!--<td class="download">-->
<!--<a class="uk-icon-link uk-icon" uk-icon="icon: download" contenteditable="false" (click)="downloadProfile(profile.id, profile.name)"></a>-->
<!--</td>-->
@ -99,7 +99,7 @@
<td class="cm-text-muted uk-text-nowrap">{{profile.datecreated}}</td>
<td class="cm-text-muted uk-text-nowrap">
<button *ngIf="!profile.notified && !pending" class="uk-button uk-button-secondary uk-button-small uk-text-center cm-margin" (click)="notifyProfile(profile)">Notify</button>
<button *ngIf="pending" class="uk-button uk-button-secondary uk-button-small uk-text-center cm-margin" disabled>Notifing... <span uk-spinner="ratio: 0.8"></span></button>
<button *ngIf="pending" class="uk-button uk-button-secondary uk-button-small uk-text-center cm-margin" disabled>Notifying... <span uk-spinner="ratio: 0.8"></span></button>
<span *ngIf="profile.notified " class="uk-label uk-label-success">Notified</span>
</td>
<td class="uk-text-nowrap uk-text-warning">{{profile.status}}</td>
@ -110,18 +110,18 @@
</tr>
</tbody>
</table>
<pagination-template *ngIf="userSavedProfiles.length" #p="paginationApi"
[id]="config.id"
(pageChange)="config.currentPage = $event">
<pagination-template *ngIf="userSavedProfiles.length" #u="paginationApi"
[id]="userProfiles.id"
(pageChange)="userProfiles.currentPage = $event">
<ul class="uk-pagination uk-flex-center" uk-margin>
<li [class.uk-disabled]="p.isFirstPage()"><a (click)="p.previous()"><span uk-pagination-previous></span></a></li>
<li *ngFor="let page of p.pages" [class.uk-active]="p.getCurrent() === page.value">
<a (click)="p.setCurrent(page.value)" *ngIf="p.getCurrent() !== page.value">
<li [class.uk-disabled]="u.isFirstPage()"><a (click)="u.previous()"><span uk-pagination-previous></span></a></li>
<li *ngFor="let page of u.pages" [class.uk-active]="u.getCurrent() === page.value">
<a (click)="u.setCurrent(page.value)" *ngIf="u.getCurrent() !== page.value">
<span>{{ page.label }}</span>
</a>
<span *ngIf="p.getCurrent() === page.value">{{ page.label }}</span>
<span *ngIf="u.getCurrent() === page.value">{{ page.label }}</span>
</li>
<li [class.uk-disabled]="p.isLastPage()"><a (click)="p.next()"><span uk-pagination-next></span></a></li>
<li [class.uk-disabled]="u.isLastPage()"><a (click)="u.next()"><span uk-pagination-next></span></a></li>
</ul>
</pagination-template>
</div>
@ -140,7 +140,7 @@
<!--&lt;!&ndash;</div>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<div *ngIf="userSavedProfiles.length" class="uk-container-small">
<div *ngIf="userSavedProfiles.length > 0" class="uk-container-small">
<a class="test-upload uk-button cm-button-primary uk-text-center cm-margin" (click)="createNewProfile()">
<span class="uk-text-middle">Create a new mining profile</span>
</a>

View File

@ -10,8 +10,7 @@ import {saveFile} from '../util';
@Component({
selector: 'app-manageprofiles',
templateUrl: './manageprofiles.component.html',
styleUrls: ['./manageprofiles.component.css']
templateUrl: './manageprofiles.component.html'
})
export class ManageprofilesComponent implements OnInit {
@ -30,8 +29,14 @@ export class ManageprofilesComponent implements OnInit {
public userSavedProfiles: Array<ProfileMetadata> = [];
public exampleProfiles: Array<ExampleProfilesMetadata> = [];
public config: PaginationInstance = {
id: 'custom',
public allProfiles: PaginationInstance = {
id: 'all',
itemsPerPage: 5,
currentPage: 1
};
public userProfiles: PaginationInstance = {
id: 'user',
itemsPerPage: 5,
currentPage: 1
};
@ -47,12 +52,12 @@ export class ManageprofilesComponent implements OnInit {
params => {
// console.log('queryParams', params['communityId']);
this.communityId = params['communityId'];
this.initialServerhandshake(this.communityId);
this.initialServerHandshake(this.communityId);
});
this.isCommunityManager = this.manageProfilesService.isCommunityManager === 'true';
}
initialServerhandshake(communityId: string): void {
private initialServerHandshake(communityId: string): void {
this.manageProfilesService.initialServerHandshake(communityId)
.subscribe(() => {
if (this.isCommunityManager) {
@ -63,7 +68,7 @@ export class ManageprofilesComponent implements OnInit {
});
}
getAllUsersProfiles(): void {
private getAllUsersProfiles(): void {
this.manageProfilesService.getUsersProfiles()
.subscribe(res => {
if (res) {
@ -72,6 +77,41 @@ export class ManageprofilesComponent implements OnInit {
});
}
private getSavedProfiles(): void {
this.manageProfilesService.getSavedProfiles()
.subscribe(res => {
if (res) {
this.userSavedProfiles = res;
}
});
}
private getExampleProfiles(): void {
this.manageProfilesService.getExampleProfiles()
.subscribe(res => this.exampleProfiles = res);
}
private clearLocalStorage(): void {
// clear localstorage values
localStorage.removeItem('grants');
localStorage.removeItem('profilename');
localStorage.removeItem('profileid');
localStorage.removeItem('docname');
localStorage.removeItem('docsnumber');
localStorage.removeItem('concepts');
localStorage.removeItem('poswords');
localStorage.removeItem('negwords');
localStorage.removeItem('contextprev');
localStorage.removeItem('contextmiddle');
localStorage.removeItem('contextnext');
localStorage.removeItem('wordssplitnum');
localStorage.removeItem('punctuation');
localStorage.removeItem('stopwords');
localStorage.removeItem('lowercase');
localStorage.removeItem('stemming');
localStorage.removeItem('documentarea');
}
loadUserProfileAdmin(userId: string, profileId: string, name: string): void {
this.manageProfilesService.loadUserProfileAdmin(userId, profileId)
.subscribe(res => {
@ -108,15 +148,6 @@ export class ManageprofilesComponent implements OnInit {
.subscribe();
}
getSavedProfiles(): void {
this.manageProfilesService.getSavedProfiles()
.subscribe(res => {
if (res) {
this.userSavedProfiles = res;
}
});
}
loadSavedProfile(id: string, name: string): void {
this.manageProfilesService.loadSavedProfile(id)
.subscribe(res => {
@ -193,14 +224,12 @@ export class ManageprofilesComponent implements OnInit {
}
}
getExampleProfiles(): void {
this.manageProfilesService.getExampleProfiles()
.subscribe(res => this.exampleProfiles = res);
}
notifyProfile(profile: ProfileMetadata ): void {
UIkit.modal.confirm('<span class="uk-text-bold">' +
'A notification will be sent to the OpenAIRE Mining experts, that your profile is in its final version!</br></br>Are you sure you want to proceed?</span>', {escClose: true}).then(() => {
'A notification will be sent to the OpenAIRE Mining experts, ' +
'that your profile is in its final version!</br></br>' +
'Are you sure you want to proceed?</span>', {escClose: true}).then(() => {
this.pending = true;
this.manageProfilesService.notifyProfile(this.communityId, profile.id)
.subscribe(res => {
@ -235,25 +264,4 @@ export class ManageprofilesComponent implements OnInit {
});
}
clearLocalStorage(): void {
// clear localstorage values
localStorage.removeItem('grants');
localStorage.removeItem('profilename');
localStorage.removeItem('profileid');
localStorage.removeItem('docname');
localStorage.removeItem('docsnumber');
localStorage.removeItem('concepts');
localStorage.removeItem('poswords');
localStorage.removeItem('negwords');
localStorage.removeItem('contextprev');
localStorage.removeItem('contextmiddle');
localStorage.removeItem('contextnext');
localStorage.removeItem('wordssplitnum');
localStorage.removeItem('punctuation');
localStorage.removeItem('stopwords');
localStorage.removeItem('lowercase');
localStorage.removeItem('stemming');
localStorage.removeItem('documentarea');
}
}

View File

@ -5,5 +5,5 @@
export const environment = {
production: false,
miningbackendserveraddress: 'http://localhost'
miningbackendserveraddress: 'http://localhost:8081'
};