Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UFAL/Resolve conflicts before merge #764

Merged
merged 49 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c0c12ac
Removed dynamic overflow because every content must be scrollable.. (…
milanmajchrak Sep 20, 2024
082d14b
add tar for preview (#713)
Paurikova2 Sep 20, 2024
575e3b9
UFAL/Enhanced type-bind feature (#714)
milanmajchrak Sep 20, 2024
1178fae
Updated error message when tests failed
milanmajchrak Sep 25, 2024
083f2b5
Update README.md
vidiecan Oct 11, 2024
b2a5d6e
UFAL/Show sesznam license on approval page (#722)
milanmajchrak Oct 17, 2024
d164ec7
UFAL/share submission by email (#720)
milanmajchrak Oct 17, 2024
791dfd9
UFAL/Autocomplete enhancement (#718)
milanmajchrak Oct 17, 2024
ae42453
UFAL/License page - wrong layout in Firefox (#721)
milanmajchrak Oct 30, 2024
bd55322
Migrated Vanilla cs messages into clarin 7.6.1. cs messages (#669)
milanmajchrak Nov 4, 2024
2214559
UFAL/Share submission with user not only admin (#728)
milanmajchrak Nov 12, 2024
057632d
Updated messages following last commit to upstream. (#731)
milanmajchrak Nov 14, 2024
aa6e71b
Updated dspace prefix to lindat (#734)
milanmajchrak Nov 15, 2024
d506074
Added notification when the shibboleth authentication is failed (#732)
milanmajchrak Nov 19, 2024
5e21da0
Removed two IT: (#737)
milanmajchrak Nov 20, 2024
753594d
Update all static licenses (#726)
Paurikova2 Nov 20, 2024
f9f6e62
Use NAMESPACES from the .env (#727)
milanmajchrak Nov 20, 2024
a6310f0
Update deploy.yml to increase timeout (#738)
milanmajchrak Nov 21, 2024
a2a3e53
Use only 4000, not the {UI_PORT} from the .env because in the contain…
milanmajchrak Nov 21, 2024
09e1167
Update docker-compose-rest.yml
milanmajchrak Nov 21, 2024
c5bc34b
Update docker-compose-rest.yml
milanmajchrak Nov 21, 2024
8d68def
Use only / and /server namespaces, not the values from the .env becau…
milanmajchrak Nov 21, 2024
4e108e6
Expose tomcat `/server` on `/repository/server`
milanmajchrak Nov 21, 2024
5843e54
Take a customized docker-compose-rest.yml which exposes the server on…
milanmajchrak Nov 21, 2024
e7e8185
Updated a path to take right docker-compose files
milanmajchrak Nov 21, 2024
3d052e6
Undo using only default namespaced `/` and `/server`
milanmajchrak Nov 21, 2024
56f0730
Use custom `docker-compose.yml` from the testing server
milanmajchrak Nov 22, 2024
01b4a93
UFAL/Shibboleth fixed wrong redirect after login with verification to…
milanmajchrak Nov 22, 2024
ea056b2
Use path `./assets` instead of `/assets` (#742)
milanmajchrak Nov 22, 2024
6e281ba
new download instruction for cmd using zip from backend (#739)
Paurikova2 Nov 26, 2024
c335482
Get UI base URL from BE (#744)
milanmajchrak Nov 26, 2024
b782d78
Check that the custom type bind field in configured in the `submissio…
milanmajchrak Nov 28, 2024
42040a6
Searching by type is changed to 'type' instead of 'itemtype' because …
milanmajchrak Nov 29, 2024
6ffc7e5
Use `autoLogin` method (#747)
milanmajchrak Nov 29, 2024
e7e1577
UFAL/Matomo statistics using angulartics2 (#748)
milanmajchrak Nov 29, 2024
0d69bcc
Update db-import action
milanmajchrak Nov 30, 2024
8126cb7
Update import-db action - use main branch
milanmajchrak Nov 30, 2024
374c062
Added a translation for the searching filter `subjectFirstValue` (red…
milanmajchrak Dec 2, 2024
60e2983
Ensure the redirect URL starts with a slash (#753)
milanmajchrak Dec 2, 2024
fc70fcb
Added volume into docker-compose (#754)
milanmajchrak Dec 3, 2024
4c2e997
UFAL/Load the matomo configuration from the environment (#755)
milanmajchrak Dec 3, 2024
e4dcb89
Fetch the matomo properties from the config, not from the environment…
milanmajchrak Dec 3, 2024
1cc31c6
Load the szn license in oninit method (#757)
milanmajchrak Dec 4, 2024
06a46aa
UFAL/Temporary fix for the type-bind. The form automatically refreshe…
milanmajchrak Dec 5, 2024
50f68bb
Execute autoregistration component only in client side (#762)
milanmajchrak Dec 5, 2024
d3aa70d
The Autocomplete Component is dynamically loaded as a standalone comp…
milanmajchrak Dec 5, 2024
ab2d477
UFAL/footer header images (#760)
jr-rk Dec 6, 2024
9e9d86f
ufal/customize the footer (#759)
jr-rk Dec 6, 2024
69903b4
Merge branch 'customer/lindat' into lindat-resolve-conflicts
milanmajchrak Dec 6, 2024
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
20 changes: 12 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
working-directory: build-scripts/run/
run: |
./start.sh dspace-$INSTANCE
cd ../..
# use customized docker-compose file for the `85` port because the server is exposed with the namespace `repository`
# `/repository/server`
docker compose --env-file $ENVFILE -p dspace-$INSTANCE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f /opt/dspace-envs/5/docker-compose-rest.yml -f /opt/dspace-envs/5/docker-compose.yml up -d --no-build

deploy-8:
if: inputs.INSTANCE == '*' || inputs.INSTANCE == '8'
Expand Down Expand Up @@ -147,7 +151,7 @@ jobs:
playwright-after-deploy8:
runs-on: ubuntu-latest
needs: deploy-8
timeout-minutes: 15
timeout-minutes: 45
if: '!inputs.IMPORT'
steps:
- name: run playwright
Expand Down Expand Up @@ -177,14 +181,14 @@ jobs:
echo $RES
# if last result is not success, return -1 and fail
if [[ $RES != \"success\" ]]; then
echo "playwright tests have failed! check appropriate action run"
echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository"
exit 1
fi;

rest-tests-after-deploy8:
runs-on: ubuntu-latest
needs: playwright-after-deploy8
timeout-minutes: 15
timeout-minutes: 45
steps:
- name: run rest-tests
run: |
Expand All @@ -210,7 +214,7 @@ jobs:
echo $RES
# if last result is not success, return -1 and fail
if [[ $RES != \"success\" ]]; then
echo "rest-tests have failed! check appropriate action run"
echo "rest-tests have failed! check appropriate action run in the dspace-rest-test repository"
exit 1
fi;

Expand All @@ -219,7 +223,7 @@ jobs:
runs-on: ubuntu-latest
needs: import-8
if: inputs.IMPORT
timeout-minutes: 15
timeout-minutes: 45
steps:
- name: run playwright
run: |
Expand Down Expand Up @@ -249,14 +253,14 @@ jobs:
# if last result is not success, return -1 and fail
if [[ $RES != \"success\" ]]; then

echo "playwright tests have failed! check appropriate action run"
echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository"
exit 1
fi;

rest-tests-after-import8:
runs-on: ubuntu-latest
needs: playwright-after-import8
timeout-minutes: 15
timeout-minutes: 45
steps:
- name: run rest-tests
run: |
Expand All @@ -282,6 +286,6 @@ jobs:
echo $RES
# if last result is not success, return -1 and fail
if [[ $RES != \"success\" ]]; then
echo "rest-tests have failed! check appropriate action run"
echo "rest-tests have failed! check appropriate action run in the dspace-rest-test repository"
exit 1
fi;
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,8 @@ The full license is available in the [LICENSE](LICENSE) file or online at http:/

DSpace uses third-party libraries which may be distributed under different licenses. Those licenses are listed
in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file.

Additional tools
----------------

This project is tested with BrowserStack.
4 changes: 4 additions & 0 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,7 @@ vocabularies:
comcolSelectionSort:
sortField: 'dc.title'
sortDirection: 'ASC'

matomo:
hostUrl: http://localhost:8135/
siteId: 1
4 changes: 4 additions & 0 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ services:
entrypoint:
- /bin/bash
- '-c'
# When customizing the namespace, add the following command to the entrypoint command below (after `while ...`):
# `pushd ../webapps && unlink server && ln -s /dspace/webapps/server/ 'repository#server' && popd`
# This will create a symlink from the webapps directory to the server directory with the custom namespace
# (e.g. /dspace/webapps/server -> /dspace/webapps/repository#server)
- |
while (!</dev/tcp/dspacedb/543${INSTANCE}) > /dev/null 2>&1; do sleep 1; done;
pushd ../webapps && unlink server && ln -s /dspace/webapps/server/ 'repository#server' && popd
Expand Down
3 changes: 2 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ services:
TZ: ${TIMEZONE:-Europe/Bratislava}
DSPACE_UI_SSL: 'false'
DSPACE_UI_HOST: dspace-angular
DSPACE_UI_PORT: ${UI_PORT:-4000}
# Use only `4000`, not the {UI_PORT} from the .env because in the container it is always `4000`
DSPACE_UI_PORT: 4000
DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/}
DSPACE_REST_SSL: ${DSPACE_SSL:-false}
DSPACE_REST_HOST: ${DSPACE_HOST:-localhost}
Expand Down
7 changes: 7 additions & 0 deletions docker/matomo-settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Matomo settings for tracking statistics. This file could be mounted in the docker container.
*/
export const matomoSettings = {
hostUrl: 'http://localhost:8135/',
siteId: '1'
};
19 changes: 18 additions & 1 deletion src/aai/aai.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@

if (redirectUrlFromLogin != null && redirectUrlFromLogin !== '') {
// Redirect from the login page with retrieved redirect URL
redirectUrl = window.location.origin + (namespace === '' ? namespace : '/' + namespace) + redirectUrlFromLogin;
var baseUrl = window.location.origin + formatNamespace(namespace);
var redirectPath = ensureLeadingSlash(redirectUrlFromLogin);

redirectUrl = baseUrl + redirectPath;
}

// Encode the redirect URL
Expand Down Expand Up @@ -129,6 +132,20 @@
var cookieString = name + '=' + value + ';expires=' + expirationDate.toUTCString() + ';path=/';
document.cookie = cookieString;
}

/**
* Return empty string if namespace is empty, otherwise return namespace with leading slash.
*/
function formatNamespace(namespace) {
return namespace === '' ? '' : ensureLeadingSlash(namespace);
}

/**
* Ensure that the path starts with a leading slash.
*/
function ensureLeadingSlash(path) {
return path.startsWith('/') ? path : '/' + path;
}
}

if (!window.aai) {
Expand Down
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ import { STATIC_PAGE_PATH } from './static-page/static-page-routing-paths';
path: STATIC_PAGE_PATH,
loadChildren: () => import('./static-page/static-page.module').then((m) => m.StaticPageModule),
},
{
path: 'share-submission',
loadChildren: () => import('./share-submission/share-submission.module').then((m) => m.ShareSubmissionModule),
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
},
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent }
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ <h2 id="header" class="border-bottom pb-2">{{'clarin.license.agreement.title' |
<div class="card bg-clarin-yellow border-clarin-yellow">
<div class="card-body text-center">
<a [href]="clarinLicense?.definition">{{clarinLicense?.name}}</a>
<div *ngIf="clarinLicense?.name === LICENSE_NAME_SEZNAM"
class="pt-3"
[innerHTML]="(licenseContentSeznam | async) | dsSafeHtml">
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { FindListOptions } from '../../core/data/find-list-options.model';
import isEqual from 'lodash/isEqual';
import cloneDeep from 'lodash/cloneDeep';
import { ClarinUserMetadataDataService } from '../../core/data/clarin/clarin-user-metadata.service';
import { HtmlContentService } from '../../shared/html-content.service';

/**
* The component shows the user's filled in user metadata and the user can fill in other required user metadata.
Expand Down Expand Up @@ -106,6 +107,21 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
*/
helpDesk$: Observable<RemoteData<ConfigurationProperty>>;

/**
* The Seznam dataset license content. It is shown directly in this approval page.
*/
LICENSE_NAME_SEZNAM = 'Seznam Dataset Licence';

/**
* The path to the Seznam dataset license content.
*/
LICENSE_PATH_SEZNAM_CZ = 'szn-dataset-license.html';

/**
* The content of the Seznam dataset license. Fetch from the static file.
*/
licenseContentSeznam: BehaviorSubject<string> = new BehaviorSubject<string>('');

constructor(
protected clarinLicenseResourceMappingService: ClarinLicenseResourceMappingService,
protected configurationDataService: ConfigurationDataService,
Expand All @@ -121,7 +137,8 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
protected rdbService: RemoteDataBuildService,
private hardRedirectService: HardRedirectService,
private requestService: RequestService,
private clarinUserMetadataDataService: ClarinUserMetadataDataService) { }
private clarinUserMetadataDataService: ClarinUserMetadataDataService,
private htmlContentService: HtmlContentService) { }

ngOnInit(): void {
// Load CurrentItem by bitstreamID to show itemHandle
Expand All @@ -143,6 +160,19 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
// The user is signed in and has record in the userRegistration
// Load userRegistration and userMetadata from userRegistration repository
this.loadUserRegistrationAndUserMetadata();

// Load the Seznam dataset license content
this.loadLicenseContentSeznam();
}

/**
* Load the content for the special license. This content is shown directly in this approval page.
*/
loadLicenseContentSeznam() {
this.htmlContentService.getHmtlContentByPathAndLocale(this.LICENSE_PATH_SEZNAM_CZ).then(content => {
this.licenseContentSeznam.next(content);
});
return true;
}

public accept() {
Expand Down
33 changes: 33 additions & 0 deletions src/app/change-submitter-page/change-submitter-page.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div class="container pt-2 pb-4" *ngVar="submitter | async as sub">
<div *ngVar="item | async as item" >
<h3>{{'share.submission.page.title' | translate}}</h3>
<div *ngIf="sub">
<span>{{'change.submitter.page.message' | translate}}</span>
<span class="font-weight-bold">{{getName(sub)}}</span>
<span class="font-weight-bold"> ({{sub?.email}})</span>
</div>
<div *ngIf="sub == null">
<span>{{'change.submitter.page.cannot.see.submitter.message' | translate}}</span>
</div>

<div>
<span>{{'change.submitter.page.items.handle.message' | translate}}</span>
<span class="font-weight-bold">{{item?.handle}}</span>
</div>
<div>
<span>{{'change.submitter.page.items.name.message' | translate}}</span>
<span class="font-weight-bold">{{getName(item)}}</span>
</div>

<div class="pt-4">
<button class="btn btn-info" (click)="changeSubmitter()">
<span *ngIf="changeSubmitterSpinner"
class="spinner-border spinner-border-sm spinner-button mr-1" role="status" aria-hidden="true">
</span>
<span>{{'change.submitter.page.button.take-it' | translate}}</span>
</button>
</div>
</div>
</div>


Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
The file for styling the ChangeSubmitterPageComponent.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangeSubmitterPageComponent } from './change-submitter-page.component';
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
import { ActivatedRoute, Router } from '@angular/router';
import { HALEndpointService } from '../core/shared/hal-endpoint.service';
import { RemoteDataBuildService } from '../core/cache/builders/remote-data-build.service';
import { RequestService } from '../core/data/request.service';
import { NotificationsService } from '../shared/notifications/notifications.service';
import { TranslateModule } from '@ngx-translate/core';
import { NotificationsServiceStub } from '../shared/testing/notifications-service.stub';
import { RouterStub } from '../shared/testing/router.stub';
import { of as observableOf } from 'rxjs';
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
import { getMockRequestService } from '../shared/mocks/request.service.mock';
import { createPaginatedList } from '../shared/testing/utils.test';
import { HALEndpointServiceStub } from '../shared/testing/hal-endpoint-service.stub';
import { getMockRemoteDataBuildService } from '../shared/mocks/remote-data-build.service.mock';
import { DSONameService } from '../core/breadcrumbs/dso-name.service';
import { DSONameServiceMock } from '../shared/mocks/dso-name.service.mock';

describe('ChangeSubmitterPageComponent', () => {
let component: ChangeSubmitterPageComponent;
let fixture: ComponentFixture<ChangeSubmitterPageComponent>;

let activatedRoute;
let requestService: RequestService;
let mockDataService: WorkspaceitemDataService;
let halService: HALEndpointService;
let rdbService: RemoteDataBuildService;

beforeEach(async () => {
activatedRoute = {
snapshot: {
queryParams: new Map([
['shareToken', 'fake-share-token'],
])
}
};
requestService = getMockRequestService();
mockDataService = jasmine.createSpyObj('WorkspaceitemDataService', {
searchBy: observableOf(createSuccessfulRemoteDataObject$(createPaginatedList([]))),
});
halService = Object.assign(new HALEndpointServiceStub('some-url'));
rdbService = getMockRemoteDataBuildService();

await TestBed.configureTestingModule({
declarations: [ ChangeSubmitterPageComponent ],
imports: [
TranslateModule.forRoot()
],
providers: [
{ provide: ActivatedRoute, useValue: activatedRoute },
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
{ provide: Router, useValue: new RouterStub() },
{ provide: RequestService, useValue: requestService },
{ provide: WorkspaceitemDataService, useValue: mockDataService },
{ provide: HALEndpointService, useValue: halService },
{ provide: RemoteDataBuildService, useValue: rdbService },
{ provide: DSONameService, useValue: DSONameServiceMock },
]
})
.compileComponents();

fixture = TestBed.createComponent(ChangeSubmitterPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading
Loading