Skip to content

Commit

Permalink
UFAL/Resolve conflicts before merge (#764)
Browse files Browse the repository at this point in the history
* Removed dynamic overflow because every content must be scrollable.. (#716)

* add tar for preview (#713)

* add tar for preview

* UFAL/Enhanced type-bind feature (#714)

* The type-bind is loaded from the cfg and correctly rendered

* Done some refactoring

* Update tests following the type-bind enhancement

* Fixed linting error.

* Removed unwanted changes and fixed wrong refactored code.

* Updated error message when tests failed

* Update README.md

* UFAL/Show sesznam license on approval page (#722)

* Added static files from the SEZNAM license.

* Refactored fetching html content from the static files. The logic was moved into the common service.

* Show Seznam static license on approval page.

* Updated constant name LICENSE_NAME_SEZNAM - added the _CZ to make it more clear that is Czech license

* UFAL/share submission by email (#720)

* Added share submission button into workspaceitem actions page.

* Added notification about the success of the sharing the submission.

* Created share submission module, page with routing. That page could access only the administrator.

* WIP - created a new page `change-submitter-page`.

* Created page when the user could take the workspace item as its own.

* Pretified the code and added some docs

* Updated tests following the new feature

* Fixed unwanted changes, updated docs

* UFAL/Autocomplete enhancement (#718)

* Added support for searching results from specific solr indexes.

Updated autocomplete component to search values from custom solr index. The autocomplete component could have attribute for resolving the custom index from the submission-forms definition.

* Show suggestions for `solr-handle_title_ac` and `solr-subject_ac`

* Fixed tests

* Formatted language suggestions, added docs and fixed tests.

* Refactored the code following the review requirements.

* Fixed type in the word pretify

* UFAL/License page - wrong layout in Firefox (#721)

* Removed flex class and used width style instead of col

* Removed unsued class

* Changed style in the html into classes

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages (#669)

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages

* updated translation

* Updated cs localization for subcommunities and subcollections

* Changed `prispeveku` to `prispevku`

* Updated messages for the 'supervised' and 'claim' sentenses

---------

Co-authored-by: Ondrej Kosarko <[email protected]>

* UFAL/Share submission with user not only admin (#728)

* The submitter information cannot be displayed in some cases, but show a few information about the Item

* Added missing trailing comma

* Fixed docs

* Updated messages following last commit to upstream. (#731)

* Updated dspace prefix to lindat (#734)

* Added notification when the shibboleth authentication is failed (#732)

* Removed two IT: (#737)

1. Author does not have a two input fields.
2. Test for checking the notice step will be transformed into UI test, because we do not want to keep such specific collection for generic IT.

* Update all static licenses (#726)

* added licenses from ufal commit dcbe87e02931dee78b13c4b3995a6cef3aeacd32

* added missing static licenses

* remove static from licenses path

* no_static_ as const

* checkstyle

* Use NAMESPACES from the .env (#727)

* Use NAMESPACES from the .env

* Created symbolic link for the tomcat folder

* Updated docker compose files - can load more properties from the `.env`

* Update deploy.yml to increase timeout (#738)

Because some tests were canceled during processing.

* Use only 4000, not the {UI_PORT} from the .env because in the container it is always 4000 (#740)

* Update docker-compose-rest.yml

Uncommented /repository/ namespace in the docker-compose.yml.
It is only for one deploy.

* Update docker-compose-rest.yml

Undo exposing server on the /repository/ path

* Use only / and /server namespaces, not the values from the .env because in the container it is always `/` and `/server` (#741)

* Expose tomcat `/server` on `/repository/server`

* Take a customized docker-compose-rest.yml which exposes the server on /repository/server

* Updated a path to take right docker-compose files

* Undo using only default namespaced `/` and `/server`

* Use custom `docker-compose.yml` from the testing server

* UFAL/Shibboleth fixed wrong redirect after login with verification token (#733)

* Used hardredirect instead of the standard router.redirect because the user could be stucked on the loading page

* Added doc why

* Added missing whitespace

* Use path `./assets` instead of `/assets` (#742)

* new download instruction for cmd using zip from backend (#739)

* Get UI base URL from BE (#744)

* Check that the custom type bind field in configured in the `submission-forms` when it is configured in the cfg property (#745)

* Searching by type is changed to 'type' instead of 'itemtype' because it was changed in the autocomplete enhnancement (#749)

* Use `autoLogin` method (#747)

* UFAL/Matomo statistics using angulartics2 (#748)

* Modified matomo tracking in footer component

* Do not use routerless Matomo because we want to track view on every page redirect

* The Matomo statistics are tracked properly.

* Prettyfied the code

* Fix linting error

* Fixed unit tests following the matomo statistics update

* Fixed linting error

* Added a document title in the footer

* Added category to the eventTrack because it is required for the Matomo.

* Refactored using matomo statistics - added into browser init service, because the Matomo statistics wasn't rendered on production

* Changed matomo-settings location

---------

Co-authored-by: Matus Kasak <[email protected]>

* Update db-import action

Try a commit when the import worked.

* Update import-db action - use main branch

* Added a translation for the searching filter `subjectFirstValue` (redirect from home page). (#752)

* Ensure the redirect URL starts with a slash (#753)

* Added volume into docker-compose (#754)

* UFAL/Load the matomo configuration from the environment (#755)

* Added volume into docker-compose

* Take a matomo configuration from the environment

* Fetch the matomo properties from the config, not from the environment (#756)

* Load the szn license in oninit method (#757)

* UFAL/Temporary fix for the type-bind. The form automatically refreshes after the type is changed. (#761)

* The Save action is automatically dispatched when the type is changed

* Updated the handleFormSave method name to `dispatchFormSaveAndReinitialize`

* Added missing function to mock object

* Execute autoregistration component only in client side (#762)

* The Autocomplete Component is dynamically loaded as a standalone component only in the browser using the Loader component. (#763)

* UFAL/footer header images (#760)

* Footer images upload to assets/images/footer/ and change of images src attributes

* Changed src paths to start with ./

---------

Co-authored-by: Juraj Roka <[email protected]>

* ufal/customize the footer (#759)

* Footer details update by Lindat live instance's footer

* Copied UI tests fix from the dtq-dev

---------

Co-authored-by: Juraj Roka <[email protected]>
Co-authored-by: milanmajchrak <[email protected]>

---------

Co-authored-by: Paurikova2 <[email protected]>
Co-authored-by: Jozef Misutka <[email protected]>
Co-authored-by: Ondrej Kosarko <[email protected]>
Co-authored-by: Matus Kasak <[email protected]>
Co-authored-by: jurinecko <[email protected]>
Co-authored-by: Juraj Roka <[email protected]>
  • Loading branch information
7 people authored Dec 6, 2024
1 parent 5fd9aab commit 0fef938
Show file tree
Hide file tree
Showing 104 changed files with 12,151 additions and 1,907 deletions.
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

0 comments on commit 0fef938

Please sign in to comment.