[Connect Admin | new-theme]: Updated messages when no results in affiliations, data sources, projects, subjects, zenodo communities | [Bug fix] In add projects, show selected filter if exists (even when no results).
1. affiliations.component.html: Updated "no organizations found" message to "no organizations for {{community}}". 2. add-content-providers.component.html: When no data sources, show info message for missing data sources too. 3. add-content-providers.component.ts: Created get method infoMessage() to return info message for missing data sources. 4. manage-content-providers.component.ts: In <add-content-providers> renamed hash to #addContentProvidersModal. 5. remove-content-providers.component.html & remove-projects.component.html & subjects-edit-form.component.html & manage-zenodo-communities.component.html: Show proper messages if no results at all or if filters return no results. 6. add-projects.component.ts: Created get method infoMessage() to return info message for missing projects | Added field selectedFunder and in getSelectedValues() return selectedFunder if no values from search query. 7. add-projects.component.html: When no projects, show info message for missing funders too | Do not show filters column when no results | Show selectedFunder in selected filters. 8. manage-projects.component.ts: In <fs-modal> renamed hash to #fsModalProjects and in <add-projects> renamed hash to #addProjects. 9. remove-projects.component.ts: Removed old Session.isLoggedIn() checks.
This commit is contained in:
parent
b429819cb6
commit
b7751d297b
|
@ -29,7 +29,7 @@
|
||||||
<div *ngIf="!loading">
|
<div *ngIf="!loading">
|
||||||
<div *ngIf="affiliations.length == 0"
|
<div *ngIf="affiliations.length == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No organizations found</div>
|
<div>No organizations for {{community.shortTitle}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="affiliations.length > 0">
|
<div *ngIf="affiliations.length > 0">
|
||||||
<no-load-paging (pageChange)="updatePage($event)" [page]="page" [totalResults]="affiliations.length"
|
<no-load-paging (pageChange)="updatePage($event)" [page]="page" [totalResults]="affiliations.length"
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
<div class="uk-section uk-flex uk-flex-center uk-flex uk-flex-middle">
|
<div class="uk-section uk-flex uk-flex-center uk-flex uk-flex-middle">
|
||||||
<div class="uk-width-auto uk-margin-right">
|
<div class="uk-width-auto uk-margin-right">
|
||||||
<a uk-icon="icon: info; ratio: 1.3"></a>
|
<a uk-icon="icon: info; ratio: 1.3"></a>
|
||||||
<div *ngIf="community" class="uk-dropdown uk-padding-small uk-width-medium" uk-dropdown="mode: hover">
|
<div *ngIf="community" class="uk-dropdown uk-padding-small uk-width-medium" uk-dropdown="mode: hover"
|
||||||
If you cannot find a <span class="uk-text-lowercase">{{openAIREEntities.DATASOURCE}}</span> relevant to your community, probably it is not OpenAIRE compliant.
|
[innerHTML]="infoMessage">
|
||||||
Feel free to contact us
|
|
||||||
(<a
|
|
||||||
[href]="'mailto:' + properties.feedbackmailForMissingEntities +'?Subject=[OpenAIRE Connect - '+ community.shortTitle + '] report missing Funder' + '&body=' + body"
|
|
||||||
target="_top">{{properties.feedbackmailForMissingEntities}}</a>)
|
|
||||||
to let us know and we'll try to get the provider on board!
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div search-input class="uk-width-xlarge@l uk-width-large" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
<div search-input class="uk-width-xlarge@l uk-width-large" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
||||||
|
@ -19,8 +14,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="openaireSearchUtils.status !== errorCodes.LOADING">
|
<div *ngIf="openaireSearchUtils.status !== errorCodes.LOADING">
|
||||||
<div *ngIf="openaireSearchUtils.totalResults == 0"
|
<div *ngIf="openaireSearchUtils.totalResults == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom">
|
||||||
<div>No <span class="uk-text-lowercase">{{openAIREEntities.DATASOURCE}}</span> found</div>
|
<div class="uk-text-bold">No <span class="uk-text-lowercase">{{openAIREEntities.DATASOURCES}}</span> found</div>
|
||||||
|
<div class="uk-margin-small-top" [innerHTML]="infoMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="openaireSearchUtils.totalResults > 0">
|
<ng-container *ngIf="openaireSearchUtils.totalResults > 0">
|
||||||
<no-load-paging [type]="openaireContentProviders.length === 1?openAIREEntities.DATASOURCE:openAIREEntities.DATASOURCES"
|
<no-load-paging [type]="openaireContentProviders.length === 1?openAIREEntities.DATASOURCE:openAIREEntities.DATASOURCES"
|
||||||
|
|
|
@ -89,9 +89,22 @@ export class AddContentProvidersComponent implements OnInit {
|
||||||
get loading() {
|
get loading() {
|
||||||
return this.openaireSearchUtils.status == this.errorCodes.LOADING
|
return this.openaireSearchUtils.status == this.errorCodes.LOADING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get infoMessage(): string {
|
||||||
|
return "<div>" +
|
||||||
|
"If you cannot find a "+OpenaireEntities.DATASOURCE.toLowerCase()+" relevant to your "+OpenaireEntities.COMMUNITY.toLowerCase()+", probably it is not OpenAIRE compliant." +
|
||||||
|
"<div>" +
|
||||||
|
"Feel free to contact us " +
|
||||||
|
"(<a href=\"mailto: "+ properties.feedbackmailForMissingEntities +
|
||||||
|
"?Subject=[OpenAIRE Connect - "+ this.community.shortTitle + "] report missing "+OpenaireEntities.DATASOURCE + "&body=" + this.body + "\" " +
|
||||||
|
"target=\"_top\">"+properties.feedbackmailForMissingEntities+"</a>) " +
|
||||||
|
"to let us know and we'll try to get the "+OpenaireEntities.DATASOURCE.toLowerCase()+" on board!" +
|
||||||
|
"</div>" +
|
||||||
|
"</div>"
|
||||||
|
}
|
||||||
|
|
||||||
public addContentProvider(contenProvider: SearchResult) {
|
public addContentProvider(contentProvider: SearchResult) {
|
||||||
this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contenProvider).subscribe(
|
this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.communityContentProviders.push(data);
|
this.communityContentProviders.push(data);
|
||||||
NotificationHandler.rise('Content Provider successfully added!')
|
NotificationHandler.rise('Content Provider successfully added!')
|
||||||
|
|
|
@ -19,12 +19,12 @@ import {CriteriaComponent} from "./criteria/criteria.component";
|
||||||
template: `
|
template: `
|
||||||
<remove-content-providers #removeContentProviders (addContentProviders)="openAddContentProviders()"
|
<remove-content-providers #removeContentProviders (addContentProviders)="openAddContentProviders()"
|
||||||
[communityContentProviders]="communityContentProviders"
|
[communityContentProviders]="communityContentProviders"
|
||||||
[loading]="showLoadingInRemove" [community]="community" [disableAdd]="add.loading"
|
[loading]="showLoadingInRemove" [community]="community" [disableAdd]="addContentProviders.loading"
|
||||||
(editCriteria)="openCriteria($event)"
|
(editCriteria)="openCriteria($event)"
|
||||||
(communityContentProvidersChanged)="communityContentProvidersChanged($event)">
|
(communityContentProvidersChanged)="communityContentProvidersChanged($event)">
|
||||||
</remove-content-providers>
|
</remove-content-providers>
|
||||||
<fs-modal #addContentProvidersModal>
|
<fs-modal #addContentProvidersModal>
|
||||||
<add-content-providers #add [communityContentProviders]="communityContentProviders" [community]="community"
|
<add-content-providers #addContentProviders [communityContentProviders]="communityContentProviders" [community]="community"
|
||||||
(communityContentProvidersChanged)="communityContentProvidersChanged($event)"></add-content-providers>
|
(communityContentProvidersChanged)="communityContentProvidersChanged($event)"></add-content-providers>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset()" [okButtonDisabled]="criteria && criteria.disabled">
|
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset()" [okButtonDisabled]="criteria && criteria.disabled">
|
||||||
|
|
|
@ -30,7 +30,10 @@
|
||||||
<div *ngIf="!loading">
|
<div *ngIf="!loading">
|
||||||
<div *ngIf="previewCommunityContentProviders.length == 0"
|
<div *ngIf="previewCommunityContentProviders.length == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No <span class="uk-text-lowercase">{{openAIREEntities.DATASOURCES}}</span> found</div>
|
<div>No <span class="uk-text-lowercase">{{openAIREEntities.DATASOURCES}} </span>
|
||||||
|
<span *ngIf="communityContentProviders.length == 0; else: notFound">for {{community.shortTitle}}</span>
|
||||||
|
<ng-template #notFound>found</ng-template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="previewCommunityContentProviders.length > 0">
|
<div *ngIf="previewCommunityContentProviders.length > 0">
|
||||||
<no-load-paging [type]="previewCommunityContentProviders.length === 1?openAIREEntities.DATASOURCE:openAIREEntities.DATASOURCES"
|
<no-load-paging [type]="previewCommunityContentProviders.length === 1?openAIREEntities.DATASOURCE:openAIREEntities.DATASOURCES"
|
||||||
|
|
|
@ -4,25 +4,20 @@
|
||||||
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative">
|
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative">
|
||||||
<div class="uk-slider-container" style="height: 40px">
|
<div class="uk-slider-container" style="height: 40px">
|
||||||
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap">
|
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap">
|
||||||
<ng-container *ngIf="funders && funders.countSelectedValues > 0">
|
<!-- <ng-container *ngIf="funders && funders.countSelectedValues > 0">-->
|
||||||
<ng-container *ngFor="let value of getSelectedValues(funders); let i = index; let end = last; ">
|
<!-- <ng-container *ngFor="let value of getSelectedValues(funders); let i = index; let end = last; ">-->
|
||||||
<li>
|
<li>
|
||||||
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
|
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
|
||||||
<span
|
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
||||||
class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
{{selectedFunder.name}}
|
||||||
<span *ngIf="funders.type && funders.type == 'boolean' else noboolean">{{funders.title}}:
|
|
||||||
{{value.name=='true'?'Yes':'No'}}
|
|
||||||
</span>
|
</span>
|
||||||
<ng-template #noboolean>
|
|
||||||
{{value.name}}
|
|
||||||
</ng-template></span>
|
|
||||||
<button class="uk-close uk-icon" [class.uk-disabled]="disabled" [disabled]="disabled" (click)="removeFilter(value, funders)">
|
<button class="uk-close uk-icon" [class.uk-disabled]="disabled" [disabled]="disabled" (click)="removeFilter(value, funders)">
|
||||||
<icon name="close" flex="true" ratio="0.7"></icon>
|
<icon name="close" flex="true" ratio="0.7"></icon>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
<!-- </ng-container>-->
|
||||||
</ng-container>
|
<!-- </ng-container>-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div class="">
|
||||||
|
@ -67,12 +62,8 @@
|
||||||
<div class="uk-section uk-flex uk-flex-center uk-flex uk-flex-middle">
|
<div class="uk-section uk-flex uk-flex-center uk-flex uk-flex-middle">
|
||||||
<div class="uk-width-auto uk-margin-right">
|
<div class="uk-width-auto uk-margin-right">
|
||||||
<a uk-icon="icon: info; ratio: 1.3"></a>
|
<a uk-icon="icon: info; ratio: 1.3"></a>
|
||||||
<div *ngIf="community" class="uk-dropdown uk-padding-small uk-width-medium" uk-dropdown="mode: hover">
|
<div *ngIf="community" class="uk-dropdown uk-padding-small uk-width-medium" uk-dropdown="mode: hover"
|
||||||
If you cannot find a funder that is relevant for your community, please contact us
|
[innerHTML]="infoMessage">
|
||||||
(<a
|
|
||||||
[href]="'mailto:' + properties.feedbackmailForMissingEntities +'?Subject=[OpenAIRE Connect - '+ community.shortTitle + '] report missing Funder' + '&body=' + body"
|
|
||||||
target="_top">{{properties.feedbackmailForMissingEntities}}</a>)
|
|
||||||
and we will try to get the funder on board!
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div search-input class="uk-width-xlarge@l uk-width-large" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
<div search-input class="uk-width-xlarge@l uk-width-large" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
||||||
|
@ -81,7 +72,7 @@
|
||||||
|
|
||||||
<div class="uk-section uk-section-small uk-position-relative">
|
<div class="uk-section uk-section-small uk-position-relative">
|
||||||
<div class="uk-grid" uk-grid>
|
<div class="uk-grid" uk-grid>
|
||||||
<div class="uk-width-1-4@m search-filters uk-visible@m">
|
<div *ngIf="openaireSearchUtils.status != errorCodes.NONE" class="uk-width-1-4@m search-filters uk-visible@m">
|
||||||
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-expand@m uk-with-1-1@s">
|
<div class="uk-width-expand@m uk-with-1-1@s">
|
||||||
|
@ -94,8 +85,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="openaireSearchUtils.status !== errorCodes.LOADING">
|
<div *ngIf="openaireSearchUtils.status !== errorCodes.LOADING">
|
||||||
<div *ngIf="openaireSearchUtils.totalResults == 0"
|
<div *ngIf="openaireSearchUtils.totalResults == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom">
|
||||||
<div>No {{openaireEntities.PROJECTS | lowercase}} found</div>
|
<div class="uk-text-bold">No {{openaireEntities.PROJECTS | lowercase}} found</div>
|
||||||
|
<div class="uk-margin-small-top" [innerHTML]="infoMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="openaireSearchUtils.totalResults > 0">
|
<ng-container *ngIf="openaireSearchUtils.totalResults > 0">
|
||||||
<no-load-paging [type]="openaireEntities.PROJECTS"
|
<no-load-paging [type]="openaireEntities.PROJECTS"
|
||||||
|
|
|
@ -45,6 +45,7 @@ export class AddProjectsComponent implements OnInit {
|
||||||
// public pagingLimit: number = properties.pagingLimit;
|
// public pagingLimit: number = properties.pagingLimit;
|
||||||
public resultsPerPage: number = properties.resultsPerPage;
|
public resultsPerPage: number = properties.resultsPerPage;
|
||||||
public selectedFunderId: string = "";
|
public selectedFunderId: string = "";
|
||||||
|
public selectedFunder: Value = null;
|
||||||
|
|
||||||
filterForm: FormGroup;
|
filterForm: FormGroup;
|
||||||
funders: Filter = null;
|
funders: Filter = null;
|
||||||
|
@ -106,6 +107,16 @@ export class AddProjectsComponent implements OnInit {
|
||||||
return this.openaireSearchUtils.status == this.errorCodes.LOADING || this.openaireSearchUtils.refineStatus == this.errorCodes.LOADING;
|
return this.openaireSearchUtils.status == this.errorCodes.LOADING || this.openaireSearchUtils.refineStatus == this.errorCodes.LOADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get infoMessage(): string {
|
||||||
|
return "<div>" +
|
||||||
|
"If you cannot find a funder that is relevant for your "+OpenaireEntities.COMMUNITY.toLowerCase()+", please contact us " +
|
||||||
|
"(<a href=\"mailto:" + properties.feedbackmailForMissingEntities +
|
||||||
|
"?Subject=[OpenAIRE Connect - "+ this.community.shortTitle + "] report missing Funder" + "&body=" + this.body + "\" " +
|
||||||
|
"target=\"_top\">"+properties.feedbackmailForMissingEntities+"</a>) " +
|
||||||
|
"and we will try to get the funder on board!" +
|
||||||
|
"</div>";
|
||||||
|
}
|
||||||
|
|
||||||
public addProject(project: SearchResult) {
|
public addProject(project: SearchResult) {
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -287,16 +298,22 @@ export class AddProjectsComponent implements OnInit {
|
||||||
|
|
||||||
getSelectedValues(filter): any {
|
getSelectedValues(filter): any {
|
||||||
var selected = [];
|
var selected = [];
|
||||||
this.selectedFunderId = "";
|
if(filter.values.length == 0 && this.selectedFunderId) {
|
||||||
if (filter.countSelectedValues > 0) {
|
return [this.selectedFunder];
|
||||||
for (var i = 0; i < filter.values.length; i++) {
|
} else {
|
||||||
if (filter.values[i].selected) {
|
this.selectedFunderId = "";
|
||||||
selected.push(filter.values[i]);
|
this.selectedFunder = null;
|
||||||
this.selectedFunderId = filter.values[i].id;
|
if (filter.countSelectedValues > 0) {
|
||||||
|
for (var i = 0; i < filter.values.length; i++) {
|
||||||
|
if (filter.values[i].selected) {
|
||||||
|
selected.push(filter.values[i]);
|
||||||
|
this.selectedFunderId = filter.values[i].id;
|
||||||
|
this.selectedFunder = filter.values[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return selected;
|
||||||
}
|
}
|
||||||
return selected;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearFilters() {
|
clearFilters() {
|
||||||
|
@ -310,12 +327,16 @@ export class AddProjectsComponent implements OnInit {
|
||||||
|
|
||||||
public removeFilter(value: Value, filter: Filter) {
|
public removeFilter(value: Value, filter: Filter) {
|
||||||
this.selectedFunderId = "";
|
this.selectedFunderId = "";
|
||||||
filter.countSelectedValues--;
|
this.selectedFunder = null;
|
||||||
if (value.selected == true) {
|
|
||||||
value.selected = false;
|
if(value) {
|
||||||
}
|
filter.countSelectedValues--;
|
||||||
if (filter.filterType == "radio") {
|
if (value.selected == true) {
|
||||||
filter.radioValue = "";
|
value.selected = false;
|
||||||
|
}
|
||||||
|
if (filter.filterType == "radio") {
|
||||||
|
filter.radioValue = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.buildQueryParameters();
|
this.buildQueryParameters();
|
||||||
this.goTo(1);
|
this.goTo(1);
|
||||||
|
|
|
@ -17,11 +17,11 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit
|
||||||
selector: 'manage-projects',
|
selector: 'manage-projects',
|
||||||
template: `
|
template: `
|
||||||
<remove-projects #removeProjectsComponent (addProjects)="openAddProjects()" [communityProjects]="communityProjects"
|
<remove-projects #removeProjectsComponent (addProjects)="openAddProjects()" [communityProjects]="communityProjects"
|
||||||
[loading]="showLoadingInRemove" [community]="community" [disableAdd]="add.loading"
|
[loading]="showLoadingInRemove" [community]="community" [disableAdd]="addProjects.loading"
|
||||||
(communityProjectsChanged)="communityProjectsChanged($event)">
|
(communityProjectsChanged)="communityProjectsChanged($event)">
|
||||||
</remove-projects>
|
</remove-projects>
|
||||||
<fs-modal #fsModal>
|
<fs-modal #fsModalProjects>
|
||||||
<add-projects #add [communityProjects]="communityProjects" [community]="community"
|
<add-projects #addProjects [communityProjects]="communityProjects" [community]="community"
|
||||||
(communityProjectsChanged)="communityProjectsChanged($event)"></add-projects>
|
(communityProjectsChanged)="communityProjectsChanged($event)"></add-projects>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
`
|
`
|
||||||
|
@ -30,7 +30,7 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit
|
||||||
export class ManageProjectsComponent implements OnInit {
|
export class ManageProjectsComponent implements OnInit {
|
||||||
@Input() communityProjects = [];
|
@Input() communityProjects = [];
|
||||||
@ViewChild(RemoveProjectsComponent) removeProjectsComponent: RemoveProjectsComponent;
|
@ViewChild(RemoveProjectsComponent) removeProjectsComponent: RemoveProjectsComponent;
|
||||||
@ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
|
@ViewChild('fsModalProjects', { static: true }) fullscreen: FullScreenModalComponent;
|
||||||
private subscriptions: any[] = [];
|
private subscriptions: any[] = [];
|
||||||
public showLoadingInRemove: boolean = true;
|
public showLoadingInRemove: boolean = true;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ export class ManageProjectsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public openAddProjects() {
|
public openAddProjects() {
|
||||||
this.fullscreen.title = "Search and Add "+OpenaireEntities.PROJECTS;
|
this.fullscreen.title = "Search and Add " + OpenaireEntities.PROJECTS;
|
||||||
this.fullscreen.okButtonText = "Done";
|
this.fullscreen.okButtonText = "Done";
|
||||||
this.fullscreen.back = true;
|
this.fullscreen.back = true;
|
||||||
this.fullscreen.okButton = true;
|
this.fullscreen.okButton = true;
|
||||||
|
|
|
@ -78,7 +78,10 @@
|
||||||
<div class="uk-margin-medium-bottom">
|
<div class="uk-margin-medium-bottom">
|
||||||
<div *ngIf="previewCommunityProjects.length == 0"
|
<div *ngIf="previewCommunityProjects.length == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No {{openaireEntiites.PROJECTS | lowercase}} for {{community.shortTitle}}</div>
|
<div>No {{openaireEntiites.PROJECTS | lowercase}}
|
||||||
|
<span *ngIf="communityProjects.length == 0; else: notFound">for {{community.shortTitle}}</span>
|
||||||
|
<ng-template #notFound>found</ng-template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="previewCommunityProjects.length > 0"
|
<div *ngIf="previewCommunityProjects.length > 0"
|
||||||
class="uk-grid uk-grid-large uk-child-width-1-1 uk-child-width-1-2@m uk-margin-bottom" uk-grid uk-height-match="target: .uk-card-body">
|
class="uk-grid uk-grid-large uk-child-width-1-1 uk-child-width-1-2@m uk-margin-bottom" uk-grid uk-height-match="target: .uk-card-body">
|
||||||
|
|
|
@ -152,126 +152,99 @@ export class RemoveProjectsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public confirmedDeleteProject(data: any) {
|
public confirmedDeleteProject(data: any) {
|
||||||
if (!Session.isLoggedIn()) {
|
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.id).subscribe(
|
||||||
this._router.navigate(['/user-info'], {
|
data => {
|
||||||
queryParams: {
|
let index = this.communityProjects.indexOf(this.selectedCommunityProject);
|
||||||
"errorCode": LoginErrorCodes.NOT_VALID,
|
this.communityProjects.splice(index, 1);
|
||||||
"redirectUrl": this._router.url
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.id).subscribe(
|
|
||||||
data => {
|
|
||||||
let index = this.communityProjects.indexOf(this.selectedCommunityProject);
|
|
||||||
this.communityProjects.splice(index, 1);
|
|
||||||
|
|
||||||
this.applyFilters();
|
this.applyFilters();
|
||||||
|
|
||||||
UIkit.notification(OpenaireEntities.PROJECT+' successfully removed!', {
|
UIkit.notification(OpenaireEntities.PROJECT+' successfully removed!', {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
|
|
||||||
this.communityProjectsChanged.emit({
|
this.communityProjectsChanged.emit({
|
||||||
value: this.communityProjects,
|
value: this.communityProjects,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.communitySearchUtils.totalResults--;
|
this.communitySearchUtils.totalResults--;
|
||||||
this.communitySearchUtils.page = 1;
|
this.communitySearchUtils.page = 1;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
this.handleError('An error has been occurred. Try again later!');
|
this.handleError('An error has been occurred. Try again later!');
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeProject(communityProject: any) {
|
public removeProject(communityProject: any) {
|
||||||
if (!Session.isLoggedIn()) {
|
this.selectedCommunityProject = communityProject;
|
||||||
this._router.navigate(['/user-info'], {
|
this.alertModalDeleteCommunity.cancelButton = true;
|
||||||
queryParams: {
|
this.alertModalDeleteCommunity.okButton = true;
|
||||||
"errorCode": LoginErrorCodes.NOT_VALID,
|
this.alertModalDeleteCommunity.alertTitle = "Remove "+OpenaireEntities.PROJECT;
|
||||||
"redirectUrl": this._router.url
|
let title = "";
|
||||||
}
|
if (communityProject.name) {
|
||||||
});
|
title = communityProject.name;
|
||||||
} else {
|
|
||||||
this.selectedCommunityProject = communityProject;
|
|
||||||
this.alertModalDeleteCommunity.cancelButton = true;
|
|
||||||
this.alertModalDeleteCommunity.okButton = true;
|
|
||||||
this.alertModalDeleteCommunity.alertTitle = "Remove "+OpenaireEntities.PROJECT;
|
|
||||||
let title = "";
|
|
||||||
if (communityProject.name) {
|
|
||||||
title = communityProject.name;
|
|
||||||
}
|
|
||||||
if (communityProject.name && communityProject.acronym) {
|
|
||||||
title += " (";
|
|
||||||
}
|
|
||||||
if (communityProject.acronym) {
|
|
||||||
title += communityProject.acronym;
|
|
||||||
}
|
|
||||||
if (communityProject.name && communityProject.acronym) {
|
|
||||||
title += ")";
|
|
||||||
}
|
|
||||||
this.alertModalDeleteCommunity.message = OpenaireEntities.PROJECT;
|
|
||||||
if (title) {
|
|
||||||
this.alertModalDeleteCommunity.message += " <b>" + title + "</b> ";
|
|
||||||
}
|
|
||||||
this.alertModalDeleteCommunity.message += "will be removed from your "+OpenaireEntities.COMMUNITY.toLowerCase()+". Are you sure?";
|
|
||||||
this.alertModalDeleteCommunity.okButtonText = "Yes";
|
|
||||||
this.alertModalDeleteCommunity.open();
|
|
||||||
}
|
}
|
||||||
|
if (communityProject.name && communityProject.acronym) {
|
||||||
|
title += " (";
|
||||||
|
}
|
||||||
|
if (communityProject.acronym) {
|
||||||
|
title += communityProject.acronym;
|
||||||
|
}
|
||||||
|
if (communityProject.name && communityProject.acronym) {
|
||||||
|
title += ")";
|
||||||
|
}
|
||||||
|
this.alertModalDeleteCommunity.message = OpenaireEntities.PROJECT;
|
||||||
|
if (title) {
|
||||||
|
this.alertModalDeleteCommunity.message += " <b>" + title + "</b> ";
|
||||||
|
}
|
||||||
|
this.alertModalDeleteCommunity.message += "will be removed from your "+OpenaireEntities.COMMUNITY.toLowerCase()+". Are you sure?";
|
||||||
|
this.alertModalDeleteCommunity.okButtonText = "Yes";
|
||||||
|
this.alertModalDeleteCommunity.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
public _getCommunityProjects() {
|
public _getCommunityProjects() {
|
||||||
if (!Session.isLoggedIn()) {
|
this.communitySearchUtils.status = this.errorCodes.LOADING;
|
||||||
this._router.navigate(['/user-info'], {
|
this.communityProjects = [];
|
||||||
queryParams: {
|
this.communitySearchUtils.totalResults = 0;
|
||||||
"errorCode": LoginErrorCodes.NOT_VALID,
|
this.communitySearchUtils.page = 1;
|
||||||
"redirectUrl": this._router.url
|
this.communitySearchUtils.keyword = "";
|
||||||
|
|
||||||
|
this.subscriptions.push(this._searchCommunityProjectsService.searchProjects(this.properties, this.community.communityId).subscribe(
|
||||||
|
data => {
|
||||||
|
this.communityProjects = data;
|
||||||
|
this.previewCommunityProjects = this.communityProjects;
|
||||||
|
this.sort();
|
||||||
|
|
||||||
|
this.communitySearchUtils.totalResults = data.length;
|
||||||
|
this.communitySearchUtils.status = this.errorCodes.DONE;
|
||||||
|
|
||||||
|
this.communityProjectsChanged.emit({
|
||||||
|
value: this.communityProjects,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.createFunderFilter();
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
console.error(err);
|
||||||
|
//TODO check erros (service not available, bad request)
|
||||||
|
|
||||||
|
if (err.status == '404') {
|
||||||
|
this.communitySearchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if (err.status == '500') {
|
||||||
|
this.communitySearchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.communitySearchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.communitySearchUtils.status = this.errorCodes.LOADING;
|
|
||||||
this.communityProjects = [];
|
|
||||||
this.communitySearchUtils.totalResults = 0;
|
|
||||||
this.communitySearchUtils.page = 1;
|
|
||||||
this.communitySearchUtils.keyword = "";
|
|
||||||
|
|
||||||
this.subscriptions.push(this._searchCommunityProjectsService.searchProjects(this.properties, this.community.communityId).subscribe(
|
this.loading = false;
|
||||||
data => {
|
}
|
||||||
this.communityProjects = data;
|
));
|
||||||
this.previewCommunityProjects = this.communityProjects;
|
|
||||||
this.sort();
|
|
||||||
|
|
||||||
this.communitySearchUtils.totalResults = data.length;
|
|
||||||
this.communitySearchUtils.status = this.errorCodes.DONE;
|
|
||||||
|
|
||||||
this.communityProjectsChanged.emit({
|
|
||||||
value: this.communityProjects,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.createFunderFilter();
|
|
||||||
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
console.error(err);
|
|
||||||
//TODO check erros (service not available, bad request)
|
|
||||||
|
|
||||||
if (err.status == '404') {
|
|
||||||
this.communitySearchUtils.status = this.errorCodes.NOT_FOUND;
|
|
||||||
} else if (err.status == '500') {
|
|
||||||
this.communitySearchUtils.status = this.errorCodes.ERROR;
|
|
||||||
} else {
|
|
||||||
this.communitySearchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public createFunderFilter(): void {
|
public createFunderFilter(): void {
|
||||||
|
|
|
@ -36,7 +36,10 @@
|
||||||
<div *ngIf="!showLoading">
|
<div *ngIf="!showLoading">
|
||||||
<div *ngIf="community.subjects.length == 0"
|
<div *ngIf="community.subjects.length == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No subjects found</div>
|
<div>No subjects
|
||||||
|
<span *ngIf="originalSubjects.length == 0; else: notFound">for {{community.shortTitle}}</span>
|
||||||
|
<ng-template #notFound>found</ng-template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="community.subjects.length > 0">
|
<div *ngIf="community.subjects.length > 0">
|
||||||
<no-load-paging *ngIf="community.subjects.length > 0" [type]="'Subjects'"
|
<no-load-paging *ngIf="community.subjects.length > 0" [type]="'Subjects'"
|
||||||
|
|
|
@ -32,7 +32,10 @@
|
||||||
<div *ngIf="searchUtils.status !== errorCodes.LOADING">
|
<div *ngIf="searchUtils.status !== errorCodes.LOADING">
|
||||||
<div *ngIf="previewCommunities.length == 0"
|
<div *ngIf="previewCommunities.length == 0"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No zenodo communities found</div>
|
<div>No zenodo communities
|
||||||
|
<span *ngIf="selectedCommunities.length == 0; else: notFound">for {{community.shortTitle}}</span>
|
||||||
|
<ng-template #notFound>found</ng-template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="previewCommunities.length > 0">
|
<div *ngIf="previewCommunities.length > 0">
|
||||||
<no-load-paging [type]="'content providers'"
|
<no-load-paging [type]="'content providers'"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 32040ce807ad4945e7682b39a3fbc6faecf2f619
|
Subproject commit c80b7371801d42611c611707ca933c1c83c3c672
|
Loading…
Reference in New Issue