Revision 53905
Added by Argiro Kokogiannaki over 5 years ago
modules/uoa-admin-portal/trunk/src/app/services/manageZenodoCommunities.service.ts | ||
---|---|---|
1 |
import {Injectable} from '@angular/core'; |
|
2 |
import {Http, Response, Headers, RequestOptions} from '@angular/http'; |
|
3 |
import {Observable} from 'rxjs/Observable'; |
|
4 |
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
|
5 |
|
|
6 |
import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; |
|
7 |
import { ErrorObservable } from 'rxjs/observable/ErrorObservable'; |
|
8 |
import { catchError } from 'rxjs/operators'; |
|
9 |
|
|
10 |
@Injectable() |
|
11 |
export class ManageZenodoCommunitiesService { |
|
12 |
constructor(private http: Http ) {} |
|
13 |
|
|
14 |
removeZCommunity (properties:EnvProperties,communityId: string,id: string):any { |
|
15 |
let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'}); |
|
16 |
let options = new RequestOptions({headers: headers, body: id}); |
|
17 |
|
|
18 |
let url = properties.communityAPI+communityId+"/zenodocommunities"; |
|
19 |
console.info(url); |
|
20 |
|
|
21 |
return this.http.delete(url, options) |
|
22 |
} |
|
23 |
|
|
24 |
addZCommunity(properties:EnvProperties, communityId: string,zenodoid: string) { |
|
25 |
let headers = new Headers({'Content-Type': 'application/json'}); |
|
26 |
let options = new RequestOptions({headers: headers}); |
|
27 |
|
|
28 |
let url = properties.communityAPI+communityId+"/zenodocommunities"; |
|
29 |
console.info(url); |
|
30 |
var zCommunity: any = { |
|
31 |
"communityId": communityId, |
|
32 |
|
|
33 |
"zenodoid": zenodoid |
|
34 |
}; |
|
35 |
console.info(zCommunity); |
|
36 |
return this.http.post(url, JSON.stringify(zCommunity), options) |
|
37 |
.map(res => <any> res.json()) |
|
38 |
} |
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
} |
modules/uoa-admin-portal/trunk/src/app/app.component.html | ||
---|---|---|
30 | 30 |
<span>Profile</span> |
31 | 31 |
</a> |
32 | 32 |
</li> |
33 |
<li> |
|
34 |
<a routerLink="/manage-subscribers" routerLinkActive="active" [queryParams]="{communityId: this.communityId}"> |
|
35 |
<span>Manage subscribers</span> |
|
36 |
</a> |
|
37 |
</li> |
|
38 |
<li> |
|
39 |
<a routerLink="/manage-user-notifications" routerLinkActive="active" [queryParams]="{communityId: this.communityId}"> |
|
40 |
<span>Manage user notifications (temporary position)</span> |
|
41 |
</a> |
|
42 |
</li> |
|
33 | 43 |
|
34 | 44 |
</ul> |
35 | 45 |
</li> |
... | ... | |
53 | 63 |
<span>Manage subjects</span> |
54 | 64 |
</a> |
55 | 65 |
</li> |
56 |
<!-- <li>
|
|
66 |
<li> |
|
57 | 67 |
<a routerLink="/manage-zenodo-communities" routerLinkActive="active" [queryParams]="{communityId: this.communityId}"> |
58 | 68 |
<span>Manage zenodo communities</span> |
59 | 69 |
</a> |
60 | 70 |
</li> |
61 |
<li> |
|
62 |
<a routerLink="/manage-subscribers" routerLinkActive="active" [queryParams]="{communityId: this.communityId}"> |
|
63 |
<span>Manage subscribers</span> |
|
64 |
</a> |
|
65 |
</li> |
|
66 |
<li> |
|
67 |
<a routerLink="/manage-user-notifications" routerLinkActive="active" [queryParams]="{communityId: this.communityId}"> |
|
68 |
<span>Manage user notifications (temporary position)</span> |
|
69 |
</a> |
|
70 |
</li> --> |
|
71 |
|
|
71 | 72 |
</ul> |
72 | 73 |
</li> |
73 | 74 |
<li *ngIf="isPortalAdministrator" class="uk-nav-header uk-parent"> |
modules/uoa-admin-portal/trunk/src/app/app.module.ts | ||
---|---|---|
49 | 49 |
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module'; |
50 | 50 |
import {FeedbackModule} from './openaireLibrary/sharedComponents/feedback/feedback.module'; |
51 | 51 |
import {CommunityEditFormModule} from './pages/community/community-edit-form/community-edit-form.module'; |
52 |
import {ManageZenodoCommunitiesModule} from './pages/zenodo-communities/manage-zenodo-communities.module';
|
|
52 |
import {ZenodoCommunitiesModule} from './pages/zenodo-communities/zenodo-communities.module';
|
|
53 | 53 |
import {ManageSubscribersModule} from './pages/subscribers/manage-subscribers.module'; |
54 | 54 |
import {SubjectsEditFormModule} from './pages/subjects/subjects-edit-form/subjects-edit-form.module'; |
55 | 55 |
import { LoginGuard} from './openaireLibrary/login/loginGuard.guard'; |
... | ... | |
100 | 100 |
CommunityProjectsModule, |
101 | 101 |
CommunityContentProvidersModule, |
102 | 102 |
CommunityEditFormModule, |
103 |
ManageZenodoCommunitiesModule,
|
|
103 |
ZenodoCommunitiesModule, |
|
104 | 104 |
ManageSubscribersModule, |
105 | 105 |
SubjectsEditFormModule, |
106 | 106 |
DataTablesModule, |
modules/uoa-admin-portal/trunk/src/app/app.routing.ts | ||
---|---|---|
6 | 6 |
|
7 | 7 |
import { DashboardComponent } from "./dashboard.component"; |
8 | 8 |
import { CommunitiesComponent } from './pages/community/communities.component'; |
9 |
import { ManageZenodoCommunitiesComponent } from "./pages/zenodo-communities/manage-zenodo-communities.component";
|
|
9 |
import { ZenodoCommunitiesComponent } from "./pages/zenodo-communities/zenodo-communities.component";
|
|
10 | 10 |
import { ManageSubscribersComponent } from "./pages/subscribers/manage-subscribers.component"; |
11 | 11 |
import { CommunityEditFormComponent } from "./pages/community/community-edit-form/community-edit-form.component"; |
12 | 12 |
import { SubjectsEditFormComponent } from "./pages/subjects/subjects-edit-form/subjects-edit-form.component"; |
... | ... | |
74 | 74 |
}, |
75 | 75 |
{ |
76 | 76 |
path: 'manage-zenodo-communities', |
77 |
component: ManageZenodoCommunitiesComponent,
|
|
77 |
component: ZenodoCommunitiesComponent, |
|
78 | 78 |
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver } |
79 | 79 |
}, |
80 | 80 |
{ |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/manage-zenodo-communities.service.ts | ||
---|---|---|
1 |
import {Injectable} from '@angular/core'; |
|
2 |
import {Http, Response} from '@angular/http'; |
|
3 |
import {Headers, RequestOptions} from '@angular/http'; |
|
4 |
import {Observable} from 'rxjs/Rx'; |
|
5 |
|
|
6 |
import {ZenodoCommunityInfo} from './zenodoCommunity/zenodoCommunityInfo'; |
|
7 |
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
8 |
|
|
9 |
@Injectable() |
|
10 |
export class ManageZenodoCommunitiesService { |
|
11 |
|
|
12 |
constructor(private http:Http) { |
|
13 |
} |
|
14 |
|
|
15 |
getZenodoCommunities(properties:EnvProperties, url: string) { |
|
16 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)) : url) |
|
17 |
.map(res => <any> res.json()).map(res => this.parseZenodoCommunities(res.hits.hits)); |
|
18 |
} |
|
19 |
|
|
20 |
parseZenodoCommunities(data: any): ZenodoCommunityInfo[] { |
|
21 |
let zenodoCommunities: ZenodoCommunityInfo[] = []; |
|
22 |
|
|
23 |
for (let i=0; i<data.length; i++) { |
|
24 |
let resData = data[i]; |
|
25 |
var result: ZenodoCommunityInfo = new ZenodoCommunityInfo(); |
|
26 |
|
|
27 |
result['title'] = resData.title; |
|
28 |
result['id'] = resData.id; |
|
29 |
result['description'] = resData.description; |
|
30 |
result['link'] = resData.links.html; |
|
31 |
result['logoUrl'] = resData.logo_url; |
|
32 |
result['date'] = resData.updated; |
|
33 |
result['page'] = resData.page; |
|
34 |
|
|
35 |
zenodoCommunities.push(result); |
|
36 |
} |
|
37 |
return zenodoCommunities; |
|
38 |
} |
|
39 |
|
|
40 |
getTotalZenodoCommunities(properties:EnvProperties, url: string) { |
|
41 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)) : url) |
|
42 |
.map(res => <any> res.json()).map(res => res.hits.total); |
|
43 |
} |
|
44 |
} |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/manage-zenodo-communities.module.ts | ||
---|---|---|
1 |
import {NgModule} from '@angular/core'; |
|
2 |
import {CommonModule} from '@angular/common'; |
|
3 |
import {FormsModule} from '@angular/forms'; |
|
4 |
import {RouterModule} from '@angular/router'; |
|
5 |
|
|
6 |
import {PagingModule} from '../../openaireLibrary/utils/paging.module'; |
|
7 |
import {ManageZenodoCommunitiesComponent} from './manage-zenodo-communities.component'; |
|
8 |
import {ManageZenodoCommunitiesService} from './manage-zenodo-communities.service'; |
|
9 |
|
|
10 |
@NgModule({ |
|
11 |
imports:[ |
|
12 |
CommonModule, FormsModule, RouterModule, |
|
13 |
PagingModule |
|
14 |
], |
|
15 |
declarations:[ |
|
16 |
ManageZenodoCommunitiesComponent |
|
17 |
], |
|
18 |
providers:[ |
|
19 |
ManageZenodoCommunitiesService |
|
20 |
], |
|
21 |
exports: [ |
|
22 |
ManageZenodoCommunitiesComponent |
|
23 |
] |
|
24 |
}) |
|
25 |
|
|
26 |
export class ManageZenodoCommunitiesModule { } |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/zenodo-communities.module.ts | ||
---|---|---|
1 |
import {NgModule} from '@angular/core'; |
|
2 |
import {CommonModule} from '@angular/common'; |
|
3 |
import {FormsModule} from '@angular/forms'; |
|
4 |
import {RouterModule} from '@angular/router'; |
|
5 |
|
|
6 |
import {PagingModule} from '../../openaireLibrary/utils/paging.module'; |
|
7 |
import {ManageZenodoCommunitiesComponent} from './manage-zenodo-communities.component'; |
|
8 |
import {AddZenodoCommunitiesComponent} from './add-zenodo-communities.component'; |
|
9 |
import {ZenodoCommunitiesComponent} from './zenodo-communities.component'; |
|
10 |
import {FABModule} from '../../utils/fabModule.module'; |
|
11 |
import { DataTablesModule } from 'angular-datatables'; |
|
12 |
import { SearchZenodoCommunitiesServiceModule } from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module'; |
|
13 |
import{ManageZenodoCommunitiesService} from '../../services/manageZenodoCommunities.service'; |
|
14 |
import{ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module'; |
|
15 |
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; |
|
16 |
|
|
17 |
@NgModule({ |
|
18 |
imports:[ |
|
19 |
CommonModule, FormsModule, RouterModule, |
|
20 |
PagingModule, FABModule, DataTablesModule, SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule, |
|
21 |
AlertModalModule |
|
22 |
], |
|
23 |
declarations:[ |
|
24 |
ManageZenodoCommunitiesComponent, ZenodoCommunitiesComponent, AddZenodoCommunitiesComponent |
|
25 |
], |
|
26 |
providers:[ |
|
27 |
ManageZenodoCommunitiesService |
|
28 |
], |
|
29 |
exports: [ |
|
30 |
ZenodoCommunitiesComponent |
|
31 |
] |
|
32 |
}) |
|
33 |
|
|
34 |
export class ZenodoCommunitiesModule { } |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/add-zenodo-communities.component.html | ||
---|---|---|
1 |
<div id="manage-zenodo-communities" class="uk-padding"> |
|
2 |
<form class="uk-text-center uk-animation uk-card uk-card-default uk-padding"> |
|
3 |
<div> |
|
4 |
<input type="text" class="uk-input uk-width-1-2" placeholder="Search zenodo communities" aria-describedby="sizing-addon2" [(ngModel)]="zenodoCommunitySearchUtils.keyword" name="keyword" > |
|
5 |
<button (click)="goTo(1)" type="submit" class=" uk-button"> |
|
6 |
<span class="uk-icon"> |
|
7 |
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg> |
|
8 |
</span>Search |
|
9 |
</button> |
|
10 |
</div> |
|
11 |
</form> |
|
12 |
|
|
13 |
<div *ngIf="zenodoCommunitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
|
14 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
|
15 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
|
16 |
{{zenodoCommunitySearchUtils.totalResults | number}} zenodo communities, page {{zenodoCommunitySearchUtils.page | number}} of {{(totalPages()) | number}} |
|
17 |
</span> |
|
18 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
|
19 |
<paging-no-load [currentPage]="zenodoCommunitySearchUtils.page" [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value)"></paging-no-load> |
|
20 |
</span> |
|
21 |
</div> |
|
22 |
</div> |
|
23 |
|
|
24 |
<ul class="uk-list uk-list-divider uk-margin"> |
|
25 |
|
|
26 |
<li *ngFor="let item of zenodoCommunities;" class="uk-animation-fade uk-margin-top"> |
|
27 |
<div class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid> |
|
28 |
<div class="uk-width-auto"> |
|
29 |
<a target="_blank" [href]="item.link"> |
|
30 |
<img *ngIf="item.logoUrl" class="uk-comment-avatar" src="{{item.logoUrl}}" width="80" height="80" alt=""> |
|
31 |
</a> |
|
32 |
</div> |
|
33 |
<div class="uk-width-expand"> |
|
34 |
<h4 class="uk-comment-title uk-margin-remove uk-grid"> |
|
35 |
<a class="custom-external uk-width-expand" target="_blank" href="{{item.link}}"> |
|
36 |
<span *ngIf="item.title">{{item.title}}</span> |
|
37 |
<span *ngIf="!item.title">[no name available]</span> |
|
38 |
</a> |
|
39 |
<span *ngIf=" masterCommunity && item.id==masterCommunity.id" class="uk-label uk-label-warning">Master zenodo community</span> |
|
40 |
<span class="uk-width-1-6 uk-text-center"> |
|
41 |
<a *ngIf="!inCommunity(item) && !(masterCommunity && item.id==masterCommunity.id)" (click)="addCommunity(item)" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add"></a> |
|
42 |
|
|
43 |
<span *ngIf="inCommunity(item)" class="uk-label uk-label-success">Added</span> |
|
44 |
|
|
45 |
<!-- <a *ngIf="inCommunity(item)" (click)="removeCommunity(item)" class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Undo"></a> --> |
|
46 |
</span> |
|
47 |
</h4> |
|
48 |
<div class="uk-comment-meta "> |
|
49 |
last update: {{item.date | date:'yyyy/MM/dd'}} |
|
50 |
</div> |
|
51 |
</div> |
|
52 |
</div> |
|
53 |
<div class="uk-comment-body uk-text-meta"> |
|
54 |
<p *ngIf="item.description">{{item.description}}</p> |
|
55 |
</div> |
|
56 |
</li> |
|
57 |
</ul> |
|
58 |
|
|
59 |
|
|
60 |
<div *ngIf="zenodoCommunitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
|
61 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
|
62 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
|
63 |
{{zenodoCommunitySearchUtils.totalResults | number}} zenodo communities, page {{zenodoCommunitySearchUtils.page | number}} of {{(totalPages()) | number}} |
|
64 |
</span> |
|
65 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
|
66 |
<paging-no-load [currentPage]="zenodoCommunitySearchUtils.page" [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value)"></paging-no-load> |
|
67 |
</span> |
|
68 |
</div> |
|
69 |
</div> |
|
70 |
|
|
71 |
</div> |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/manage-zenodo-communities.component.html | ||
---|---|---|
1 |
<div id="manage-zenodo-communities" class=" uk-card uk-card-default uk-padding"> |
|
2 |
<div class="uk-text-large uk-text-center uk-width-5-6@l uk-width">Manage zenodo communities</div> |
|
1 |
<div id="manage-zenodo-communities" class="uk-padding"> |
|
3 | 2 |
<form class="uk-text-center uk-animation uk-card uk-card-default uk-padding"> |
4 | 3 |
<div> |
5 | 4 |
<input type="text" class="uk-input uk-width-1-2" placeholder="Search zenodo communities" aria-describedby="sizing-addon2" [(ngModel)]="zenodoCommunitySearchUtils.keyword" name="keyword" > |
6 |
<button (click)="search()" type="submit" class=" uk-button">
|
|
5 |
<button (click)="goTo(1)" type="submit" class=" uk-button">
|
|
7 | 6 |
<span class="uk-icon"> |
8 | 7 |
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg> |
9 | 8 |
</span>Search |
... | ... | |
11 | 10 |
</div> |
12 | 11 |
</form> |
13 | 12 |
|
13 |
<div *ngIf="masterCommunity" class="uk-animation-fade uk-margin-top uk-background-muted uk-padding-small"> |
|
14 |
<div class="uk-text-large" >Master Zenodo community</div> |
|
15 |
<div class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid> |
|
16 |
|
|
17 |
<div class="uk-width-auto"> |
|
18 |
<a target="_blank" [href]="masterCommunity.link"> |
|
19 |
<img *ngIf="masterCommunity.logoUrl" class="uk-comment-avatar" src="{{masterCommunity.logoUrl}}" width="80" height="80" alt=""> |
|
20 |
</a> |
|
21 |
</div> |
|
22 |
<div class="uk-width-expand"> |
|
23 |
<h4 class="uk-comment-title uk-margin-remove"><a class="custom-external" target="_blank" href="{{masterCommunity.link}}"> |
|
24 |
<span *ngIf="masterCommunity.title">{{masterCommunity.title}}</span> |
|
25 |
<span *ngIf="!masterCommunity.title">[no name available]</span> |
|
26 |
</a> |
|
27 |
<!-- <span *ngIf=" masterCommunity && item.id==masterCommunity.id" class="uk-label uk-label-warning">Master zenodo community</span> --> |
|
28 |
<!-- <span class="uk-width-1-6 uk-text-center"> |
|
29 |
<a *ngIf="!inCommunity(item) && !(masterCommunity && item.id==masterCommunity.id)" (click)="addCommunity(item)" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add"></a> |
|
30 |
|
|
31 |
<span *ngIf="inCommunity(item)" class="uk-label uk-label-success">Added</span> |
|
32 |
|
|
33 |
<a *ngIf="inCommunity(item)" (click)="removeCommunity(item.id)" class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Undo"></a> |
|
34 |
|
|
35 |
</span> --> |
|
36 |
</h4> |
|
37 |
<div class="uk-comment-meta "> |
|
38 |
last update: {{masterCommunity.date | date:'yyyy/MM/dd'}} |
|
39 |
</div> |
|
40 |
</div> |
|
41 |
</div> |
|
42 |
<div class="uk-comment-body uk-text-meta"> |
|
43 |
<p *ngIf="masterCommunity.description">{{masterCommunity.description}}</p> |
|
44 |
</div> |
|
45 |
</div> |
|
14 | 46 |
<div *ngIf="zenodoCommunitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
15 | 47 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
16 | 48 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
17 |
{{zenodoCommunitySearchUtils.totalResults | number}} zenodo communities, page {{zenodoCommunitySearchUtils.page | number}} of {{(totalPages()) | number}}
|
|
49 |
{{zenodoCommunitySearchUtils.totalResults | number}} projects, page {{zenodoCommunitySearchUtils.page | number}} of {{(totalPages()) | number}}
|
|
18 | 50 |
</span> |
19 | 51 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
20 |
<paging-no-load [currentPage]="zenodoCommunitySearchUtils.page" [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value)"></paging-no-load> |
|
52 |
<paging-no-load [currentPage]="zenodoCommunitySearchUtils.page" [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value, false)"></paging-no-load>
|
|
21 | 53 |
</span> |
22 | 54 |
</div> |
23 | 55 |
</div> |
24 | 56 |
|
25 |
<table class="uk-table uk-table-responsive uk-table-divider"> |
|
26 |
<!-- <thead> |
|
27 |
<tr> |
|
28 |
<th class="uk-text-center">Zenodo Communities</th> |
|
29 |
</tr> |
|
30 |
</thead> --> |
|
31 |
<!-- <paging-no-load [currentPage]=1 [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value)"></paging-no-load> --> |
|
32 |
<tbody> |
|
33 |
<tr *ngFor="let item of zenodoCommunities;" > |
|
34 |
<td> |
|
35 |
<article class="uk-comment"> |
|
36 |
<header class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid> |
|
37 |
<div class="uk-width-auto"> |
|
38 |
<a target="_blank" [href]="item.link"> |
|
39 |
<img *ngIf="item.logoUrl" class="uk-comment-avatar" src="{{item.logoUrl}}" width="80" height="80" alt=""> |
|
40 |
<!-- <span *ngIf="!item.logoUrl">[no image available]</span> --> |
|
41 |
</a> |
|
42 |
</div> |
|
43 |
<div class="uk-width-expand"> |
|
44 |
<h4 class="uk-comment-title uk-margin-remove"><a class="custom-external" target="_blank" href="{{item.link}}"> |
|
45 |
<span *ngIf="item.title">{{item.title}}</span> |
|
46 |
<span *ngIf="!item.title">[no name available]</span></a></h4> |
|
47 |
<ul class="uk-comment-meta uk-subnav uk-subnav-divider uk-margin-remove-top"> |
|
48 |
<li>last update: {{item.date | date:'yyyy/MM/dd'}}</li> |
|
49 |
<!-- <li><a href="#">Reply</a></li> --> |
|
50 |
</ul> |
|
51 |
</div> |
|
52 |
</header> |
|
53 |
<div class="uk-comment-body uk-text-justify"> |
|
54 |
<p *ngIf="item.description">{{item.description}}</p> |
|
55 |
<p *ngIf="!item.description">[no description available]</p> |
|
56 |
</div> |
|
57 |
</article> |
|
57 |
<div class="custom-dataTable-content"> |
|
58 |
<div class="uk-overflow-container"> |
|
59 |
<table datatable class="uk-table uk-table-striped divider-table" [dtOptions]="dtOptions" id="dpTable" [dtTrigger]="dtTrigger" dtInstance="dtInstanceCallback"> |
|
60 |
<thead> |
|
61 |
<tr> |
|
62 |
<th class="uk-text-center">Name</th> |
|
63 |
<th class="uk-text-center">Last update on</th> |
|
64 |
<!-- <th class="uk-text-center">Funder</th> --> |
|
65 |
<th class="uk-text-center">Action</th> |
|
66 |
</tr> |
|
67 |
</thead> |
|
68 |
<tbody> |
|
69 |
<tr class="uk-table-middle" *ngFor="let item of selectedCommunities"> |
|
70 |
<td class="uk-text-center uk-width-1-4"> |
|
71 |
<a class="custom-external" target="_blank" href="{{item.link}}"> |
|
72 |
<span *ngIf="item.title">{{item.title}}</span> |
|
73 |
<span *ngIf="!item.title">[no name available]</span> |
|
74 |
</a> |
|
58 | 75 |
</td> |
59 |
</tr> |
|
60 |
</tbody> |
|
61 |
</table> |
|
76 |
<td class="uk-text-center uk-width-1-4"> |
|
77 |
<div class=" "> |
|
78 |
{{item.date | date:'yyyy/MM/dd'}} |
|
79 |
</div> |
|
80 |
</td> |
|
81 |
<!-- <td class="uk-text-center uk-width-1-4"> |
|
82 |
<span *ngIf="result.funder">{{result.funder}}</span> |
|
83 |
<span *ngIf="!result.funder">-</span> |
|
84 |
</td> --> |
|
62 | 85 |
|
63 |
<div *ngIf="zenodoCommunitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
|
64 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
|
65 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
|
66 |
{{zenodoCommunitySearchUtils.totalResults | number}} zenodo communities, page {{zenodoCommunitySearchUtils.page | number}} of {{(totalPages()) | number}} |
|
67 |
</span> |
|
68 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
|
69 |
<paging-no-load [currentPage]="zenodoCommunitySearchUtils.page" [totalResults]="zenodoCommunitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value)"></paging-no-load> |
|
70 |
</span> |
|
86 |
<td class="uk-text-center uk-width-1-4"> |
|
87 |
<a (click)="removeCommunity(item)" class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Undo"></a> |
|
88 |
|
|
89 |
</td> |
|
90 |
</tr> |
|
91 |
</tbody> |
|
92 |
</table> |
|
71 | 93 |
</div> |
72 | 94 |
</div> |
73 | 95 |
|
74 | 96 |
</div> |
97 |
<modal-alert #AlertModalDeleteCommunity (alertOutput)="confirmedDeleteCommunity($event)"></modal-alert> |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/zenodoCommunity/zenodoCommunityInfo.ts | ||
---|---|---|
1 |
export class ZenodoCommunityInfo { |
|
2 |
title: string; |
|
3 |
id: string; |
|
4 |
description: string; |
|
5 |
link: string; |
|
6 |
logoUrl: string; |
|
7 |
date: Date; |
|
8 |
page: string; |
|
9 |
} |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/add-zenodo-communities.component.ts | ||
---|---|---|
1 |
import {Component, OnInit, Input} from '@angular/core'; |
|
2 |
import {SimpleChanges, OnChanges} from '@angular/core'; |
|
3 |
import {FormGroup, FormArray, FormBuilder, Validators} from '@angular/forms'; |
|
4 |
import {ActivatedRoute, Router} from '@angular/router'; |
|
5 |
|
|
6 |
import {HelpContentService} from '../../services/help-content.service'; |
|
7 |
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
8 |
|
|
9 |
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; |
|
10 |
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; |
|
11 |
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; |
|
12 |
import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo'; |
|
13 |
|
|
14 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
|
15 |
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; |
|
16 |
import{ManageZenodoCommunitiesService} from '../../services/manageZenodoCommunities.service'; |
|
17 |
@Component({ |
|
18 |
selector: 'add-zenodo-communities', |
|
19 |
templateUrl: './add-zenodo-communities.component.html', |
|
20 |
}) |
|
21 |
|
|
22 |
export class AddZenodoCommunitiesComponent implements OnInit { |
|
23 |
|
|
24 |
public zenodoCommunities = null; // zenodo search API results |
|
25 |
public totalZenodoCommunities = null; |
|
26 |
@Input() properties:EnvProperties = null; |
|
27 |
@Input() communityId = null; |
|
28 |
|
|
29 |
public zenodoCommunitySearchUtils:SearchUtilsClass = new SearchUtilsClass(); |
|
30 |
|
|
31 |
private errorCodes: ErrorCodes; |
|
32 |
public rowsOnPage = 10; |
|
33 |
@Input() masterCommunity = null; |
|
34 |
@Input() selectedCommunities = []; |
|
35 |
constructor (private route: ActivatedRoute, |
|
36 |
private _router: Router, |
|
37 |
public _fb: FormBuilder, |
|
38 |
private _helpContentService: HelpContentService, |
|
39 |
private _zenodoCommunitieService: ZenodoCommunitiesService, |
|
40 |
private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) { |
|
41 |
|
|
42 |
this.errorCodes = new ErrorCodes(); |
|
43 |
this.zenodoCommunitySearchUtils.status = this.errorCodes.LOADING; |
|
44 |
} |
|
45 |
|
|
46 |
ngOnInit() { |
|
47 |
this.zenodoCommunitySearchUtils.keyword = ""; |
|
48 |
if(!Session.isLoggedIn()){ |
|
49 |
console.info(this._router.url); |
|
50 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
51 |
} else { |
|
52 |
if (this.communityId != null && this.communityId != '') { |
|
53 |
this._zenodoCommunitieService.getZenodoCommunities(this.properties, this.properties.zenodoCommunities+"?page="+this.zenodoCommunitySearchUtils.page+"&size="+this.rowsOnPage).subscribe( |
|
54 |
result => { |
|
55 |
this.zenodoCommunities = result[0]; |
|
56 |
this.totalZenodoCommunities = result[1]; |
|
57 |
this.zenodoCommunitySearchUtils.totalResults = result[1]; |
|
58 |
this.zenodoCommunitySearchUtils.page = 1; |
|
59 |
this.zenodoCommunitySearchUtils.size =this.rowsOnPage; |
|
60 |
|
|
61 |
}); |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
} |
|
66 |
|
|
67 |
public goTo(page:number = 1) { |
|
68 |
if(!Session.isLoggedIn()){ |
|
69 |
console.info(this._router.url); |
|
70 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
71 |
} else { |
|
72 |
this.zenodoCommunitySearchUtils.page=page; |
|
73 |
this._zenodoCommunitieService.getZenodoCommunities(this.properties, |
|
74 |
this.properties.zenodoCommunities+"?page="+this.zenodoCommunitySearchUtils.page |
|
75 |
+"&size="+this.rowsOnPage |
|
76 |
+((this.zenodoCommunitySearchUtils.keyword)?("&q="+this.zenodoCommunitySearchUtils.keyword):"") |
|
77 |
).subscribe( |
|
78 |
result => { |
|
79 |
this.zenodoCommunities = result[0]; |
|
80 |
this.totalZenodoCommunities = result[1]; |
|
81 |
this.zenodoCommunitySearchUtils.totalResults = result[1]; |
|
82 |
this.zenodoCommunitySearchUtils.size =this.rowsOnPage; |
|
83 |
}); |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 |
totalPages(): number { |
|
88 |
let totalPages:any = this.zenodoCommunitySearchUtils.totalResults/(this.rowsOnPage); |
|
89 |
if(!(Number.isInteger(totalPages))) { |
|
90 |
totalPages = (parseInt(totalPages, 10) + 1); |
|
91 |
} |
|
92 |
return totalPages; |
|
93 |
} |
|
94 |
|
|
95 |
|
|
96 |
public addCommunity(community) { |
|
97 |
if(!Session.isLoggedIn()){ |
|
98 |
console.info(this._router.url); |
|
99 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
100 |
} else { |
|
101 |
this._manageZenodoCommunitiesService.addZCommunity(this.properties, this.communityId, community.id ).subscribe( |
|
102 |
data => { |
|
103 |
console.info("data ADD"); |
|
104 |
console.info(data); |
|
105 |
// this.undo[project.id] = data.id; |
|
106 |
community["openaireId"]=data.id; |
|
107 |
this.selectedCommunities.push(community); |
|
108 |
}, |
|
109 |
err => { |
|
110 |
console.info("error ADD"); |
|
111 |
console.log(err.status); |
|
112 |
}, |
|
113 |
() => { |
|
114 |
console.info("completed ADD"); |
|
115 |
} |
|
116 |
) |
|
117 |
} |
|
118 |
} |
|
119 |
|
|
120 |
/* public removeCommunity( comm) { |
|
121 |
if(!Session.isLoggedIn()){ |
|
122 |
console.info(this._router.url); |
|
123 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
124 |
} else { |
|
125 |
var openaireId = this.getOpenaireId(comm); |
|
126 |
this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.communityId,openaireId, ).subscribe( |
|
127 |
data => { |
|
128 |
console.log(this.selectedCommunities.length); |
|
129 |
console.info("REMOVE: "+ this.communityId + " "+openaireId); |
|
130 |
console.log(comm); |
|
131 |
var pos = -1; |
|
132 |
for(var i=0; i< this.selectedCommunities.length;i++) { |
|
133 |
console.info(this.selectedCommunities[i].id+ " "+ this.selectedCommunities[i].openaireId+" "+ comm.id); |
|
134 |
if( this.selectedCommunities[i].id == comm.id) { |
|
135 |
pos= i; |
|
136 |
break; |
|
137 |
} |
|
138 |
} |
|
139 |
console.log(pos); |
|
140 |
if(pos != -1){ |
|
141 |
this.selectedCommunities.splice(pos, 1); |
|
142 |
} |
|
143 |
console.log(this.selectedCommunities.length); |
|
144 |
|
|
145 |
}, |
|
146 |
err => { |
|
147 |
console.info("error remove"); |
|
148 |
console.log(err.status); |
|
149 |
}, |
|
150 |
() => { |
|
151 |
console.info("completed remove"); |
|
152 |
} |
|
153 |
) |
|
154 |
} |
|
155 |
}*/ |
|
156 |
|
|
157 |
public inCommunity(community: any): any { |
|
158 |
for(let com of this.selectedCommunities) { |
|
159 |
if(com.id == community.id) { |
|
160 |
return true; |
|
161 |
} |
|
162 |
} |
|
163 |
return false; |
|
164 |
} |
|
165 |
public getOpenaireId(community: any): string { |
|
166 |
for(let com of this.selectedCommunities) { |
|
167 |
if(com.id == community.id) { |
|
168 |
return com.openaireId; |
|
169 |
} |
|
170 |
} |
|
171 |
return null; |
|
172 |
} |
|
173 |
} |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/manage-zenodo-communities.component.ts | ||
---|---|---|
1 |
import {Component, OnInit, Input} from '@angular/core'; |
|
1 |
import {Component, OnInit, Input, ViewChild} from '@angular/core';
|
|
2 | 2 |
import {SimpleChanges, OnChanges} from '@angular/core'; |
3 | 3 |
import {FormGroup, FormArray, FormBuilder, Validators} from '@angular/forms'; |
4 | 4 |
import {ActivatedRoute, Router} from '@angular/router'; |
5 |
import { Subject } from 'rxjs/Subject'; |
|
5 | 6 |
|
7 |
import { DataTableDirective } from 'angular-datatables'; |
|
8 |
|
|
6 | 9 |
import {HelpContentService} from '../../services/help-content.service'; |
7 | 10 |
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
8 | 11 |
|
9 | 12 |
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; |
10 | 13 |
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; |
11 |
import {ManageZenodoCommunitiesService} from './manage-zenodo-communities.service';
|
|
12 |
import {ZenodoCommunityInfo} from './zenodoCommunity/zenodoCommunityInfo';
|
|
14 |
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
|
15 |
import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo';
|
|
13 | 16 |
|
14 | 17 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
15 | 18 |
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; |
19 |
import{ManageZenodoCommunitiesService} from '../../services/manageZenodoCommunities.service'; |
|
16 | 20 |
|
17 | 21 |
@Component({ |
18 | 22 |
selector: 'manage-zenodo-communities', |
19 | 23 |
templateUrl: './manage-zenodo-communities.component.html', |
24 |
styles: [` |
|
25 |
#dpTable_info, #dpTable_paginate, #dpTable_length, #dpTable_filter{ |
|
26 |
display: none; |
|
27 |
} |
|
28 |
|
|
29 |
`] |
|
20 | 30 |
}) |
21 | 31 |
|
22 | 32 |
export class ManageZenodoCommunitiesComponent implements OnInit { |
33 |
@Input() properties:EnvProperties = null; |
|
34 |
@Input() communityId = null; |
|
23 | 35 |
|
24 |
public zenodoCommunities = null; |
|
25 |
public totalZenodoCommunities = null; |
|
26 |
public properties:EnvProperties = null; |
|
27 |
public communityId = null; |
|
28 |
|
|
29 | 36 |
public zenodoCommunitySearchUtils:SearchUtilsClass = new SearchUtilsClass(); |
30 | 37 |
|
31 | 38 |
private errorCodes: ErrorCodes; |
32 | 39 |
public rowsOnPage = 10; |
40 |
@Input() masterCommunity = null; |
|
41 |
@Input() selectedCommunities = []; |
|
33 | 42 |
|
43 |
@ViewChild(DataTableDirective) datatableElement: DataTableDirective; |
|
44 |
dtTrigger: Subject<any> = new Subject(); //necessary |
|
45 |
dtOptions: DataTables.Settings = {}; |
|
46 |
private triggered: boolean = false; |
|
47 |
|
|
48 |
@ViewChild('AlertModalDeleteCommunity') alertModalDeleteCommunity; |
|
49 |
selectedToDelete = null; |
|
34 | 50 |
constructor (private route: ActivatedRoute, |
35 | 51 |
private _router: Router, |
36 | 52 |
public _fb: FormBuilder, |
37 | 53 |
private _helpContentService: HelpContentService, |
38 |
private _manageΖenodoCommunitieService: ManageZenodoCommunitiesService) { |
|
54 |
private _ΖenodoCommunitieService: ZenodoCommunitiesService, |
|
55 |
private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) { |
|
39 | 56 |
|
40 | 57 |
this.errorCodes = new ErrorCodes(); |
41 | 58 |
this.zenodoCommunitySearchUtils.status = this.errorCodes.LOADING; |
59 |
this.zenodoCommunitySearchUtils.totalResults = this.selectedCommunities.length; |
|
42 | 60 |
} |
43 | 61 |
|
44 | 62 |
ngOnInit() { |
45 |
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { |
|
46 |
this.properties = data.envSpecific; |
|
47 |
this.route.queryParams.subscribe( |
|
48 |
communityId => { |
|
49 |
this.communityId = communityId['communityId']; |
|
50 |
if(!Session.isLoggedIn()){ |
|
51 |
console.info(this._router.url); |
|
52 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
53 |
} else { |
|
54 |
if (this.communityId != null && this.communityId != '') { |
|
55 |
this._manageΖenodoCommunitieService.getZenodoCommunities(this.properties, this.properties.zenodoCommunities+"?page="+this.zenodoCommunitySearchUtils.page+"&size="+this.rowsOnPage).subscribe( |
|
56 |
zenodoCommunities => { |
|
57 |
this.zenodoCommunities = zenodoCommunities; |
|
58 |
console.log(zenodoCommunities); |
|
59 |
console.log(this.zenodoCommunitySearchUtils.page); |
|
60 |
}); |
|
61 |
this._manageΖenodoCommunitieService.getTotalZenodoCommunities(this.properties, this.properties.zenodoCommunities).subscribe( |
|
62 |
totalZenodoCommunities => { |
|
63 |
this.totalZenodoCommunities = totalZenodoCommunities; |
|
64 |
this.zenodoCommunitySearchUtils.totalResults = totalZenodoCommunities; |
|
65 |
console.log(totalZenodoCommunities); |
|
66 |
}); |
|
67 |
} |
|
68 |
} |
|
69 |
}); |
|
70 |
}); |
|
71 | 63 |
|
64 |
// this.route.queryParams.subscribe( |
|
65 |
// communityId => { |
|
66 |
// this.communityId = communityId['communityId']; |
|
67 |
// if(!Session.isLoggedIn()){ |
|
68 |
// console.info(this._router.url); |
|
69 |
// this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
70 |
// } else { |
|
71 |
// if (this.communityId != null && this.communityId != '') { |
|
72 |
// this._ΖenodoCommunitieService.getZenodoCommunities(this.properties, this.properties.zenodoCommunities+"?page="+this.zenodoCommunitySearchUtils.page+"&size="+this.rowsOnPage).subscribe( |
|
73 |
// zenodoCommunities => { |
|
74 |
// this.zenodoCommunities = zenodoCommunities; |
|
75 |
// console.log(zenodoCommunities); |
|
76 |
// console.log(this.zenodoCommunitySearchUtils.page); |
|
77 |
// }); |
|
78 |
// this._ΖenodoCommunitieService.getTotalZenodoCommunities(this.properties, this.properties.zenodoCommunities).subscribe( |
|
79 |
// totalZenodoCommunities => { |
|
80 |
// this.totalZenodoCommunities = totalZenodoCommunities; |
|
81 |
// this.zenodoCommunitySearchUtils.totalResults = totalZenodoCommunities; |
|
82 |
// console.log(totalZenodoCommunities); |
|
83 |
// }); |
|
84 |
// } |
|
85 |
// } |
|
86 |
// }); |
|
87 |
|
|
72 | 88 |
this.zenodoCommunitySearchUtils.keyword = ""; |
73 |
} |
|
89 |
this.dtOptions = { |
|
90 |
// "paging": true, |
|
91 |
// "searching": true, |
|
92 |
// "lengthChange": false, |
|
93 |
"pageLength": this.rowsOnPage, |
|
94 |
"language": { |
|
95 |
"search": "", |
|
96 |
"searchPlaceholder": "Search projects..." |
|
97 |
} |
|
74 | 98 |
|
75 |
public search() { |
|
99 |
}; |
|
100 |
if(!this.triggered) { |
|
101 |
this.triggerInitialLoad(); |
|
102 |
} else { |
|
103 |
var table = $('#dpTable').DataTable(); |
|
104 |
table.clear(); |
|
105 |
|
|
106 |
this.rerender(); |
|
107 |
} |
|
108 |
|
|
109 |
|
|
110 |
} |
|
111 |
|
|
112 |
public ngOnDestroy() { |
|
113 |
|
|
114 |
$.fn['dataTable'].ext.search.pop(); |
|
115 |
} |
|
116 |
rerender(): void { |
|
117 |
this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => { |
|
118 |
// Destroy the table first |
|
119 |
dtInstance.destroy(); |
|
120 |
|
|
121 |
// Call the dtTrigger to rerender again |
|
122 |
this.dtTrigger.next(); |
|
123 |
}); |
|
124 |
} |
|
125 |
|
|
126 |
ngAfterViewInit(): void { |
|
127 |
$.fn['dataTable'].ext.search.push((settings, data, dataIndex) => { |
|
128 |
|
|
129 |
if (this.filterData(data, this.zenodoCommunitySearchUtils.keyword )) { |
|
130 |
return true; |
|
131 |
} |
|
132 |
return false; |
|
133 |
}); |
|
134 |
|
|
135 |
console.info("ngAfterViewInit"); |
|
136 |
} |
|
137 |
|
|
138 |
filterData(row: any, query: string) { |
|
139 |
let returnValue: boolean = false; |
|
140 |
|
|
141 |
if(query) { |
|
142 |
for(var i=0; i <3; i++){ |
|
143 |
var r= this.filterQuery(row[i], query); |
|
144 |
if(r) { |
|
145 |
returnValue = true; |
|
146 |
break; |
|
147 |
} |
|
148 |
} |
|
149 |
|
|
150 |
if(!returnValue) { |
|
151 |
return false; |
|
152 |
} |
|
153 |
} |
|
154 |
|
|
155 |
return true; |
|
156 |
} |
|
157 |
|
|
158 |
filterQuery(data, query){ |
|
159 |
if(data.toLowerCase().indexOf(query.toLowerCase()) > -1){ |
|
160 |
return true; |
|
161 |
}else{ |
|
162 |
return false; |
|
163 |
} |
|
164 |
} |
|
165 |
|
|
166 |
|
|
167 |
/* |
|
168 |
Trigger a table draw in order to get the initial filtering |
|
169 |
*/ |
|
170 |
triggerInitialLoad(){ |
|
171 |
this.triggered = true; |
|
172 |
console.info("triggerInitialLoad"); |
|
173 |
setTimeout(function(){ |
|
174 |
var table = (<any>$('#dpTable')).DataTable(); |
|
175 |
table.page( 0 ).draw( false ); |
|
176 |
}, 500); |
|
177 |
this.dtTrigger.next(); |
|
178 |
} |
|
179 |
|
|
180 |
goTo(page:number = 1){ |
|
181 |
this.zenodoCommunitySearchUtils.page=page; |
|
182 |
|
|
183 |
var table = $('#dpTable').DataTable(); |
|
184 |
table.page( page - 1 ).draw( false ); |
|
185 |
|
|
186 |
var info = table.page.info(); |
|
187 |
console.info("records: "+info.recordsDisplay); |
|
188 |
this.zenodoCommunitySearchUtils.totalResults = info.recordsDisplay; |
|
189 |
} |
|
190 |
|
|
191 |
public confirmedDeleteCommunity(data : any) { |
|
192 |
// if(!Session.isLoggedIn()){ |
|
193 |
// console.info(this._router.url); |
|
194 |
// this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
195 |
// } else { |
|
196 |
// console.info("REMOVE: "+ this.selectedCommunityProject.id); |
|
197 |
// this.subRemove = this._manageCommunityProjectsService.removeProject(this.properties, this.community, this.selectedCommunityProject.id).subscribe( |
|
198 |
// data => { |
|
199 |
// console.info("data REMOVE"); |
|
200 |
// console.info(data); |
|
201 |
// }, |
|
202 |
// err => { |
|
203 |
// console.info("error REMOVE"); |
|
204 |
// console.log(err); |
|
205 |
// }, |
|
206 |
// () => { |
|
207 |
// console.info("completed REMOVE"); |
|
208 |
// let index = this.communityProjects.indexOf(this.selectedCommunityProject); |
|
209 |
// this.communityProjects.splice(index, 1); |
|
210 |
// |
|
211 |
// this.communitySearchUtils.totalResults--; |
|
212 |
// this.communitySearchUtils.page=1; |
|
213 |
// |
|
214 |
// this.rerender(); |
|
215 |
// } |
|
216 |
// ) |
|
217 |
// } |
|
76 | 218 |
if(!Session.isLoggedIn()){ |
77 | 219 |
console.info(this._router.url); |
78 | 220 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
79 | 221 |
} else { |
80 |
this.zenodoCommunitySearchUtils.page = 1; |
|
81 |
if (this.communityId != null && this.communityId != '') { |
|
82 |
this._manageΖenodoCommunitieService.getZenodoCommunities(this.properties, this.properties.zenodoCommunities+"?q="+this.zenodoCommunitySearchUtils.keyword+"&page="+this.zenodoCommunitySearchUtils.page+"&size="+this.rowsOnPage).subscribe( |
|
83 |
zenodoCommunities => { |
|
84 |
this.zenodoCommunities = zenodoCommunities; |
|
85 |
console.log(zenodoCommunities); |
|
86 |
}); |
|
87 |
} |
|
222 |
console.info("REMOVE: "+ this.communityId + " "+this.selectedToDelete.openaireId); |
|
223 |
this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.communityId,this.selectedToDelete.openaireId ).subscribe( |
|
224 |
data => { |
|
225 |
var pos = -1; |
|
226 |
for(var i=0; i< this.selectedCommunities.length;i++) { |
|
227 |
if( this.selectedCommunities[i].id == this.selectedToDelete.id) { |
|
228 |
pos= i; |
|
229 |
break; |
|
230 |
} |
|
231 |
} |
|
232 |
if(pos != -1){ |
|
233 |
this.selectedCommunities.splice(pos, 1); |
|
234 |
} |
|
235 |
|
|
236 |
var table = $('#dpTable').DataTable(); |
|
237 |
table.clear(); |
|
238 |
|
|
239 |
this.rerender(); |
|
240 |
|
|
241 |
}, |
|
242 |
err => { |
|
243 |
console.info("error remove"); |
|
244 |
console.log(err.status); |
|
245 |
}, |
|
246 |
() => { |
|
247 |
console.info("completed remove"); |
|
248 |
} |
|
249 |
) |
|
88 | 250 |
} |
89 | 251 |
} |
90 | 252 |
|
91 |
public goTo(page:number = 1) {
|
|
253 |
public removeCommunity( comm) {
|
|
92 | 254 |
if(!Session.isLoggedIn()){ |
93 | 255 |
console.info(this._router.url); |
94 | 256 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
95 | 257 |
} else { |
96 |
this.zenodoCommunitySearchUtils.page=page; |
|
97 |
console.log("Page is: "+page); |
|
98 |
this._manageΖenodoCommunitieService.getZenodoCommunities(this.properties, this.properties.zenodoCommunities+"?page="+this.zenodoCommunitySearchUtils.page+"&size="+this.rowsOnPage).subscribe( |
|
99 |
zenodoCommunities => { |
|
100 |
this.zenodoCommunities = zenodoCommunities; |
|
101 |
console.log(zenodoCommunities); |
|
102 |
console.log(this.zenodoCommunitySearchUtils.page); |
|
103 |
}); |
|
258 |
this.selectedToDelete = comm; |
|
259 |
this.alertModalDeleteCommunity.cancelButton = true; |
|
260 |
this.alertModalDeleteCommunity.okButton = true; |
|
261 |
this.alertModalDeleteCommunity.alertTitle = "Remove zenodo community?"; |
|
262 |
let title = ""; |
|
263 |
if(comm.title) { |
|
264 |
title = comm.title; |
|
265 |
} |
|
266 |
|
|
267 |
|
|
268 |
this.alertModalDeleteCommunity.message = "Zenodo community"; |
|
269 |
if(title) { |
|
270 |
this.alertModalDeleteCommunity.message += " '"+title+"' "; |
|
271 |
} |
|
272 |
this.alertModalDeleteCommunity.message += "will be removed from your community. Are you sure?"; |
|
273 |
this.alertModalDeleteCommunity.okButtonText = "Yes"; |
|
274 |
this.alertModalDeleteCommunity.open(); |
|
104 | 275 |
} |
105 | 276 |
} |
106 | 277 |
|
107 |
totalPages(): number { |
|
108 |
let totalPages:any = this.zenodoCommunitySearchUtils.totalResults/(this.rowsOnPage); |
|
109 |
if(!(Number.isInteger(totalPages))) { |
|
110 |
totalPages = (parseInt(totalPages, 10) + 1); |
|
111 |
} |
|
112 |
return totalPages; |
|
113 |
} |
|
278 |
// public removeCommunity( comm) { |
|
279 |
// if(!Session.isLoggedIn()){ |
|
280 |
// console.info(this._router.url); |
|
281 |
// this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
282 |
// } else { |
|
283 |
// console.info("REMOVE: "+ this.communityId + " "+comm.openaireId); |
|
284 |
// this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.communityId,comm.openaireId ).subscribe( |
|
285 |
// data => { |
|
286 |
// var pos = -1; |
|
287 |
// for(var i=0; i< this.selectedCommunities.length;i++) { |
|
288 |
// if( this.selectedCommunities[i].id == comm.id) { |
|
289 |
// pos= i; |
|
290 |
// break; |
|
291 |
// } |
|
292 |
// } |
|
293 |
// if(pos != -1){ |
|
294 |
// this.selectedCommunities.splice(pos, 1); |
|
295 |
// } |
|
296 |
// |
|
297 |
// }, |
|
298 |
// err => { |
|
299 |
// console.info("error remove"); |
|
300 |
// console.log(err.status); |
|
301 |
// }, |
|
302 |
// () => { |
|
303 |
// console.info("completed remove"); |
|
304 |
// } |
|
305 |
// ) |
|
306 |
// } |
|
307 |
// } |
|
308 |
|
|
114 | 309 |
} |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/remove-projects.component.html | ||
---|---|---|
1 |
<div class="uk-child-width-expand@s uk-text-center uk-margin-bottom" uk-grid> |
|
2 |
<div> |
|
3 |
<form class=" uk-animation uk-card uk-card-default uk-padding" > |
|
4 |
<div> |
|
5 |
<select class="uk-select" [(ngModel)]="selectedFunder" name="select_funder" > |
|
6 |
<option value="" (click)="goTo(1)">Select funder:</option> |
|
7 |
<option *ngFor="let funder of funders" [value]="funder" (click)="goTo(1)">{{funder}}</option> |
|
8 |
</select> |
|
9 |
</div> |
|
10 |
</form> |
|
11 |
</div> |
|
12 |
<div> |
|
13 |
<form class="uk-text-center uk-animation uk-card uk-card-default uk-padding"> |
|
14 |
<div> |
|
15 |
<input type="text" class="uk-input uk-width-1-2" placeholder="Search community projects..." aria-describedby="sizing-addon2" [(ngModel)]="communitySearchUtils.keyword" name="keyword" > |
|
16 |
<button (click)="goTo(1)" type="submit" class=" uk-button"> |
|
17 |
<span class="uk-icon"> |
|
18 |
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg> |
|
19 |
</span>Search |
|
20 |
</button> |
|
21 |
</div> |
|
22 |
</form> |
|
23 |
</div> |
|
24 |
</div> |
|
25 |
|
|
26 |
<errorMessages [status]="[communitySearchUtils.status]" [type]="'community projects'"></errorMessages> |
|
27 |
|
|
28 |
<div *ngIf="communitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
|
29 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
|
30 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
|
31 |
{{communitySearchUtils.totalResults | number}} projects, page {{communitySearchUtils.page | number}} of {{(totalPages()) | number}} |
|
32 |
</span> |
|
33 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
|
34 |
<paging-no-load [currentPage]="communitySearchUtils.page" [totalResults]="communitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value, false)"></paging-no-load> |
|
35 |
</span> |
|
36 |
</div> |
|
37 |
</div> |
|
38 |
|
|
39 |
<!-- uk-first-column uk-width-expand --> |
|
40 |
<div class="custom-dataTable-content"> |
|
41 |
<div class="uk-overflow-container"> |
|
42 |
<table datatable class="uk-table uk-table-striped divider-table" [dtOptions]="dtOptions" id="dpTable" [dtTrigger]="dtTrigger" dtInstance="dtInstanceCallback"> |
|
43 |
<thead> |
|
44 |
<tr> |
|
45 |
<th class="uk-text-center">Project</th> |
|
46 |
<th class="uk-text-center">Grant Id</th> |
|
47 |
<th class="uk-text-center">Funder</th> |
|
48 |
<th class="uk-text-center">Action</th> |
|
49 |
</tr> |
|
50 |
</thead> |
|
51 |
<tbody> |
|
52 |
<tr class="uk-table-middle" *ngFor="let result of communityProjects"> |
|
53 |
<td class="uk-text-center uk-width-1-4"> |
|
54 |
<a class="custom-external" target="_blank" |
|
55 |
[href]="communityUrl+'/search/project?' + ((result.openaireId) ? 'projectId='+result.openaireId : 'grantId='+result.grantId+'&funder='+result.funder)"> |
|
56 |
<span *ngIf="result.name">{{result.name}}</span> |
|
57 |
<span *ngIf="result.name && result.acronym">(</span><span *ngIf="result.acronym">{{result.acronym}}</span><span *ngIf="result.name && result.acronym">)</span> |
|
58 |
<span *ngIf="!result.name && !result.acronym">[no title available]</span> |
|
59 |
</a> |
|
60 |
</td> |
|
61 |
<td class="uk-text-center uk-width-1-4"> |
|
62 |
<span *ngIf="result.grantId">{{result.grantId}}</span> |
|
63 |
<span *ngIf="!result.grantId">-</span> |
|
64 |
</td> |
|
65 |
<td class="uk-text-center uk-width-1-4"> |
|
66 |
<span *ngIf="result.funder">{{result.funder}}</span> |
|
67 |
<span *ngIf="!result.funder">-</span> |
|
68 |
</td> |
|
69 |
|
|
70 |
<td class="uk-text-center uk-width-1-4"> |
|
71 |
<a (click)="removeProject(result)" class="uk-icon-button remove red_background_color red_color" uk-icon="icon: close; ratio: 1" title="Remove"></a> |
|
72 |
</td> |
|
73 |
</tr> |
|
74 |
</tbody> |
|
75 |
</table> |
|
76 |
</div> |
|
77 |
</div> |
|
78 |
|
|
79 |
<div *ngIf="communitySearchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> |
|
80 |
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom"> |
|
81 |
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m"> |
|
82 |
{{communitySearchUtils.totalResults | number}} projects, page {{communitySearchUtils.page | number}} of {{(totalPages()) | number}} |
|
83 |
</span> |
|
84 |
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> |
|
85 |
<paging-no-load [currentPage]="communitySearchUtils.page" [totalResults]="communitySearchUtils.totalResults" [size]="10" (pageChange)="goTo($event.value, false)"></paging-no-load> |
|
86 |
</span> |
|
87 |
</div> |
|
88 |
</div> |
|
89 |
|
|
90 |
<modal-alert #AlertModalDeleteCommunity (alertOutput)="confirmedDeleteProject($event)"></modal-alert> |
|
91 |
<!-- <delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeleteProject($event)"> |
|
92 |
Are you sure you want to remove the selected project from your community? |
|
93 |
</delete-confirmation-dialog> --> |
|
94 |
<!-- </div> --> |
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/zenodo-communities.component.ts | ||
---|---|---|
1 |
import { Component, ViewChild, OnInit, ViewEncapsulation, Input } from '@angular/core'; |
|
2 |
import { ActivatedRoute, Router } from "@angular/router"; |
|
3 |
|
|
4 |
import {ManageZenodoCommunitiesComponent} from './manage-zenodo-communities.component'; |
|
5 |
import {AddZenodoCommunitiesComponent} from './add-zenodo-communities.component'; |
|
6 |
|
|
7 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
|
8 |
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; |
|
9 |
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
10 |
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; |
|
11 |
import { SearchZenodoCommunitiesService } from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service'; |
|
12 |
|
|
13 |
import {CommunityService} from "../../openaireLibrary/connect/community/community.service"; |
|
14 |
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo'; |
|
15 |
|
|
16 |
@Component({ |
|
17 |
selector: 'zenodo-communities', |
|
18 |
template: ` |
|
19 |
<div id="manage-communities"> |
|
20 |
<div class="menubar uk-margin-bottom "> |
|
21 |
<a *ngIf="!toggle" (click)="updateCommunityProjects()" uk-toggle="target: .toggle-usage" class="uk-button uk-button-primary uk-float-right">{{toggleLinkMessage}}</a> |
|
22 |
<div class="manage-projects-title uk-text-large">{{pageTitle}}</div> |
|
23 |
</div> |
|
24 |
|
|
25 |
<div class="toggle-usage"> |
|
26 |
|
|
27 |
<manage-zenodo-communities [masterCommunity]=masterZenodoCommunity [(selectedCommunities)]=selectedCommunities [properties]=properties [communityId]=communityId ></manage-zenodo-communities> |
|
28 |
<fab (clicked)="updateCommunityProjects()" uk-toggle="target: .toggle-usage"></fab> |
|
29 |
</div> |
|
30 |
<div class="toggle-usage" hidden> |
|
31 |
<add-zenodo-communities [masterCommunity]=masterZenodoCommunity [(selectedCommunities)]=selectedCommunities [properties]=properties [communityId]=communityId ></add-zenodo-communities> |
|
32 |
</div> |
|
33 |
</div> |
|
34 |
` |
|
35 |
}) |
|
36 |
// |
|
37 |
export class ZenodoCommunitiesComponent implements OnInit { |
|
38 |
private communityId: string = null; |
|
39 |
private community:CommunityInfo = null; |
|
40 |
|
|
41 |
@Input() communityProjects =[]; |
|
42 |
@ViewChild (ManageZenodoCommunitiesComponent) manageZenodoCommunitiesComponent : ManageZenodoCommunitiesComponent ; |
|
43 |
@ViewChild (AddZenodoCommunitiesComponent) addZenodoCommunitiesComponent : AddZenodoCommunitiesComponent ; |
|
44 |
|
|
45 |
public warningMessage = ""; |
|
46 |
public infoMessage = ""; |
|
47 |
|
|
48 |
public toggle: boolean = true; |
|
49 |
public updateCommunityProjectsOnToggle: boolean = false; |
|
50 |
public pageTitle: string = "Manage zenodo communities"; |
|
51 |
public toggleLinkMessage: string = "Manage zenodo communities"; |
|
52 |
|
|
53 |
masterZenodoCommunityId = null; |
|
54 |
masterZenodoCommunity = null; |
|
55 |
public properties:EnvProperties = null; |
|
56 |
|
|
57 |
selectedCommunityIds = null;//["ecfunded", "zenodo", "lory_hslu", "cs19", "","hbp","dighl", "wind_energy", "lory", "fp7-bmc","fp7postgrantoapilotoutputs","cernopenlab"]; |
|
58 |
selectedCommunities = []; |
|
59 |
constructor(private route: ActivatedRoute, private _router: Router, private _ΖenodoCommunitieService: ZenodoCommunitiesService,private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) {} |
|
60 |
ngOnInit() { |
|
61 |
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { |
|
62 |
this.properties = data.envSpecific; |
|
63 |
this.route.queryParams.subscribe(params => { |
|
64 |
if(params['communityId']) { |
|
65 |
this.communityId = params['communityId']; |
|
66 |
if(!Session.isLoggedIn()){ |
|
67 |
console.info(this._router.url); |
|
68 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
69 |
} else { |
|
70 |
if (this.communityId != null && this.communityId != '') { |
|
71 |
//TODO |
|
72 |
// this.showLoading = true; |
|
73 |
// this.updateErrorMessage = ""; |
|
74 |
// this.errorMessage = ""; |
|
75 |
|
|
76 |
this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe ( |
|
77 |
community => { |
|
78 |
this.community = community; |
|
79 |
this.masterZenodoCommunityId = this.community.zenodoCommunity; |
|
80 |
console.log |
|
81 |
if(this.masterZenodoCommunityId){ |
|
82 |
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities+this.masterZenodoCommunityId, null).subscribe( |
|
83 |
result => { |
|
84 |
this.masterZenodoCommunity = result; |
|
85 |
|
|
86 |
}); |
|
87 |
} |
|
88 |
// this.showLoading = false; |
|
89 |
}, |
|
90 |
error => {} //this.handleError('System error retrieving community profile', error) |
|
91 |
); |
|
92 |
|
|
93 |
this._searchZenodoCommunitiesService.searchZCommunities(this.properties,this.communityId).subscribe ( |
|
94 |
result => { |
|
95 |
this.selectedCommunityIds = result; |
|
96 |
|
|
97 |
for(let i=0; i< this.selectedCommunityIds.length; i++){ |
|
98 |
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities+this.selectedCommunityIds[i]["zenodoid"], this.selectedCommunityIds[i]["id"]).subscribe( |
|
99 |
result => { |
|
100 |
this.selectedCommunities.push(result); |
|
101 |
|
|
102 |
}); |
|
103 |
} |
|
104 |
// this.showLoading = false; |
|
105 |
}, |
|
106 |
error => {} //this.handleError('System error retrieving community profile', error) |
|
107 |
); |
|
108 |
//https://dev-openaire.d4science.org/openaire/community/dh-ch/zenodocommunities |
|
109 |
|
|
110 |
} |
|
111 |
} |
|
112 |
|
|
113 |
|
|
114 |
} |
|
115 |
}); |
|
116 |
}); |
|
117 |
} |
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
public ngOnDestroy() {} |
|
122 |
|
|
123 |
public updateCommunityProjects() { |
|
124 |
if(!Session.isLoggedIn()){ |
|
125 |
console.info(this._router.url); |
|
126 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
127 |
} else { |
|
128 |
this.toggle = !this.toggle; |
|
129 |
if(this.toggle) { |
|
130 |
this.pageTitle = "Manage zenodo communities"; |
|
131 |
//TODO |
|
132 |
// this.manageProjectsComponent._getCommunityProjects(); |
|
133 |
// this.addProjectsComponent.undo = {}; |
|
134 |
|
|
135 |
} else { |
|
136 |
this.updateCommunityProjectsOnToggle = false; |
|
137 |
this.pageTitle = "Search zenodo communities"; |
|
138 |
//this.toggleLinkMessage = "Manage projects"; |
|
139 |
} |
|
140 |
} |
|
141 |
} |
|
142 |
//TODO |
|
143 |
// public communityProjectsChanged($event) { |
|
144 |
// this.communityProjects = $event.value; |
|
145 |
// } |
|
146 |
|
|
147 |
// public updateCommunityProjects($event) { |
|
148 |
// this.updateCommunityProjectsOnToggle = true; |
|
149 |
// } |
|
150 |
} |
modules/uoa-admin-portal/trunk/package.json | ||
---|---|---|
4 | 4 |
"license": "MIT", |
5 | 5 |
"scripts": { |
6 | 6 |
"ng": "ng", |
7 |
"start": "ng serve --host 0.0.0.0 --disable-host-check", |
|
7 |
"start": "ng serve --host 0.0.0.0 --disable-host-check --port=5000",
|
|
8 | 8 |
"build": "ng build", |
9 | 9 |
"test": "ng test", |
10 | 10 |
"lint": "ng lint", |
Also available in: Unified diff
zenodo communities:
add-zenodo-communities
complete searching in zenodo API
add button for save a zenodo community
manage-zenodo-communities
fetch and display selected communities from CNR API (datatables: initial rendering is not properly working)
remove button
general page that toggles the above views