Skip to content

Commit

Permalink
Fixed search redirection and license icons (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak committed Jun 19, 2024
1 parent 78c4d97 commit afc6f11
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 34 deletions.
4 changes: 3 additions & 1 deletion src/app/home-page/home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ export class HomePageComponent implements OnInit {
.pipe(getFirstSucceededRemoteDataPayload())
.subscribe(authorStats => {
authorStats.page.forEach((facetValue: FacetValue) => {
const updatedSearchUrl = facetValue?._links?.search?.href?.replace(this.halService.getRootHref() +
let updatedSearchUrl = facetValue?._links?.search?.href?.replace(this.halService.getRootHref() +
'/discover', this.baseUrl);
// remove `/objects` from the updatedSearchUrl
updatedSearchUrl = updatedSearchUrl.replace('/objects', '');
const fastSearchLink: FastSearchLink = Object.assign(new FastSearchLink(), {
name: facetValue.value,
occurrences: facetValue.count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="text-center">
<div>
<span>{{'item.page.license.message.0' | translate}}</span>
<span [ngClass]="'label ' + ' label-' + licenseLabel + ' rounded text-white pl-1'">
<span [ngClass]="'label ' + ' label-' + licenseLabel + ' rounded pl-1'">
{{licenseType}}
</span>
<span class="pl-1">{{'item.page.license.message.1' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.label-PUB {
background-color: #5cb811;
background-color: #5cb811 !important;
color: white !important;
}

.label-RES {
background-color: #c62d1f;
background-color: #c62d1f !important;
color: white !important;
}

.label-ACA, .label-PDT {
background-color: #ffab23;
background-color: #ffab23 !important;
color: white !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class ClarinGenericItemFieldComponent implements OnInit {
}

const searchType = convertMetadataFieldIntoSearchType(this.fields);
return this.baseUrl + '/search/objects?f.' + searchType + '=' + metadataValue + ',equals';
return this.baseUrl + '/search?f.' + searchType + '=' + metadataValue + ',equals';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,6 @@
border-bottom: none;
}

.label-icon {
border-radius: 0.25em 0 0 0.25em;
}

.label-PUB {
background-color: #dff0d8 !important;
color: #5cb811 !important;;
}

.label-RES {
color: #c62d1f !important;
background-color: #f2dede !important;
}

.label-ACA, .label-PDT {
color: #ffab23 !important;
background-color: #fcf8e3 !important;
}

.label-license {
margin-right: -6px;
margin-top: 6px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Component, Input, OnInit } from '@angular/core';
import { Item } from '../../core/shared/item.model';
import { MetadataValue } from '../../core/shared/metadata.models';
import { CollectionDataService } from '../../core/data/collection-data.service';
import {
getFirstCompletedRemoteData,
getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteListPayload
} from '../../core/shared/operators';
import { Collection } from '../../core/shared/collection.model';
import { isNull, isUndefined } from '../empty.util';
import { isNull } from '../empty.util';
import { followLink } from '../utils/follow-link-config.model';
import { Community } from '../../core/shared/community.model';
import { BehaviorSubject } from 'rxjs';
Expand Down Expand Up @@ -158,7 +157,7 @@ export class ClarinItemBoxViewComponent implements OnInit {
.pipe(getFirstSucceededRemoteDataPayload())
.subscribe((community: Community) => {
this.itemCommunity.next(community);
this.communitySearchRedirect.next(this.baseUrl + '/search/objects?f.items_owning_community=' +
this.communitySearchRedirect.next(this.baseUrl + '/search?f.items_owning_community=' +
this.dsoNameService.getName(community) + ',equals');
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/clarin-shared-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function loadItemAuthors(item, itemAuthors, baseUrl) {
}
const itemAuthorsLocal = [];
authorsMV.forEach((authorMV: MetadataValue) => {
const authorSearchLink = baseUrl + '/search/objects?f.author=' + authorMV.value + ',equals';
const authorSearchLink = baseUrl + '/search?f.author=' + authorMV.value + ',equals';
const authorNameLink = Object.assign(new AuthorNameLink(), {
name: authorMV.value,
url: authorSearchLink
Expand Down
17 changes: 12 additions & 5 deletions src/styles/_clarin-styles.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
.label-PUB {
background-color: #5cb811;
.label-icon {
border-radius: 0.25em 0 0 0.25em;
}

.label-ACA, .label-PDT {
background-color: #ffab23;
.label-PUB {
background-color: #dff0d8 !important;
color: #5cb811 !important;;
}

.label-RES {
background-color: #c62d1f;
color: #c62d1f !important;
background-color: #f2dede !important;
}

.label-ACA, .label-PDT {
color: #ffab23 !important;
background-color: #fcf8e3 !important;
}

.cursor-pointer {
Expand Down

0 comments on commit afc6f11

Please sign in to comment.