From 02fe5fb13e21a71a8536e77bb3d634748431a898 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 8 Apr 2019 14:53:09 +0000 Subject: [PATCH] [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 --- .../communitySearchResults.component.html | 18 +++++++++--------- .../communitySearchResults.component.ts | 7 ++++++- .../communitySearchResults.module.ts | 2 +- .../searchUtils/searchFilter.component.html | 2 +- utils/manage/manage.component.ts | 19 +++++++++++++++++++ utils/manage/manage.module.ts | 19 +++++++++++++++++++ utils/modal/alert.ts | 2 +- 7 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 utils/manage/manage.component.ts create mode 100644 utils/manage/manage.module.ts diff --git a/searchPages/searchUtils/communitySearchResults.component.html b/searchPages/searchUtils/communitySearchResults.component.html index 7c4b9b65..3e4b779d 100644 --- a/searchPages/searchUtils/communitySearchResults.component.html +++ b/searchPages/searchUtils/communitySearchResults.component.html @@ -2,7 +2,7 @@
  • - +
    Subscribed
    {{(result.community.title)?result.community.title:result.community.shortTitle}} logo @@ -10,27 +10,27 @@
    -
    - + -
    -
    - {{result.community.description}} +
    +
    + {{_formatDescription(result.community.description)}}
    -
    +
    Creation Date: {{result.community.date | date:'dd-MM-yyyy'}}
    -
    +
    Type: {{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}
    -
  • diff --git a/searchPages/searchUtils/communitySearchResults.component.ts b/searchPages/searchUtils/communitySearchResults.component.ts index 36ea1e25..fda3e690 100644 --- a/searchPages/searchUtils/communitySearchResults.component.ts +++ b/searchPages/searchUtils/communitySearchResults.component.ts @@ -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; @@ -37,7 +38,7 @@ export class CommunitySearchResultsComponent { getProductionPrefix():string{ - return (this.properties.environment =="beta")?"beta.":"" + return (this.properties.environment == "beta")?"beta.":"" } isProduction():boolean{ @@ -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; diff --git a/searchPages/searchUtils/communitySearchResults.module.ts b/searchPages/searchUtils/communitySearchResults.module.ts index 04614823..a71f3ab8 100644 --- a/searchPages/searchUtils/communitySearchResults.module.ts +++ b/searchPages/searchUtils/communitySearchResults.module.ts @@ -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: [ diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html index 9ccc2342..dde58170 100644 --- a/searchPages/searchUtils/searchFilter.component.html +++ b/searchPages/searchUtils/searchFilter.component.html @@ -7,7 +7,7 @@
    - + {{_formatName(value)}}
    ({{value.number|number}})
    diff --git a/utils/manage/manage.component.ts b/utils/manage/manage.component.ts new file mode 100644 index 00000000..14ec6c6a --- /dev/null +++ b/utils/manage/manage.component.ts @@ -0,0 +1,19 @@ +import { Component, Input} from '@angular/core'; +@Component({ + selector: 'manage', + template: ` + + + Manage + + + + ` +}) + +export class ManageComponent { + @Input() communityId:string; + + constructor() {} +} + diff --git a/utils/manage/manage.module.ts b/utils/manage/manage.module.ts new file mode 100644 index 00000000..d8dbe3a7 --- /dev/null +++ b/utils/manage/manage.module.ts @@ -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 { } diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index cc366dee..200df72e 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -6,7 +6,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output} from '@a