[Trunk|Library]: 1. Move manage in library. 2. change community search result View. 3. search filter cannot be disabled when they are selected.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55234 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b5998286a5
commit
02fe5fb13e
|
@ -2,7 +2,7 @@
|
|||
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
|
||||
|
||||
<li *ngFor="let result of results" class="uk-animation-fade uk-margin-auto" uk-grid>
|
||||
<a class="uk-width-1-5 uk-height-small uk-card uk-card-default uk-card-body uk-margin-auto-top" (click)="confirmModalOpen(result.community)">
|
||||
<a class="uk-width-1-5 uk-height-small uk-card uk-card-default uk-card-body" (click)="confirmModalOpen(result.community)">
|
||||
<div *ngIf="result.isSubscribed" class="uk-card-badge portal-card-badge uk-width-1-2 uk-position-top-left uk-text-small uk-text-center">Subscribed</div>
|
||||
<img *ngIf= "result.community.logoUrl != null && result.community.logoUrl != '' " class="uk-padding uk-position-center" src="{{result.community.logoUrl}}" alt="{{(result.community.title)?result.community.title:result.community.shortTitle}} logo" >
|
||||
<span *ngIf= "result.community.logoUrl == null || result.community.logoUrl == '' " class="uk-icon uk-padding uk-position-center">
|
||||
|
@ -10,27 +10,27 @@
|
|||
</span>
|
||||
</a>
|
||||
<div class="uk-width-expand">
|
||||
<div [title] = result.community.shortTitle class="uk-text-large">
|
||||
<a (click)="confirmModalOpen(result.community)">
|
||||
<div [title] = result.community.shortTitle class="uk-text-large uk-grid">
|
||||
<a (click)="confirmModalOpen(result.community)" class="uk-width-3-4">
|
||||
{{(result.community.title)?result.community.title:result.community.shortTitle}}
|
||||
</a>
|
||||
<manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand"></manage>
|
||||
</div>
|
||||
<div *ngIf="result.community.description">
|
||||
<div class="text-justify descriptionText">
|
||||
{{result.community.description}}
|
||||
<div *ngIf="result.community.description" class="uk-margin-auto">
|
||||
<div class="text-justify descriptionText" [title]="result.community.description">
|
||||
{{_formatDescription(result.community.description)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-padding-small uk-padding-remove-left uk-grid">
|
||||
<div class="uk-width-1-2">
|
||||
<div class="uk-width-3-5">
|
||||
<span *ngIf="result.community.date"><b> Creation Date: </b></span>
|
||||
<span *ngIf="result.community.date">{{result.community.date | date:'dd-MM-yyyy'}}</span>
|
||||
</div>
|
||||
<div class="uk-width-1-2 uk-text-right">
|
||||
<div class="uk-width-expand">
|
||||
<span *ngIf="result.community.type && result.community.type != ''" ><b> Type: </b></span>
|
||||
<span *ngIf="result.community.type && result.community.type != ''" >{{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<manage *ngIf="result.isManager" [communityId]="result.community.communityId"></manage>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -17,6 +17,7 @@ export class CommunitySearchResultsComponent {
|
|||
@Input() showLoading: boolean = false;
|
||||
@Input() custom_class: string = "search-results";
|
||||
@Input() properties: EnvProperties;
|
||||
@Input() maxCharacters: number = 150;
|
||||
@ViewChild('AlertModal') modal;
|
||||
|
||||
|
||||
|
@ -45,6 +46,10 @@ export class CommunitySearchResultsComponent {
|
|||
|
||||
}
|
||||
|
||||
public _formatDescription(description){
|
||||
return (((description).length >this.maxCharacters)?(description.substring(0,(this.maxCharacters - ('...').length))+"..."):description);
|
||||
}
|
||||
|
||||
public confirmModalOpen(community: CommunityInfo) {
|
||||
this.selectedCommunityId = community.communityId;
|
||||
this.modal.cancelButton = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { RouterModule } from '@angular/router';
|
|||
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||
import {CommunitySearchResultsComponent} from "./communitySearchResults.component";
|
||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||
import {ManageModule} from "../../../utils/manage/manage.module";
|
||||
import {ManageModule} from "../../utils/manage/manage.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="searchFilterBoxValues ">
|
||||
<div *ngFor = "let value of getSelectedValues(filter,'num')" class = "uk-animation-fade filterItem">
|
||||
<span class="filterName"><div title = "{{value.name}}">
|
||||
<input [disabled]="isDisabled || (showResultCount && value.number === 0)" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
<input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number|number}})</span>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import { Component, Input} from '@angular/core';
|
||||
@Component({
|
||||
selector: 'manage',
|
||||
template: `
|
||||
|
||||
<a [href]="'https://beta.admin.connect.openaire.eu/dashboard?communityId='+communityId" class="uk-button uk-button-default uk-button-small portal-button" target="_blank">
|
||||
Manage
|
||||
</a>
|
||||
|
||||
|
||||
`
|
||||
})
|
||||
|
||||
export class ManageComponent {
|
||||
@Input() communityId:string;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import {ManageComponent} from './manage.component';
|
||||
import {AlertModalModule} from '../modal/alertModal.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, RouterModule, AlertModalModule
|
||||
],
|
||||
declarations: [
|
||||
ManageComponent
|
||||
],
|
||||
exports: [
|
||||
ManageComponent
|
||||
]
|
||||
})
|
||||
export class ManageModule { }
|
|
@ -6,7 +6,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output} from '@a
|
|||
<div [class]="(!isOpen)?'uk-modal ':'uk-modal uk-open uk-animation-fade'" uk-modal [open]="!isOpen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="uk-modal-dialog uk-modal-body" role="">
|
||||
<div class="uk-modal-title" [hidden]=!alertHeader>
|
||||
<button class="uk-modal-close-full uk-float-right" (click)='cancel()' uk-close></button>
|
||||
<button class="uk-modal-close-default uk-float-right" (click)='cancel()' uk-close></button>
|
||||
<h4 class="modal-title text-center" id="myModalLabel">{{alertTitle}}</h4>
|
||||
</div>
|
||||
<div class="uk-margin ">
|
||||
|
|
Loading…
Reference in New Issue