Project

General

Profile

« Previous | Next » 

Revision 52995

almost ready for release

View differences:

metrics-usagestats-report.component.ts
10 10

  
11 11
@Component({
12 12
  selector: 'metrics-usagestats-report',
13
  templateUrl: 'metrics-usagestats-report.component.html'
13
  templateUrl: './metrics-usagestats-report.component.html'
14 14
})
15 15

  
16 16
export class MetricsUsagestatsReportComponent implements OnInit {
......
32 32
  itemIdentifier: string = '';
33 33
  itemDataType: string = '';
34 34
  granularity: string = 'Monthly';
35
  pretty: boolean = true;
36 35

  
37 36
  constructor(private repoService: RepositoryService,
38 37
              private route: ActivatedRoute,
......
80 79
          this.issnToShow = this.repo.issn.slice(0, 4)+ '-' + this.repo.issn.toString().slice(4);
81 80
        }
82 81
        this.title = `${this.chosen_report} report for ${this.repo.officialName}`;
83
        if ( this.authService.getUserEmail() !== this.repo.registeredBy ) {
82
        // TODO: UNCOMMENT
83
        /*if ( this.authService.getUserEmail() !== this.repo.registeredBy ) {
84 84
          this.router.navigateByUrl('/403-forbidden', { skipLocationChange: true });
85
        }
85
        }*/
86 86
      }
87 87
    );
88 88
  }
......
107 107
    this.granularity = event.target.value;
108 108
  }
109 109

  
110
  updatePretty(event: any) {
111
    this.pretty = !this.pretty;
112
  }
113

  
114 110
  goToReport() {
115
    /* additional field: */
116
    /*itemIdentifier: this.repo.piwikInfo.openaireId,*/
117
    /*this.router.navigate([`/getImpact/${this.repoId}/${this.chosen_report}/results'], {
111
    this.router.navigate(['/getImpact/usagestats-report-results'], {
118 112
      queryParams: {
119 113
        report: this.chosen_report,
120 114
        beginDate: this.beginDate,
......
122 116
        repoId: this.shownRepoId,
123 117
        itemDataType: this.itemDataType,
124 118
        itemIdentifier: this.itemIdentifier,
125
        granularity: this.granularity,
126
        pretty: this.pretty
119
        granularity: this.granularity
127 120
      }
128
    });*/
121
    });
129 122

  
130
    const params = new URLSearchParams();
123
    /*const params = new URLSearchParams();
131 124

  
132 125
    params.append('Report', this.chosen_report);
133 126
    params.append('Release', '4');
......
141 134
    if (this.itemDataType) {
142 135
      params.append('ItemDataType', this.itemDataType);
143 136
    }
144
    params.append('Granularity', this.granularity);
145
    if (this.pretty && this.pretty === true) {
146
      params.append('Pretty', 'Pretty');
147
    }
137
    params.append('Pretty', 'Pretty');
148 138

  
149 139
    let url = `http://beta.services.openaire.eu/usagestats/sushilite/GetReport/?${params}`;
150 140
    console.log(`going to: ${url}`);
151 141

  
152
    window.location.href = url;
142
    window.location.href = url;*/
153 143
  }
154 144

  
155 145
}

Also available in: Unified diff