Project

General

Profile

« Previous | Next » 

Revision 60985

[Trunk | Connect]:
1. invite.component.ts: [Bug fix] Set meta (canonical url, url, title, description) only when "longView == true" (when we are on invite page, not just calling invite component).
2. browse-community.component.ts: Added method "_formatDescription()" which calls method "StringUtils.HTMLToString()" and then it cuts description up to a threshold (max chars).
3. browse-community.component.html: Removed tooltip from description and "_formatDescription()" is called to show description.

View differences:

modules/uoa-connect-portal/trunk/src/app/communities/browseCommunity/browse-community.component.html
70 70
        </span>
71 71
      </a>
72 72
    </div>
73
    <div class="uk-text-left uk-text-small" *ngIf="community.description != null && showDescription"
74
         title="{{community.description}}">
75
      <span>{{community.description.slice(0, thresholdDescription)}}<span
76
        *ngIf="community.description.length > thresholdDescription">...</span></span>
73
    <div class="uk-text-left uk-text-small" *ngIf="community.description != null && showDescription">
74
<!--         title="{{community.description}}">-->
75
      <span>{{_formatDescription(community.description)}}</span>
76
<!--      <span>{{community.description.slice(0, thresholdDescription)}}<span-->
77
<!--        *ngIf="community.description.length > thresholdDescription">...</span></span>-->
77 78
    </div>
78 79
  </div>
79 80
  <div>
modules/uoa-connect-portal/trunk/src/app/communities/browseCommunity/browse-community.component.ts
7 7
import {LocalStorageService} from "../../openaireLibrary/services/localStorage.service";
8 8
import {Subscriber} from "rxjs";
9 9
import {properties} from "../../../environments/environment";
10
import {StringUtils} from "../../openaireLibrary/utils/string-utils.class";
10 11

  
11 12
@Component({
12 13
  selector: 'browse-community',
......
99 100
      window.open(url, '_blank');
100 101
    }
101 102
  }
103

  
104
  public _formatDescription(description) {
105
    let descr: string = StringUtils.HTMLToString(description);
106
    return (((descr).length > this.thresholdDescription) ? (descr.substring(0, (this.thresholdDescription - ('...').length)) + "...") : descr);
107
  }
102 108
}
modules/uoa-connect-portal/trunk/src/app/utils/subscribe/invite/invite.component.ts
48 48
    }));
49 49
    this.getPageContents();
50 50
    this.url = this.properties.domain + this._router.url;
51
    this.seoService.createLinkForCanonicalURL(this.url);
52
    this.updateUrl(this.url );
53
    this.updateTitle(this.pageTitle);
54
    this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, invite");
51
    if(this.longView) {
52
      this.seoService.createLinkForCanonicalURL(this.url);
53
      this.updateUrl(this.url);
54
      this.updateTitle(this.pageTitle);
55
      this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, invite");
56
    }
55 57
  }
56 58
  
57 59
  ngOnDestroy() {

Also available in: Unified diff