Fix active menus in navbar. Add user-info and reload pages. Add message in browse-stakeholders if the list is empty.

This commit is contained in:
Konstantinos Triantafyllou 2023-11-16 14:38:27 +02:00
parent b02758e19c
commit 9530677a00
17 changed files with 56 additions and 34 deletions

View File

@ -15,7 +15,8 @@ import {MenuItem} from "../openaireLibrary/sharedComponents/menu";
[class.sidebar_main_active]="open && (hasSidebar || hasInternalSidebar)"
[class.sidebar_mini]="!open && (hasSidebar || hasInternalSidebar)"
[class.sidebar_hover]="hover">
<dashboard-sidebar *ngIf="hasSidebar && !hasInternalSidebar && sideBarItems.length > 0" [items]="sideBarItems" [backItem]="backItem"></dashboard-sidebar>
<dashboard-sidebar *ngIf="hasSidebar && !hasInternalSidebar && sideBarItems.length > 0" [logoURL]="stakeholder | logoUrl"
[items]="sideBarItems" [backItem]="backItem"></dashboard-sidebar>
<div class="uk-width-1-1">
<router-outlet></router-outlet>
</div>

View File

@ -5,6 +5,7 @@ import {AdminComponent} from "./admin.component";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {SideBarModule} from "../openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module";
@NgModule({
imports: [CommonModule, RouterModule.forChild([
@ -23,14 +24,14 @@ import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
{
matcher: HelperFunctions.routingMatcher(['indicators', 'indicators/:topic']),
loadChildren: () => import('../openaireLibrary/monitor-admin/topic/topic.module').then(m => m.TopicModule),
data: {hasInternalSidebar: true},
data: {hasInternalSidebar: true, showLogo: true},
pathMatch: 'full'
},
]
}
]
}
]), SideBarModule, LoadingModule],
]), SideBarModule, LoadingModule, LogoUrlPipeModule],
declarations: [AdminComponent],
exports: [AdminComponent]
})

View File

@ -2,8 +2,19 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {Irish} from "./shared/irish";
import {ErrorPageComponent} from "./openaireLibrary/error/errorPage.component";
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
const routes: Routes = [
{
path: 'reload',
loadChildren: () => import('./openaireLibrary/reload/reload.module').then(m => m.ReloadModule),
data: {hasSidebar: false}
},
{
path: 'user-info',
loadChildren: () => import('./openaireLibrary/login/user.module').then(m => m.UserModule),
data: {hasSidebar: false}
},
{
path: 'rpo',
loadChildren: () => import('./rpo/rpo.module').then(m => m.RpoModule),
@ -25,7 +36,8 @@ const routes: Routes = [
{
path: 'admin',
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
data: {title: Irish.METADATA_PREFIX + ' Admin | '},
data: {title: Irish.METADATA_PREFIX + ' Admin | ', monitorCurator: true},
canActivateChild: [AdminLoginGuard]
},
{path: 'participate', loadChildren: () => import('./claims/claims.module').then(m => m.ClaimsModule)},
{

View File

@ -69,7 +69,7 @@ export class AppComponent extends StakeholderBaseComponent implements OnInit {
initialize() {
this.menuItems = [
new MenuItem("national", this.stakeholderUtils.entities.country + ' ' + this.stakeholderUtils.entities.stakeholder, "", "/", false, [], null, {}, null, null, null, '/search'),
new MenuItem("national", this.stakeholderUtils.entities.country + ' ' + this.stakeholderUtils.entities.stakeholder, "", "/", false, [], null, {}, null, null, null),
new MenuItem("rpo", this.stakeholderUtils.entities.organization + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rpo", false, [], null, {}, null, null, null, "/rpo"),
new MenuItem("rfo", this.stakeholderUtils.entities.funder + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rfo", false, [], null, {}, null, null, null, "/rfo"),
new MenuItem("researcher", "Researcher Monitors", "", "/researcher", false, [], null, {}, null, null, null, "/researcher"),

View File

@ -26,9 +26,9 @@ import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/s
<div class="uk-container uk-container-large">
<ul class="uk-banner-tab uk-padding-small uk-padding-remove-vertical">
<li [class.uk-active]="!isSearch">
<a [routerLink]="'/'" (click)="isSearch = false">{{entities.stakeholder}}</a>
<a [routerLink]="'/'">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch" (click)="isSearch = true">
<li [class.uk-active]="isSearch">
<a [routerLink]="'/search/find/research-outcomes'">Browse Research Outputs</a>
</li>
</ul>

View File

@ -6,9 +6,9 @@ import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
const routes: Route[] = [
{
path: '', component: NationalComponent, children: [
{path: 'search', loadChildren: () => import('../search/search.module').then(m => m.SearchModule)},
{path: '', loadChildren: () => import('../shared/monitor/monitor.module').then(m => m.MonitorModule)},
], data: {stakeholder: 'tubitak'}
{path: 'search', loadChildren: () => import('../search/search.module').then(m => m.SearchModule), data: {activeMenuItem: "national"}},
{path: '', loadChildren: () => import('../shared/monitor/monitor.module').then(m => m.MonitorModule), data: {activeMenuItem: "national"}},
], data: {stakeholder: 'irish'}
}
];

@ -1 +1 @@
Subproject commit 16b6a34d25608ec50e195159db9978046b55eda9
Subproject commit 79d49c80e334c7674456b427e5cb59f2a9e4ae50

View File

@ -30,7 +30,7 @@ import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/s
<a [routerLink]="['./', stakeholder.alias]" [relativeTo]="_route"
(click)="isSearch = false">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch" (click)="isSearch = true">
<li [class.uk-active]="isSearch">
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse
Research Outputs</a>
</li>

View File

@ -30,7 +30,7 @@ import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/s
<a [routerLink]="['./', stakeholder.alias]" [relativeTo]="_route"
(click)="isSearch = false">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch" (click)="isSearch = true">
<li [class.uk-active]="isSearch">
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse
Research Outputs</a>
</li>

View File

@ -3,12 +3,12 @@
<loading></loading>
</div>
</ng-container>
<div *ngIf="!showLoading && stakeholders?.length" class="uk-container uk-container-large">
<div *ngIf="!showLoading" class="uk-container uk-container-large">
<div class="uk-flex uk-flex-middle uk-flex-center uk-position-relative">
<div search-input *ngIf="keywordControl" [searchControl]="keywordControl" searchInputClass="border-bottom" iconPosition="left"
placeholder="Search for {{typeAsLabel}} {{entities.stakeholders}}" [disabled]="showLoading" class="uk-width-1-2@m uk-width-1-1">
placeholder="Search for {{typeAsLabel}} {{entities.stakeholders}}" [disabled]="stakeholders.length === 0" class="uk-width-1-2@m uk-width-1-1">
</div>
<div class="uk-flex uk-flex-middle uk-position-right">
<div *ngIf="stakeholders.length > 0" class="uk-flex uk-flex-middle uk-position-right">
<a (click)="gridView = true" [ngClass]="gridView ? 'active' : ''" class="uk-link-reset uk-margin-small-right">Grid</a>
<a (click)="gridView = false" [ngClass]="gridView ? '' : 'active'" class="uk-link-reset">List</a>
</div>
@ -37,8 +37,10 @@
</div>
</div>
<div class="uk-margin-large-top" id="target">
<div *ngIf="!filteredStakeholders || filteredStakeholders?.length == 0" class="uk-text-center">
No {{entities.stakeholders}} available
<div *ngIf="!filteredStakeholders || filteredStakeholders?.length == 0" class="uk-flex uk-flex-center">
<div class="uk-card uk-card-default uk-card-body uk-text-bold uk-text-center uk-width-2-3@m uk-width-1-1">
No {{entities.stakeholders}} available
</div>
</div>
<!-- STAKEHOLDERS -->
<!-- Grid view -->
@ -64,20 +66,18 @@
</div>
</div>
</div>
<div class="uk-background-muted">
<div class="uk-padding-small uk-grid uk-grid-divider uk-child-width-1-2" uk-grid>
<div>
<div class="uk-card-footer uk-padding-small uk-background-muted">
<div class="uk-grid uk-grid-divider uk-flex-center uk-child-width-1-2@m" uk-grid>
<div *ngIf="item.funderType">
<div class="uk-text-xsmall">
Type
</div>
<div class="uk-text-small uk-text-bold uk-text-capitalize">
{{item.type}}
<div class="uk-text-small uk-text-bold">
{{getFunderTypeLabel(item.funderType)}}
</div>
</div>
<div>
<div>
% Open Access
</div>
</div>
</div>
</div>
@ -94,7 +94,7 @@
<tr>
<th>Logo</th>
<th>Name</th>
<th>Type</th>
<th *ngIf="stakeholderType === 'funder'">Type</th>
<th>Open Access %</th>
</tr>
</thead>
@ -114,9 +114,9 @@
{{item.name}}
</div>
</td>
<td>
<div class="uk-text-small uk-text-bold uk-text-capitalize">
{{item.type}}
<td *ngIf="stakeholderType === 'funder'">
<div *ngIf="item.funderType" class="uk-text-small uk-text-bold uk-text-capitalize">
{{getFunderTypeLabel(item.funderType)}}
</div>
</td>
<td>

View File

@ -18,10 +18,12 @@ export class Irish {
StakeholderConfiguration.TYPES = [
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
{value: 'organization', label: StakeholderConfiguration.ENTITIES.organization},
{value: 'country', label: StakeholderConfiguration.ENTITIES.country}
{value: 'country', label: StakeholderConfiguration.ENTITIES.country},
{value: 'datasource', label: StakeholderConfiguration.ENTITIES.datasource}
]
StakeholderConfiguration.FUNDER_TYPES = [
{value: null, label: 'None'},
{value: 'private', label: 'Private'},
{value: 'government', label: 'Government'}
];

View File

@ -1,5 +1,5 @@
<div page-content [border]="isMobile">
<div actions>
<div class="uk-margin-top" actions>
<div *ngIf="activeCategory && countSubCategoriesToShow(activeCategory) > 0" [class.uk-margin-bottom]="isMobile">
<slider-tabs *ngIf="stakeholder && !loading && activeTopic" [border]="!isMobile" [type]="'dynamic'">
<ng-template ngFor [ngForOf]="activeCategory.subCategories" let-subCategory>

@ -1 +1 @@
Subproject commit 6bb1e61b059bef1bff3bfb0611b0df46f7840426
Subproject commit b68f375714b679743e586bb2fb4721e633e43fc1

View File

@ -4,7 +4,6 @@
@secondary-color: #FF7901;
@ciel-color: #DCE9E3;
@default-color: #F9FBFC;
@muted-color: @gray-300;
@funder-color: #4D276F;

View File

@ -3,6 +3,9 @@
/** Backgrounds */
@global-primary-gradient: radial-gradient(closest-side at 50% 50%, @primary-light-color 0%, @primary-dark-color 100%);
/** Border */
@global-border: @gray-300;
/* Controls */
@global-control-small-height: 25px;
@global-control-height: 33px;

View File

@ -13,6 +13,7 @@
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@primary-color: @funder-color;
@primary-light-color: #9A4DDD;
@ -27,7 +28,7 @@
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@primary-color: @organization-color;
@primary-light-color: #ffe165;
@primary-dark-color: #9c7d00;
@ -41,6 +42,7 @@
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@primary-color: @datasource-color;
@primary-light-color: #D45E50;
@ -55,6 +57,7 @@
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@primary-color: @researcher-color;
@primary-light-color: #3086ED;

View File

@ -6,5 +6,6 @@
@import "~src/assets/common-assets/less/landing";
@import "~src/assets/common-assets/less/linking";
@import "~src/assets/common-assets/less/dashboard";
@import "~src/assets/common-assets/less/indicators";
@import "~src/assets/common-assets/less/ckeditor";
@import "~src/assets/irish-monitor";