Skip to content

Commit

Permalink
ufal/fe-assetstore-files-are-not-loaded (#371)
Browse files Browse the repository at this point in the history
* Redirection was broken after updating the namespace. The redirection links was changed from `href` to `routerLink`

* Fixed test

* Fixed test

* namespace could be empty
  • Loading branch information
milanmajchrak authored Oct 5, 2023
1 parent 80394f1 commit 4ab1746
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 52 deletions.
5 changes: 3 additions & 2 deletions src/aai/aai.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
function AAI() {
var host = 'https://' + window.location.hostname,
ourEntityID = host.match("lindat.mff.cuni.cz") ? "https://ufal-point.mff.cuni.cz" : host;
var namespace = ''
this.defaults = {
//host : 'https://ufal-point.mff.cuni.cz',
host : host, //better default (useful when testing on ufal-point-dev)
Expand Down Expand Up @@ -33,7 +34,7 @@
opts.responseUrl,
[ ],
opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target='+opts.target+'&entityID=');
djc.discoPath = window.location.origin + "/assets/";
djc.discoPath = window.location.origin + (namespace === '' ? namespace : '/' + namespace) + "/assets/";
djc.metadata = [opts.metadataFeed];
djc.subtitle = "Login via Your home institution (e.g. university)";
djc.textHelp = opts.textHelp;
Expand Down Expand Up @@ -71,7 +72,7 @@
case 'local':
// DiscoJuice.UI.setScreen(opts.localauth);
// jQuery('input#login').focus();
window.location = "/login?redirectUrl=" + window.location.href;
window.location = window.location.origin + (namespace === '' ? namespace : '/' + namespace) + "/login?redirectUrl=" + window.location.href;
break;
//case 'saml':
default:
Expand Down
2 changes: 1 addition & 1 deletion src/aai/discojuice/discojuice.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/clarin-navbar-top/clarin-navbar-top.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<a class="hidden" id="repository_path" [href]="repositoryPath"></a>
<div *ngIf="authenticatedUser != null" class="badge clarin-logout-badge px-2 py-1">
<span>
<a style="color: #FFF;" href="/profile">
<a routerLink="/profile" style="color: #FFF;">
<i class="fa fa-user pr-1 fa-lg"></i>{{authenticatedUser.name}}
</a>
</span>
<span class="text-white px-1">|</span>
<a style="color: #FFF;" href="/logout">
<a routerLink="/logout" style="color: #FFF;">
<i class="fas fa-sign-out-alt pr-1 fa-lg" aria-hidden="true"></i>{{'logout.title' | translate}}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/contact-page/contact-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1>{{'contact-us.title' | translate}}</h1>
<p>{{'contact-us.description' | translate}}</p>
<div class="text-left">
<span>{{'contact-us.form' | translate}} </span>
<a href="info/feedback" class="ml-4">{{'contact-us.feedback' | translate}}</a>
<a routerLink="info/feedback" class="ml-4">{{'contact-us.feedback' | translate}}</a>
</div>
<div class="text-left">
<span>{{'contact-us.email' | translate}}</span>
Expand Down
12 changes: 7 additions & 5 deletions src/app/contact-page/contact-page.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { TranslateModule } from '@ngx-translate/core';
import { ContactPageComponent } from './contact-page.component';
import { ContactPageRoutingModule } from './contact-page-routing.module';
import { ThemedContactPageComponent } from './themed-contact-page.component';
import { RouterModule } from '@angular/router';

@NgModule({
imports: [
CommonModule,
ContactPageRoutingModule,
TranslateModule
],
imports: [
CommonModule,
ContactPageRoutingModule,
TranslateModule,
RouterModule
],
declarations: [
ContactPageComponent,
ThemedContactPageComponent
Expand Down
10 changes: 5 additions & 5 deletions src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ <h5 class="h5-font carousel-deposit-cite">{{'home-page.carousel.deposit.cite' |
</div>
<div class="col-md-4 d-none d-lg-block">
<div class="row">
<a class="col-md-7" style="height: 160px; position: relative;" href="/home">
<img alt="LINDAT/CLARIAH-CZ logo" class="logo" style="position: absolute; height: 50%; top: 0px; bottom: 0px; margin: auto;" src="../../assets/images/lindat-logo-new-sm.png">
<a routerLink="home" class="col-md-7" style="height: 160px; position: relative;">
<img alt="LINDAT/CLARIAH-CZ logo" class="logo" style="position: absolute; height: 50%; top: 0px; bottom: 0px; margin: auto;" src="assets/images/lindat-logo-new-sm.png">
</a>
<a class="col-md-5" style="height: 160px; position: relative;" href="http://www.clarin.eu/">
<img alt="LINDAT/CLARIAH-CZ logo" class="logo" style="position: absolute; height: 50%; top: 0px; bottom: 0px; margin: auto;" src="../../assets/images/clarin-logo.png">
<img alt="LINDAT/CLARIAH-CZ logo" class="logo" style="position: absolute; height: 50%; top: 0px; bottom: 0px; margin: auto;" src="assets/images/clarin-logo.png">
</a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row hidden-xs lindat-color-line">&nbsp;</div>
<div class="row hidden-xs lindat-color-line"><img class="w-100" src="assets/images/lindat_color_line.png"></div>
</div>
<div class="container clarin-home-page-color pt-4 pb-5">
<div class="row justify-content-center pt-4">
Expand All @@ -57,7 +57,7 @@ <h5 class="h5-font carousel-deposit-cite">{{'home-page.carousel.deposit.cite' |
</div>
</div>
<div class="row justify-content-center pt-3">
<a href="/search">{{'home-page.advanced-search' | translate}}</a>
<a href="javascript:void(0);" (click)="redirectToSearch('')">{{'home-page.advanced-search' | translate}}</a>
</div>
<div class="row justify-content-center pt-5">
<div class="col-md-9">
Expand Down
14 changes: 0 additions & 14 deletions src/app/home-page/home-page.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,9 @@
}

.lindat-color-line {
background-image: url('../../assets/images/lindat_color_line.png');
height: 3px;
}

.lindat-logo-big {
background-image: url('../../assets/images/lindat-logo-new-sm.png');
position: absolute;
height: 60%;
top: 0px;
bottom: 0px;
margin: auto;
}

.clarin-logo-big {
background-image: url('../../assets/images/clarin-logo.png');
}

.clarin-fix-to-navbar {
margin-top: -25px;
box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 6px silver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="{{columnSizes.columns[3].buildClasses()}} row-element d-flex align-items-center">
<div class="text-center w-100">
<div class="btn-group relationship-action-buttons">
<a *ngIf="bitstreamDownloadUrl != null" [href]="bitstreamDownloadUrl"
<a *ngIf="bitstreamDownloadUrl != null" [routerLink]="bitstreamDownloadUrl"
class="btn btn-outline-primary btn-sm"
title="{{'item.edit.bitstreams.edit.buttons.download' | translate}}"
[attr.data-test]="'download-button' | dsBrowserOnly">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ItemEditBitstreamComponent } from './item-edit-bitstream.component';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service';
import { of as observableOf } from 'rxjs';
import { Bitstream } from '../../../../core/shared/bitstream.model';
Expand All @@ -13,6 +13,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-dat
import { getBitstreamDownloadRoute } from '../../../../app-routing-paths';
import { By } from '@angular/platform-browser';
import { BrowserOnlyMockPipe } from '../../../../shared/testing/browser-only-mock.pipe';
import { RouterLinkDirectiveStub } from '../../../../shared/testing/router-link-directive.stub';

let comp: ItemEditBitstreamComponent;
let fixture: ComponentFixture<ItemEditBitstreamComponent>;
Expand Down Expand Up @@ -77,6 +78,7 @@ describe('ItemEditBitstreamComponent', () => {
ItemEditBitstreamComponent,
VarDirective,
BrowserOnlyMockPipe,
RouterLinkDirectiveStub
],
providers: [
{ provide: ObjectUpdatesService, useValue: objectUpdatesService }
Expand Down Expand Up @@ -131,8 +133,11 @@ describe('ItemEditBitstreamComponent', () => {
describe('when the component loads', () => {
it('should contain download button with a valid link to the bitstreams download page', () => {
fixture.detectChanges();
const downloadBtnHref = fixture.debugElement.query(By.css('[data-test="download-button"]')).nativeElement.getAttribute('href');
expect(downloadBtnHref).toEqual(comp.bitstreamDownloadUrl);
const linkDes = fixture.debugElement.queryAll(By.directive(RouterLinkDirectiveStub));
const routerLinkQuery = linkDes.map((de) => de.injector.get(RouterLinkDirectiveStub));

expect(routerLinkQuery.length).toBe(2);
expect(routerLinkQuery[0].routerLink).toBe(comp.bitstreamDownloadUrl);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h5 class="display-4">{{'clarin.autoregistration.welcome.message' | translate}}
<div class="row">
<div class="col-11">
<div>
{{'clarin.autoregistration.repository.policy.message.0' | translate}} <b><a href="/info/privacy">{{ baseUrl+'/info/privacy' }}</a></b>
{{'clarin.autoregistration.repository.policy.message.0' | translate}} <b><a routerLink="/info/privacy">{{ baseUrl+'/info/privacy' }}</a></b>
</div>
<div>{{'clarin.autoregistration.repository.policy.message.1' | translate}}</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/page-error/page-error.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ <h2><small>{{"error-page.description." + status | translate}}</small></h2>
<p>{{"error-page." + code | translate}}</p>
<br/>
<p class="text-center">
<a href="/home" class="btn btn-primary">{{ status + ".link.home-page" | translate}}</a>
<a routerLink="/home" class="btn btn-primary">{{ status + ".link.home-page" | translate}}</a>
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ <h2><small>
<p>{{"500.help" | translate}}</p>
<br/>
<p class="text-center">
<a href="home" class="btn btn-primary">{{"500.link.home-page" | translate}}</a>
<a routerLink="home" class="btn btn-primary">{{"500.link.home-page" | translate}}</a>
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="pl-3">
<div class="row pt-3 justify-content-between">
<div class="">
<div><a [href]="itemUri" class="item-name">{{ itemName }}</a></div>
<div><a [routerLink]="itemUri" class="item-name">{{ itemName }}</a></div>
<div class="pt-1"><strong>{{'item.view.box.author.message' | translate}}</strong></div>
</div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div id="aspect_submission_StepTransformer_item_head" class="form-group distribution_licnese_head">
<span> {{'submission.sections.clarin-license.head.read-accept' | translate}} </span>
<span class="">
<a [href]="contractRoutingPath + '?collectionId=' + collectionId" class="target_blank"
<a [routerLink]="contractRoutingPath + '?collectionId=' + collectionId" class="target_blank"
target="_blank">{{'submission.sections.clarin-license.head.license-agreement' | translate}}</a>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div id="placeholder">
<span>{{'submission.sections.clarin-license.head.license-select-providing.0' | translate}}</span>
<span>
<a href="/repository/xmlui/page/licenses" class="target_blank alert-link" target="_blank">
<a routerLink="licenses" class="target_blank alert-link" target="_blank">
{{'submission.sections.clarin-license.head.license-select-providing.1' | translate}}
</a>
</span>
Expand Down
Binary file added src/assets/images/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/styles/_global-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ body {
overflow-x: hidden;
}

a {
cursor: pointer;
}

// Sticky Footer
.outer-wrapper {
display: flex;
Expand Down
24 changes: 12 additions & 12 deletions src/themes/dspace/app/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<header data-version="3.0.5" data-build="05eff1186f12528f221a63b021c7b7dc81301429">
<nav class="lindat-navbar lindat-navbar-expand-lg lindat-justify-content-between lindat-navbar-dark ">
<div class="lindat-block lindat-block--clariah-theme-branding">
<a href="/home" class="lindat-navbar-brand lindat-d-flex lindat-align-items-center " aria-label="">
<a routerLink="home" class="lindat-navbar-brand lindat-d-flex lindat-align-items-center " aria-label="">
<img src="https://lindat.mff.cuni.cz/sites/default/files/LINDAT-CLARIAH-cz-gray_0.svg" width="auto" height="53" style="height: 53px !important;" alt="LINDAT/CLARIAH-CZ logo" class="" />
</a>
</div>
Expand All @@ -17,34 +17,34 @@
<div class="lindat-block lindat-block--clariah-theme-main-menu">
<ul class="lindat-nav lindat-navbar-nav">
<li class="lindat-nav-item ">
<a href="/community-list" class="lindat-nav-link">{{'navbar.community-list' | translate}}</a>
<a routerLink="community-list" class="lindat-nav-link">{{'navbar.community-list' | translate}}</a>
</li>
<li class="lindat-nav-item ">
<a href="/home" class="lindat-nav-link">{{'navbar.repository' | translate}}</a>
<a routerLink="home" class="lindat-nav-link">{{'navbar.repository' | translate}}</a>
</li>
<li class="lindat-nav-item ">
<a href="/#education" class="lindat-nav-link">{{'navbar.education' | translate}}</a>
<a routerLink="education" class="lindat-nav-link">{{'navbar.education' | translate}}</a>
</li>
<li class="lindat-nav-item ">
<a href="/#projects" class="lindat-nav-link">{{'navbar.project' | translate}}</a>
<a routerLink="projects" class="lindat-nav-link">{{'navbar.project' | translate}}</a>
</li>
<li class="lindat-nav-item ">
<a href="/#tools" class="lindat-nav-link ">{{'navbar.tools' | translate}}</a>
<a routerLink="tools" class="lindat-nav-link ">{{'navbar.tools' | translate}}</a>
</li>
<li class="lindat-nav-item ">
<a href="/en/services" class="lindat-nav-link ">{{'navbar.services' | translate}}</a>
<a routerLink="en/services" class="lindat-nav-link ">{{'navbar.services' | translate}}</a>
</li>
<li class="lindat-nav-item lindat-dropdown">
<a href="/" class="lindat-nav-link lindat-dropdown-toggle"
<a routerLink="/" class="lindat-nav-link lindat-dropdown-toggle"
data-toggle="dropdown"
onclick="this.parentNode.querySelector('.lindat-dropdown-toggle+div.lindat-dropdown-menu').classList.toggle('lindat-show'); return false;">{{'navbar.about' | translate}}</a>
<div class="lindat-dropdown-menu">
<a href="/partners" class="lindat-dropdown-item">{{'navbar.about.partners' | translate}}</a>
<a href="/files/mission-en.pdf" class="lindat-dropdown-item">{{'navbar.about.mission-statement' | translate}}</a>
<a routerLink="partners" class="lindat-dropdown-item">{{'navbar.about.partners' | translate}}</a>
<a routerLink="files/mission-en.pdf" class="lindat-dropdown-item">{{'navbar.about.mission-statement' | translate}}</a>
<a href="https://www.clarin.eu/" class="lindat-dropdown-item">{{'navbar.about.clarin' | translate}}</a>
<a href="https://www.dariah.eu/" class="lindat-dropdown-item">{{'navbar.about.dariah' | translate}}</a>
<a href="/integration" class="lindat-dropdown-item">{{'navbar.about.service-integrations' | translate}}</a>
<a href="/partnership" class="lindat-dropdown-item">{{'navbar.about.project-partnership' | translate}}</a>
<a routerLink="integration" class="lindat-dropdown-item">{{'navbar.about.service-integrations' | translate}}</a>
<a routerLink="partnership" class="lindat-dropdown-item">{{'navbar.about.project-partnership' | translate}}</a>
</div>
</li>
</ul>
Expand Down

0 comments on commit 4ab1746

Please sign in to comment.