Revision 58109
Added by Stefania Martziou about 4 years ago
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/join/join.component.html | ||
---|---|---|
1 |
<div id="page_content"> |
|
2 |
<div id="page_content_inner"> |
|
3 |
|
|
4 |
<div class="uk-margin-large-top uk-margin-medium-left uk-margin-medium-right"> |
|
5 |
|
|
6 |
<h3 class="heading_b">You have not yet registered any repositories</h3> |
|
7 |
|
|
8 |
<div class="uk-grid uk-child-width-1-3@l uk-child-width-1-2@m uk-child-width-1-1@s uk-grid-match"> |
|
9 |
|
|
10 |
<div class=""> |
|
11 |
<div class="md-card md-card-hover"> |
|
12 |
<a [routerLink]="['/sources/register']"> |
|
13 |
<div class="md-card-content large-padding" style="min-height: 150px;"> |
|
14 |
<div class=""> |
|
15 |
<strong>Register</strong> |
|
16 |
</div> |
|
17 |
<p>Register data sources in the OpenAIRE infrastructure.</p> |
|
18 |
</div> |
|
19 |
</a> |
|
20 |
</div> |
|
21 |
</div> |
|
22 |
|
|
23 |
|
|
24 |
<div class=""> |
|
25 |
<div class="md-card md-card-hover"> |
|
26 |
<a [routerLink]="['/compatibility/validate']"> |
|
27 |
<div class="md-card-content large-padding" style="min-height: 150px;"> |
|
28 |
<div class=""> |
|
29 |
<strong>Validate</strong> |
|
30 |
</div> |
|
31 |
<p>Validate data sources against OpenAIRE guidelines.</p> |
|
32 |
</div> |
|
33 |
</a> |
|
34 |
</div> |
|
35 |
</div> |
|
36 |
</div> |
|
37 |
|
|
38 |
<div class="uk-margin-large-top"> |
|
39 |
<h3>Take a look at the Provide Dashboard and functionalities</h3> |
|
40 |
|
|
41 |
|
|
42 |
</div> |
|
43 |
|
|
44 |
</div> |
|
45 |
</div> |
|
46 |
</div> |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/join/join.component.ts | ||
---|---|---|
1 |
import { Component, OnInit } from '@angular/core'; |
|
2 |
import { RepositoryService } from "../../services/repository.service"; |
|
3 |
import { SharedService } from "../../services/shared.service"; |
|
4 |
import { RepositorySnippet } from "../../domain/typeScriptClasses"; |
|
5 |
import { Router } from "@angular/router"; |
|
6 |
|
|
7 |
@Component ({ |
|
8 |
selector: 'app-join', |
|
9 |
templateUrl: './join.component.html', |
|
10 |
}) |
|
11 |
|
|
12 |
export class JoinComponent implements OnInit { |
|
13 |
|
|
14 |
repositoriesOfUser: RepositorySnippet[]; |
|
15 |
|
|
16 |
constructor(private repositoryService: RepositoryService, |
|
17 |
private sharedService: SharedService, |
|
18 |
private router: Router) { |
|
19 |
} |
|
20 |
|
|
21 |
ngOnInit() { |
|
22 |
|
|
23 |
let body = document.getElementsByTagName('body')[0]; |
|
24 |
body.classList.remove("landing"); |
|
25 |
body.classList.add("dashboard"); |
|
26 |
|
|
27 |
if(this.sharedService.getRepositoriesOfUser() && this.sharedService.getRepositoriesOfUser().length>0) { |
|
28 |
this.repositoriesOfUser = this.sharedService.getRepositoriesOfUser(); |
|
29 |
if(this.repositoriesOfUser.length>0) |
|
30 |
this.router.navigate([`/repository/${this.repositoriesOfUser[0].id}/dashboard`]); |
|
31 |
} else { |
|
32 |
this.getReposOfUser(); |
|
33 |
} |
|
34 |
|
|
35 |
} |
|
36 |
|
|
37 |
getReposOfUser(): void { |
|
38 |
this.repositoryService.getRepositoriesOfUser() |
|
39 |
.subscribe( |
|
40 |
repos => { |
|
41 |
this.repositoriesOfUser = repos; |
|
42 |
if(this.repositoriesOfUser.length>0) |
|
43 |
this.router.navigate([`/repository/${this.repositoriesOfUser[0].id}/dashboard`]); |
|
44 |
}, |
|
45 |
error => { console.log(error); } |
|
46 |
); |
|
47 |
} |
|
48 |
} |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/emptypage/empty-page.component.ts | ||
---|---|---|
1 |
import { Component, OnInit } from '@angular/core'; |
|
2 |
import { RepositoryService } from "../../services/repository.service"; |
|
3 |
import { SharedService } from "../../services/shared.service"; |
|
4 |
import { RepositorySnippet } from "../../domain/typeScriptClasses"; |
|
5 |
import { Router } from "@angular/router"; |
|
1 |
import { Component } from '@angular/core'; |
|
6 | 2 |
|
7 | 3 |
@Component ({ |
8 | 4 |
selector: 'app-empty-page', |
9 | 5 |
templateUrl: './empty-page.component.html', |
10 | 6 |
}) |
11 | 7 |
|
12 |
export class EmptyPageComponent implements OnInit {
|
|
8 |
export class EmptyPageComponent { |
|
13 | 9 |
|
14 |
repositoriesOfUser: RepositorySnippet[]; |
|
15 |
|
|
16 |
constructor(private repositoryService: RepositoryService, |
|
17 |
private sharedService: SharedService, |
|
18 |
private router: Router) { |
|
19 |
} |
|
20 |
|
|
21 |
ngOnInit() { |
|
22 |
|
|
23 |
let body = document.getElementsByTagName('body')[0]; |
|
24 |
body.classList.remove("landing"); |
|
25 |
body.classList.add("dashboard"); |
|
26 |
|
|
27 |
if(this.sharedService.getRepositoriesOfUser() && this.sharedService.getRepositoriesOfUser().length>0) { |
|
28 |
this.repositoriesOfUser = this.sharedService.getRepositoriesOfUser(); |
|
29 |
if(this.repositoriesOfUser.length>0) |
|
30 |
this.router.navigate([`/repository/${this.repositoriesOfUser[0].id}/dashboard`]); |
|
31 |
// this.getSelectedRepositorySummaryInfo(this.repository); |
|
32 |
} else { |
|
33 |
this.getReposOfUser(); |
|
34 |
} |
|
35 |
|
|
36 |
// this.sharedService.repositoriesOfUser$.subscribe( |
|
37 |
// r => { |
|
38 |
// this.repositoriesOfUser = r; |
|
39 |
// } |
|
40 |
// ); |
|
41 |
|
|
42 |
} |
|
43 |
|
|
44 |
getReposOfUser(): void { |
|
45 |
this.repositoryService.getRepositoriesOfUser() |
|
46 |
.subscribe( |
|
47 |
repos => { |
|
48 |
this.repositoriesOfUser = repos; |
|
49 |
// this.sharedService.setRepositoriesOfUser(repos); |
|
50 |
if(this.repositoriesOfUser.length>0) |
|
51 |
this.router.navigate([`/repository/${this.repositoriesOfUser[0].id}/dashboard`]); |
|
52 |
}, |
|
53 |
error => { console.log(error); } |
|
54 |
); |
|
55 |
} |
|
10 |
constructor() {} |
|
56 | 11 |
} |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/services/authentication.service.ts | ||
---|---|---|
30 | 30 |
sessionStorage.setItem('state.location', url); |
31 | 31 |
} else { |
32 | 32 |
/*sessionStorage.setItem("state.location", this.router.url);*/ |
33 |
sessionStorage.setItem('state.location', '/emptyPage');
|
|
33 |
sessionStorage.setItem('state.location', '/join');
|
|
34 | 34 |
} |
35 | 35 |
console.log('redirect location', sessionStorage.getItem('state.location')); |
36 | 36 |
window.location.href = this.loginUrl; |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/app.module.ts | ||
---|---|---|
22 | 22 |
import { DashboardService } from "./services/dashboard.service"; |
23 | 23 |
import { EmptyPageComponent } from "./pages/emptypage/empty-page.component"; |
24 | 24 |
import { SharedService } from "./services/shared.service"; |
25 |
import { JoinComponent } from "./pages/join/join.component"; |
|
25 | 26 |
|
26 | 27 |
|
27 | 28 |
@NgModule({ |
... | ... | |
29 | 30 |
AppComponent, |
30 | 31 |
LandingComponent, |
31 | 32 |
EmptyPageComponent, |
33 |
JoinComponent |
|
32 | 34 |
], |
33 | 35 |
imports: [ |
34 | 36 |
BrowserModule, |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/app-routing.module.ts | ||
---|---|---|
2 | 2 |
import { NgModule } from '@angular/core'; |
3 | 3 |
import { LandingComponent } from './pages/landing/landing.component'; |
4 | 4 |
import { AuthGuardService } from './services/auth-guard.service'; |
5 |
import { DashboardComponent } from './pages/repository/dashboard/dashboard.component'; |
|
6 | 5 |
import { ForbiddenPageComponent } from './shared/reusablecomponents/403-forbidden-page.component'; |
7 |
import {EmptyPageComponent} from "./pages/emptypage/empty-page.component"; |
|
6 |
import { EmptyPageComponent } from "./pages/emptypage/empty-page.component"; |
|
7 |
import { JoinComponent } from "./pages/join/join.component"; |
|
8 | 8 |
|
9 | 9 |
const appRoutes: Routes = [ |
10 | 10 |
{ |
... | ... | |
17 | 17 |
component: LandingComponent |
18 | 18 |
}, |
19 | 19 |
{ |
20 |
path: 'join', |
|
21 |
component: JoinComponent, |
|
22 |
canActivate: [AuthGuardService] |
|
23 |
}, |
|
24 |
{ |
|
20 | 25 |
path: 'emptyPage', |
21 | 26 |
component: EmptyPageComponent, |
22 | 27 |
canActivate: [AuthGuardService] |
Also available in: Unified diff
Added a join page which will be the page users see when they login and they don't have a repository registered