Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
694ac97
Added a new workflow which runs a build workflow in every customer
milanmajchrak Feb 18, 2025
bcac8cf
Fixed copying of the import logs to the dev machine (#786)
milanmajchrak Feb 21, 2025
b8c9bf4
Call the import every week (#787)
milanmajchrak Feb 25, 2025
6d5b428
UFAL/Use namespace in the redirect URL (#794)
milanmajchrak Mar 5, 2025
508d801
Use current activated route as a parameter to the `createUrlTree` to …
milanmajchrak Mar 5, 2025
4072aca
UFAL/Fixed CMD download command - added name (#798)
Paurikova2 Mar 6, 2025
23e4cfb
UFAL/Fixed editing the license - required info is removed/added follo…
jr-rk Mar 6, 2025
6c0b2be
UFAL/Copy the refbox content correctly (#801)
milanmajchrak Mar 7, 2025
05dc3c1
UFAL/The current version redirect - get the base href using the DOCUM…
milanmajchrak Mar 7, 2025
92f7b6c
UFAL/Start the handle server before tomca
milanmajchrak Mar 13, 2025
c73814a
Sync with ufal main (#799)
kosarko Mar 21, 2025
654611d
UFAL/Edit item - fixed license redirect
jr-rk Mar 28, 2025
6e40b57
Add custom dimension (handle) to pageTrack of matomo (#823)
kosarko Apr 4, 2025
34a1b64
UFAL/Change menu options redirects (#816)
jr-rk Apr 4, 2025
87ec406
UFAL/Preview - fixed loading files (#825)
milanmajchrak Apr 4, 2025
3af7583
UFAL/Handle table issues - Fixed table responsivity and searching (#822)
milanmajchrak Apr 4, 2025
91c631f
UFAL/Redirect to `/lindat` after clicking on the Lindat icon in the h…
milanmajchrak Apr 4, 2025
4637362
Merge remote-tracking branch 'dataquest/dtq-dev' into HEAD
kosarko Apr 9, 2025
ed092db
Merge branch 'clarin-v7' into dataquest/dtq-dev
kosarko Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/import-db/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ runs:
echo $log_file_timestamp
mkdir ../__logs
# Continuously append to the log file $log_file_timestamp. Start appending when the first file is added to the __logs folder.
while true; do tail -F --retry ../__logs/*.txt 2>/dev/null >> $log_file_timestamp & sleep 2; done &
inotifywait -m -e create --format "%w%f" ../__logs/ | while IFS= read -r file; do tail -F --retry "$file" >> "$log_file_timestamp" 2>/dev/null & done &
echo "====="
args=(
--resume=false
Expand Down
14 changes: 14 additions & 0 deletions .github/disabled-workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name: Deploy DSpace

on:
schedule:
- cron: '0 21 * * 6' # Runs every Saturday at 9 PM
workflow_call:
inputs:
INSTANCE:
Expand Down Expand Up @@ -37,6 +39,18 @@ on:
type: boolean

jobs:
import-every-week:
# Only run this job when triggered by the schedule event
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Call the deploy action with predefined inputs
uses: ./.github/actions/deploy-dspace # Path to your custom action
with:
INSTANCE: '8'
IMPORT: true
ERASE_DB: true

deploy-5:
if: inputs.INSTANCE == '*' || inputs.INSTANCE == '5'
runs-on: dspace-dep-1
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/trigger-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Trigger Build for All Customer Branches

on:
schedule:
- cron: "0 */4 * * *" # Runs every 4 hours
workflow_dispatch: # Allows manual triggering

permissions:
actions: write # Grants permission to trigger workflows
contents: read # Access to repository contents

jobs:
trigger-builds:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensures the repository is available

- name: Get and Trigger Customer Branch Builds
run: |
# Authenticate with GitHub CLI using the token
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token

git fetch --prune origin # Ensure remote refs are fetched
BRANCHES=$(git ls-remote --heads origin | awk -F'/' '{print $3"/"$4}' | grep '^customer/')
for branch in $(echo "$BRANCHES" | sed -e 's/[\[\]"]//g' -e 's/,/\n/g'); do
echo "Triggering build for branch: $branch"
gh workflow run build.yml --ref $branch
done
2 changes: 1 addition & 1 deletion docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ services:
while (!</dev/tcp/dspacedb/543${INSTANCE}) > /dev/null 2>&1; do sleep 1; done;
pushd ../webapps && (unlink server || true) && (ln -s /dspace/webapps/server/ 'repository#server' || true) && popd
/dspace/bin/dspace database migrate force
./custom_run.sh
/dspace/bin/start-handle-server
./custom_run.sh
# DSpace database container
dspacedb:
restart: unless-stopped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ export class DefineLicenseFormComponent implements OnInit {
if (event.target.checked) {
form.push(checkBoxValue);
} else {
form.forEach((formValue, index) => {
if (formValue?.id === checkBoxValue.id) {
form.splice(index, 1);
}
});
let index = form.findIndex(item => item.name === checkBoxValue.name);
form.splice(index, 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[placeholder]="'handle-table.edit-handle.form-handle-input-placeholder' | translate">
</div>
<div class="form-group">
<label for="handleId">ID</label>
<label for="handleId">{{'handle-table.edit-handle.form-id-input-text' | translate}}</label>
<input type="text" class="form-control" id="handleId" name="handleId"
[(ngModel)]="id"
placeholder="..."
[placeholder]="'handle-table.edit-handle.form-id-input-placeholder' | translate"
[readonly]="true">
</div>
<div class="form-group" *ngIf="resourceType">
Expand Down
7 changes: 3 additions & 4 deletions src/app/handle-page/handle-table/handle-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ <h5 class="card-header">{{ 'handle-table.title' | translate }}</h5>
</div>
</div>
<input type="text" id="clarin-dc-search-box" class="form-control" aria-label="Text input with dropdown button"
[value]="searchQuery"
#searchInput>
<span class="input-group-append" (click)="searchHandles(searchInput.value)">
[(ngModel)]="searchQuery">
<span class="input-group-append" (click)="searchHandles()">
<button type="submit" class="btn btn-primary search-button">
<i class="fas fa-search"></i>{{'handle-table.dropdown.search-button' | translate}}</button>
</span>
</div>

<!-- The table with pagination -->
<div *ngVar="(handlesRD$ | async)?.payload as handles">
<div class="mb-2">
<div class="mb-2 table-responsive">
<ds-pagination (paginationChange)="onPageChange()"
[sortOptions]="sortConfiguration"
[hideGear]="true"
Expand Down
77 changes: 35 additions & 42 deletions src/app/handle-page/handle-table/handle-table.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { BehaviorSubject, combineLatest as observableCombineLatest, fromEvent } from 'rxjs';
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { BehaviorSubject, combineLatest } from 'rxjs';
import { RemoteData } from '../../core/data/remote-data';
import { PaginatedList } from '../../core/data/paginated-list.model';
import { HandleDataService } from '../../core/data/handle-data.service';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { debounceTime, distinctUntilChanged, switchMap, take } from 'rxjs/operators';
import { scan, switchMap, take } from 'rxjs/operators';
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../core/shared/operators';
import { PaginationService } from '../../core/pagination/pagination.service';
import {
Expand Down Expand Up @@ -58,11 +58,6 @@ export class HandleTableComponent implements OnInit {
private notificationsService: NotificationsService,) {
}

/**
* The reference for the input html element
*/
@ViewChild('searchInput', {static: true}) searchInput: ElementRef;

/**
* The list of Handle object as BehaviorSubject object
*/
Expand Down Expand Up @@ -153,13 +148,20 @@ export class HandleTableComponent implements OnInit {
this.isLoading = true;

// load the current pagination and sorting options
const currentPagination$ = this.paginationService.getCurrentPagination(this.options.id, this.options);
const currentSort$ = this.paginationService.getCurrentSort(this.options.id, this.sortConfiguration);

observableCombineLatest([currentPagination$, currentSort$]).pipe(
switchMap(([currentPagination, currentSort]) => {
const currentPagination$ = this.getCurrentPagination();
const currentSort$ = this.getCurrentSort();
const searchTerm$ = new BehaviorSubject<string>(this.searchQuery);

combineLatest([currentPagination$, currentSort$, searchTerm$]).pipe(
scan((prevState, [currentPagination, currentSort, searchTerm]) => {
// If search term has changed, reset to page 1; otherwise, keep current page
const currentPage = prevState.searchTerm !== searchTerm ? 1 : currentPagination.currentPage;
return { currentPage, currentPagination, currentSort, searchTerm };
}, { searchTerm: '', currentPage: 1, currentPagination: this.getCurrentPagination(),
currentSort: this.getCurrentSort() }),
switchMap(({ currentPage, currentPagination, currentSort, searchTerm }) => {
return this.handleDataService.findAll({
currentPage: currentPagination.currentPage,
currentPage: currentPage,
elementsPerPage: currentPagination.pageSize,
sort: {field: currentSort.field, direction: currentSort.direction}
}, false
Expand Down Expand Up @@ -351,29 +353,6 @@ export class HandleTableComponent implements OnInit {
}, 250 );
}

/**
* If the user is typing the searchQuery is changing.
*/
setSearchQuery() {
if (isEmpty(this.searchOption)) {
return;
}

fromEvent(this.searchInput.nativeElement,'keyup')
.pipe(
debounceTime(300),
distinctUntilChanged()
)
.subscribe( cc => {
this.searchHandles(this.searchInput.nativeElement.value);
setTimeout(() => {
// click to refresh table data because without click it still shows wrong data
document.getElementById('clarin-dc-search-box').click();
}, 25);
});

}

/**
* The search option is selected from the dropdown menu.
* @param event with the selected value
Expand All @@ -386,32 +365,32 @@ export class HandleTableComponent implements OnInit {
* Update the sortConfiguration based on the `searchOption` and the `searchQuery` but parse that attributes at first.
* @param searchQuery
*/
searchHandles(searchQuery = '') {
searchHandles() {
if (isEmpty(this.searchOption)) {
return;
}

// parse searchQuery for the server request
// the new sorting query is in the format e.g. `handle:123456`, `resourceTypeId:2`, `url:internal`
let parsedSearchOption = '';
let parsedSearchQuery = searchQuery;
let parsedSearchQuery = this.searchQuery;
switch (this.searchOption) {
case this.handleOption:
parsedSearchOption = HANDLE_SEARCH_OPTION;
break;
case this.internalOption:
// if the handle doesn't have the URL - is internal, if it does - is external
parsedSearchOption = URL_SEARCH_OPTION;
if (searchQuery === 'Yes' || searchQuery === 'yes') {
if (this.searchQuery.toLowerCase() === 'yes') {
parsedSearchQuery = 'internal';
} else if (searchQuery === 'No' || searchQuery === 'no') {
} else if (this.searchQuery.toLowerCase() === 'no') {
parsedSearchQuery = 'external';
}
break;
case this.resourceTypeOption:
parsedSearchOption = RESOURCE_TYPE_SEARCH_OPTION;
// parse resourceType from string to the number because the resourceType is integer on the server
switch (searchQuery) {
switch (this.searchQuery) {
case ITEM:
parsedSearchQuery = '' + 2;
break;
Expand Down Expand Up @@ -441,4 +420,18 @@ export class HandleTableComponent implements OnInit {
private initializeSortingOptions() {
this.sortConfiguration = defaultSortConfiguration;
}

/**
* Get the current pagination options.
*/
private getCurrentPagination() {
return this.paginationService.getCurrentPagination(this.options.id, defaultPagination);
}

/**
* Get the current sorting options.
*/
private getCurrentSort() {
return this.paginationService.getCurrentSort(this.options.id, defaultSortConfiguration);
}
}
9 changes: 8 additions & 1 deletion src/app/header/header.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ import { MenuService } from '../shared/menu/menu.service';
import { MenuServiceStub } from '../shared/testing/menu-service.stub';
import { HostWindowService } from '../shared/host-window.service';
import { HostWindowServiceStub } from '../shared/testing/host-window-service.stub';
import { LocaleService } from '../core/locale/locale.service';

let comp: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;

describe('HeaderComponent', () => {
const menuService = new MenuServiceStub();

// Mock LocaleService
const localeServiceMock = {
getCurrentLanguageCode: () => 'en' // returns default language code
};

// waitForAsync beforeEach
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
Expand All @@ -29,7 +35,8 @@ describe('HeaderComponent', () => {
declarations: [HeaderComponent],
providers: [
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
{ provide: MenuService, useValue: menuService }
{ provide: MenuService, useValue: menuService },
{ provide: LocaleService, useValue: localeServiceMock }
],
schemas: [NO_ERRORS_SCHEMA]
})
Expand Down
39 changes: 39 additions & 0 deletions src/app/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
import { MenuService } from '../shared/menu/menu.service';
import { MenuID } from '../shared/menu/menu-id.model';
import { HostWindowService } from '../shared/host-window.service';
import { LocaleService } from '../core/locale/locale.service';

/**
* Represents the header with the logo and simple navigation
Expand All @@ -24,6 +25,7 @@ export class HeaderComponent implements OnInit {
constructor(
protected menuService: MenuService,
protected windowService: HostWindowService,
private localeService: LocaleService,
) {
}

Expand All @@ -34,4 +36,41 @@ export class HeaderComponent implements OnInit {
public toggleNavbar(): void {
this.menuService.toggleMenu(this.menuID);
}

/**
* Returns the current language code from the locale service
* @returns {string} The current language code
*/
getLangCode(): string {
return this.localeService.getCurrentLanguageCode();
}

/**
* Returns the current language code only if it's Czech ('cs'), otherwise returns an empty string
* @returns {string} The language code if Czech, empty string otherwise
*/
getLangCodeIfCzech(): string {
return this.localeService.getCurrentLanguageCode() === 'cs' ? this.localeService.getCurrentLanguageCode() : '';
}

/**
* Translates English slugs to their Czech equivalents when the current language is Czech
* @param {string} slug - The English slug to translate
* @returns {string} The translated slug if in Czech, the original slug if in English, or empty string if translation not found
*/
translateSlug(slug: string): string {
const currentLang = this.localeService.getCurrentLanguageCode();
if (currentLang === 'en') {
return slug;
}

const translations = {
'partners': 'partneri',
'integration': 'integrace',
'partnership': 'partnerstvi',
'services': 'sluzby'
};

return translations[slug] || '';
}
}
2 changes: 1 addition & 1 deletion src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <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 routerLink="home" class="col-md-7" style="height: 160px; position: relative;">
<a href="/lindat" 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/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class ClarinFilesSectionComponent implements OnInit {
return file.name;
});

this.command = `curl --remote-name-all ` + this.halService.getRootHref() + `/core/items/${this.item.id}/allzip?handleId=${this.itemHandle}`;
this.command = `curl -o allzip.zip ` + this.halService.getRootHref() + `/core/items/${this.item.id}/allzip?handleId=${this.itemHandle}`;
}

loadDownloadZipConfigProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class ClarinLicenseInfoComponent implements OnInit {
}

/**
* Check if current english is Czech
* Check if current language is Czech
*/
isCsLocale() {
return this.localeService.getCurrentLanguageCode() === 'cs';
Expand Down
Loading