forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed all mistakes in the Search page (#537)
* Composing of the Item's date was refactored and moved into shared service. * The item view box was refactored. The item view box is different for the search result. The label title is triggered on mouse hover. * Show workspace items in the `/mydspace` - there were problem with filtering `dsoTypes` in the `clarin-search.component` * Use Vanilla file size in the Item View and search results in the item view box. * Updated sorting option names * Updated search filter head messages * Defined search options in the themed-search.component.ts following CLARIN requirements. * Default configuration list must be set to null instead of empty array, because it shows empty space. * Use homepage configuration which contains searching by dc.date.accessioned * Updated border in the item view box * Updated `Has files` filter messages * Show Item type in the Item view from the `emd.type` * Fixed searching by publisher. * Added languages for `Community` and `Rights` filtering. * Updated `Search all of DSpace` button color. * Fixed showing license label icons when there is czech translation. * Updated messages on sidebar search and results header. * Updated RSS Feed description button and css * Prettied Copy button of handle in the Item View page * Updated favicon icon * Update item view box: Fixed occurrences when the author is null. * Remove `DSpace Repository ::` from the browser page title. * Use `LINDAT/CLARIAH-CZ Repository title prefix` * Fixed unit tests * Fixed linting errors * Commented out check for view options in the Search page - for CLARIN that options was disabled. * Fixed Verify SSR - do not check if there is DSpace in the title
- Loading branch information
1 parent
d581c36
commit 8a7329a
Showing
32 changed files
with
204 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...field-components/clarin-identifier-item-field/clarin-identifier-item-field.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { Item } from '../core/shared/item.model'; | ||
|
||
const MULTIPLE_DATE_VALUES_SEPARATOR = ','; | ||
|
||
@Injectable() | ||
export class ClarinDateService { | ||
constructor(private translateService: TranslateService) {} | ||
|
||
/** | ||
* Compose date value for the item. The date value could be fetched from the local metadata or from the | ||
* default metadata. The date value could be a single value or multiple values (local metadata). | ||
* @param item | ||
*/ | ||
composeItemDate(item: Item): string { | ||
let localDateValue = item.allMetadataValues('local.approximateDate.issued'); | ||
let dateValue = item.allMetadataValues('dc.date.issued'); | ||
|
||
// There is no local date value - show only one date metadata value | ||
if (localDateValue.length === 0) { | ||
// Date value is not empty | ||
if (dateValue.length !== 0) { | ||
return dateValue[0]; | ||
} else { | ||
console.error('There is no date value for the item'); | ||
return ''; | ||
} | ||
} | ||
|
||
// There is local date value - that values could be different and should be shown differently | ||
localDateValue = localDateValue[0]?.split(MULTIPLE_DATE_VALUES_SEPARATOR); | ||
|
||
if (localDateValue.length === 1) { | ||
return this.updateOneValue(localDateValue); | ||
} else { | ||
return this.updateMoreValues(localDateValue); | ||
} | ||
} | ||
|
||
updateOneValue(localDateValue: string[]) { | ||
const ccaMessage = this.translateService.instant('item.page.date.cca.message'); | ||
return ccaMessage + ' (' + localDateValue[0] + ')'; | ||
} | ||
|
||
updateMoreValues(localDateValue: string[]) { | ||
const composedMessage = this.translateService.instant('item.page.date.composed.message'); | ||
const dateValues = localDateValue.join(MULTIPLE_DATE_VALUES_SEPARATOR); | ||
return composedMessage + ' ' + dateValues; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
src/app/shared/clarin-item-author-preview/clarin-item-author-preview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.