Project

General

Profile

« Previous | Next » 

Revision 60892

[Connect | Trunk]

- Update affiliations layout
- Use customization class to create the css
- Create preview/ demo component
- Clean up piwik helper file
- updates on customization css

View differences:

demo.component.ts
1 1
import {Component, OnInit} from '@angular/core';
2 2
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
3
import {ActivatedRoute, Router} from "@angular/router";
4
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
3
import {ActivatedRoute} from "@angular/router";
4
import {CustomizationOptions} from "../openaireLibrary/connect/community/CustomizationOptions";
5
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
6
import {ResultPreview} from "../openaireLibrary/utils/result-preview/result-preview";
7
import {properties} from "../../environments/environment";
8
import {ResultLandingInfo} from "../openaireLibrary/utils/entities/resultLandingInfo";
5 9

  
6 10

  
7 11
@Component({
......
11 15

  
12 16
export class DemoComponent implements OnInit{
13 17

  
14
   properties:EnvProperties;
18
  properties:EnvProperties;
19
  layout: CustomizationOptions = null;
20
  result: ResultPreview;
21
  resultLanding:ResultLandingInfo;
22
  constructor(private route: ActivatedRoute) {
15 23

  
16
  constructor(private route: ActivatedRoute,
17
              private _router: Router,
18
              private helper: HelperService) {
19

  
20 24
  }
21 25

  
22 26
  ngOnInit(): void {
27
    this.properties = properties;
28
    this.route.queryParams.subscribe(params => {
29
      if (params['layout']) {
30
        this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
31
      }
32
    });
33
    this.result =  new ResultPreview();
34
    this.resultLanding = new ResultLandingInfo();
35
    this.result.resultType = "Publication";
36
    this.resultLanding.types = this.result.types = ["Article"];
37
    this.resultLanding.accessMode = this.result.accessMode = "Open Access";
38
    this.resultLanding.description = this.result.description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
39
    this.resultLanding.authors = this.result.authors = [{fullName: "Lorem ipsum", orcid: "0000-1111-2222-3333", orcid_pending: null}, {fullName: "Lorem ipsum", orcid: null, orcid_pending: "0000-1111-2222-3333"},{fullName: "Lorem ipsum", orcid: null, orcid_pending: null}];
40
    this.resultLanding.title = this.result.title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
41
    this.resultLanding.fundedByProjects = this.result.projects = [{id: "XYZ", acronym: "Project acronym", title: "Project name", funderShortname: "Funder acronym", funderName: "Funder name", code:" project code"}]
42
    this.resultLanding.countries  = this.result.countries = ["Greece"];
43
    this.resultLanding.languages = this.result.languages = ["GR"];
44
    this.resultLanding.identifiers = this.result.identifiers = new Map<string, string[]>();
45
    this.result.identifiers.set("doi",["DOI/1","DOI/2"]);
46
    this.resultLanding.date = this.result.year = "2020";
47
    this.resultLanding.publisher = "Publisher name";
48
    this.resultLanding.journal  = {journal: "Journal name", lissn: null};
49
    this.resultLanding.subjects = ["Subject 1", "Subject 2"];
50
    this.resultLanding.contexts = [{ "labelContext": "Research Community", "idContext": "",
51
      "labelCategory":"", "idCategory": "",
52
      "labelConcept": "", "idConcept": "", "inline" :true }]
53
    this.resultLanding.objIdentifier ="re3data_____::db814dc656a911b556dba42a331cebe9";
23 54

  
55

  
24 56
  }
25 57

  
26 58

  

Also available in: Unified diff