mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 16:03:02 +00:00
Merge branch 'main' of github.com:harvard-lts/dspace-angular into 145-base-path-support
This commit is contained in:
16
package.json
16
package.json
@@ -70,8 +70,8 @@
|
|||||||
"@material-ui/core": "^4.11.0",
|
"@material-ui/core": "^4.11.0",
|
||||||
"@material-ui/icons": "^4.9.1",
|
"@material-ui/icons": "^4.9.1",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
|
||||||
"@ng-dynamic-forms/core": "^14.0.1",
|
"@ng-dynamic-forms/core": "^15.0.0",
|
||||||
"@ng-dynamic-forms/ui-ng-bootstrap": "^14.0.1",
|
"@ng-dynamic-forms/ui-ng-bootstrap": "^15.0.0",
|
||||||
"@ngrx/effects": "^13.0.2",
|
"@ngrx/effects": "^13.0.2",
|
||||||
"@ngrx/router-store": "^13.0.2",
|
"@ngrx/router-store": "^13.0.2",
|
||||||
"@ngrx/store": "^13.0.2",
|
"@ngrx/store": "^13.0.2",
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
"@ngx-translate/core": "^13.0.0",
|
"@ngx-translate/core": "^13.0.0",
|
||||||
"@nicky-lenaers/ngx-scroll-to": "^9.0.0",
|
"@nicky-lenaers/ngx-scroll-to": "^9.0.0",
|
||||||
"angular-idle-preload": "3.0.0",
|
"angular-idle-preload": "3.0.0",
|
||||||
"angulartics2": "^10.0.0",
|
"angulartics2": "^12.0.0",
|
||||||
"bootstrap": "4.3.1",
|
"bootstrap": "4.3.1",
|
||||||
"caniuse-lite": "^1.0.30001165",
|
"caniuse-lite": "^1.0.30001165",
|
||||||
"cerialize": "0.1.18",
|
"cerialize": "0.1.18",
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react-copy-to-clipboard": "^5.0.1",
|
"react-copy-to-clipboard": "^5.0.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rxjs": "^6.6.3",
|
"rxjs": "^7.5.5",
|
||||||
"sortablejs": "1.13.0",
|
"sortablejs": "1.13.0",
|
||||||
"tslib": "^2.0.0",
|
"tslib": "^2.0.0",
|
||||||
"url-parse": "^1.5.6",
|
"url-parse": "^1.5.6",
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
"css-minimizer-webpack-plugin": "^3.4.1",
|
"css-minimizer-webpack-plugin": "^3.4.1",
|
||||||
"cssnano": "^5.0.6",
|
"cssnano": "^5.0.6",
|
||||||
"cypress": "9.5.1",
|
"cypress": "9.5.1",
|
||||||
"cypress-axe": "^0.13.0",
|
"cypress-axe": "^0.14.0",
|
||||||
"debug-loader": "^0.0.1",
|
"debug-loader": "^0.0.1",
|
||||||
"deep-freeze": "0.0.1",
|
"deep-freeze": "0.0.1",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
"fork-ts-checker-webpack-plugin": "^6.0.3",
|
"fork-ts-checker-webpack-plugin": "^6.0.3",
|
||||||
"html-loader": "^1.3.2",
|
"html-loader": "^1.3.2",
|
||||||
"jasmine-core": "^3.8.0",
|
"jasmine-core": "^3.8.0",
|
||||||
"jasmine-marbles": "0.6.0",
|
"jasmine-marbles": "0.9.2",
|
||||||
"jasmine-spec-reporter": "~5.0.0",
|
"jasmine-spec-reporter": "~5.0.0",
|
||||||
"karma": "^6.3.14",
|
"karma": "^6.3.14",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
"karma-jasmine": "~4.0.0",
|
"karma-jasmine": "~4.0.0",
|
||||||
"karma-jasmine-html-reporter": "^1.5.0",
|
"karma-jasmine-html-reporter": "^1.5.0",
|
||||||
"karma-mocha-reporter": "2.2.5",
|
"karma-mocha-reporter": "2.2.5",
|
||||||
"ngx-mask": "^12.0.0",
|
"ngx-mask": "^13.1.7",
|
||||||
"nodemon": "^2.0.15",
|
"nodemon": "^2.0.15",
|
||||||
"postcss": "^8.1",
|
"postcss": "^8.1",
|
||||||
"postcss-apply": "0.12.0",
|
"postcss-apply": "0.12.0",
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
"react": "^16.14.0",
|
"react": "^16.14.0",
|
||||||
"react-dom": "^16.14.0",
|
"react-dom": "^16.14.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs-spy": "^7.5.3",
|
"rxjs-spy": "^8.0.2",
|
||||||
"sass": "~1.32.6",
|
"sass": "~1.32.6",
|
||||||
"sass-loader": "^12.6.0",
|
"sass-loader": "^12.6.0",
|
||||||
"sass-resources-loader": "^2.1.1",
|
"sass-resources-loader": "^2.1.1",
|
||||||
|
@@ -1,6 +1,17 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<h2 id="header">{{'admin.metadata-import.page.header' | translate}}</h2>
|
<h2 id="header">{{'admin.metadata-import.page.header' | translate}}</h2>
|
||||||
<p>{{'admin.metadata-import.page.help' | translate}}</p>
|
<p>{{'admin.metadata-import.page.help' | translate}}</p>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="validateOnly" [(ngModel)]="validateOnly">
|
||||||
|
<label class="form-check-label" for="validateOnly">
|
||||||
|
{{'admin.metadata-import.page.validateOnly' | translate}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<small id="validateOnlyHelpBlock" class="form-text text-muted">
|
||||||
|
{{'admin.metadata-import.page.validateOnly.hint' | translate}}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ds-file-dropzone-no-uploader
|
<ds-file-dropzone-no-uploader
|
||||||
(onFileAdded)="setFile($event)"
|
(onFileAdded)="setFile($event)"
|
||||||
@@ -8,8 +19,10 @@
|
|||||||
[dropMessageLabelReplacement]="'admin.metadata-import.page.dropMsgReplace'">
|
[dropMessageLabelReplacement]="'admin.metadata-import.page.dropMsgReplace'">
|
||||||
</ds-file-dropzone-no-uploader>
|
</ds-file-dropzone-no-uploader>
|
||||||
|
|
||||||
<button class="btn btn-secondary" id="backButton"
|
<div class="space-children-mr">
|
||||||
(click)="this.onReturn();">{{'admin.metadata-import.page.button.return' | translate}}</button>
|
<button class="btn btn-secondary" id="backButton"
|
||||||
<button class="btn btn-primary" id="proceedButton"
|
(click)="this.onReturn();">{{'admin.metadata-import.page.button.return' | translate}}</button>
|
||||||
(click)="this.importMetadata();">{{'admin.metadata-import.page.button.proceed' | translate}}</button>
|
<button class="btn btn-primary" id="proceedButton"
|
||||||
|
(click)="this.importMetadata();">{{'admin.metadata-import.page.button.proceed' | translate}}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -87,8 +87,9 @@ describe('MetadataImportPageComponent', () => {
|
|||||||
comp.setFile(fileMock);
|
comp.setFile(fileMock);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('if proceed button is pressed', () => {
|
describe('if proceed button is pressed without validate only', () => {
|
||||||
beforeEach(fakeAsync(() => {
|
beforeEach(fakeAsync(() => {
|
||||||
|
comp.validateOnly = false;
|
||||||
const proceed = fixture.debugElement.query(By.css('#proceedButton')).nativeElement;
|
const proceed = fixture.debugElement.query(By.css('#proceedButton')).nativeElement;
|
||||||
proceed.click();
|
proceed.click();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@@ -107,6 +108,28 @@ describe('MetadataImportPageComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('if proceed button is pressed with validate only', () => {
|
||||||
|
beforeEach(fakeAsync(() => {
|
||||||
|
comp.validateOnly = true;
|
||||||
|
const proceed = fixture.debugElement.query(By.css('#proceedButton')).nativeElement;
|
||||||
|
proceed.click();
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
it('metadata-import script is invoked with -f fileName and the mockFile and -v validate-only', () => {
|
||||||
|
const parameterValues: ProcessParameter[] = [
|
||||||
|
Object.assign(new ProcessParameter(), { name: '-f', value: 'filename.txt' }),
|
||||||
|
Object.assign(new ProcessParameter(), { name: '-v', value: true }),
|
||||||
|
];
|
||||||
|
expect(scriptService.invoke).toHaveBeenCalledWith(METADATA_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]);
|
||||||
|
});
|
||||||
|
it('success notification is shown', () => {
|
||||||
|
expect(notificationService.success).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
it('redirected to process page', () => {
|
||||||
|
expect(router.navigateByUrl).toHaveBeenCalledWith('/processes/45');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('if proceed is pressed; but script invoke fails', () => {
|
describe('if proceed is pressed; but script invoke fails', () => {
|
||||||
beforeEach(fakeAsync(() => {
|
beforeEach(fakeAsync(() => {
|
||||||
jasmine.getEnv().allowRespy(true);
|
jasmine.getEnv().allowRespy(true);
|
||||||
|
@@ -30,6 +30,11 @@ export class MetadataImportPageComponent {
|
|||||||
*/
|
*/
|
||||||
fileObject: File;
|
fileObject: File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The validate only flag
|
||||||
|
*/
|
||||||
|
validateOnly = true;
|
||||||
|
|
||||||
public constructor(private location: Location,
|
public constructor(private location: Location,
|
||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
@@ -62,6 +67,9 @@ export class MetadataImportPageComponent {
|
|||||||
const parameterValues: ProcessParameter[] = [
|
const parameterValues: ProcessParameter[] = [
|
||||||
Object.assign(new ProcessParameter(), { name: '-f', value: this.fileObject.name }),
|
Object.assign(new ProcessParameter(), { name: '-f', value: this.fileObject.name }),
|
||||||
];
|
];
|
||||||
|
if (this.validateOnly) {
|
||||||
|
parameterValues.push(Object.assign(new ProcessParameter(), { name: '-v', value: true }));
|
||||||
|
}
|
||||||
|
|
||||||
this.scriptDataService.invoke(METADATA_IMPORT_SCRIPT_NAME, parameterValues, [this.fileObject]).pipe(
|
this.scriptDataService.invoke(METADATA_IMPORT_SCRIPT_NAME, parameterValues, [this.fileObject]).pipe(
|
||||||
getFirstCompletedRemoteData(),
|
getFirstCompletedRemoteData(),
|
||||||
|
@@ -70,6 +70,12 @@ export function getWorkflowItemModuleRoute() {
|
|||||||
return `/${WORKFLOW_ITEM_MODULE_PATH}`;
|
return `/${WORKFLOW_ITEM_MODULE_PATH}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const WORKSPACE_ITEM_MODULE_PATH = 'workspaceitems';
|
||||||
|
|
||||||
|
export function getWorkspaceItemModuleRoute() {
|
||||||
|
return `/${WORKSPACE_ITEM_MODULE_PATH}`;
|
||||||
|
}
|
||||||
|
|
||||||
export function getDSORoute(dso: DSpaceObject): string {
|
export function getDSORoute(dso: DSpaceObject): string {
|
||||||
if (hasValue(dso)) {
|
if (hasValue(dso)) {
|
||||||
switch ((dso as any).type) {
|
switch ((dso as any).type) {
|
||||||
|
@@ -4,7 +4,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|||||||
import { CommonModule, DOCUMENT } from '@angular/common';
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
|
|
||||||
// Load the implementations that should be tested
|
// Load the implementations that should be tested
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
@@ -23,7 +23,7 @@ import { BehaviorSubject, Observable, of } from 'rxjs';
|
|||||||
import { select, Store } from '@ngrx/store';
|
import { select, Store } from '@ngrx/store';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
|
|
||||||
import { MetadataService } from './core/metadata/metadata.service';
|
import { MetadataService } from './core/metadata/metadata.service';
|
||||||
import { HostWindowResizeAction } from './shared/host-window.actions';
|
import { HostWindowResizeAction } from './shared/host-window.actions';
|
||||||
|
@@ -43,6 +43,10 @@ import { createPaginatedList } from '../../shared/testing/utils.test';
|
|||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { MyDSpacePageComponent, SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
import { MyDSpacePageComponent, SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
||||||
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
|
||||||
describe('CollectionItemMapperComponent', () => {
|
describe('CollectionItemMapperComponent', () => {
|
||||||
let comp: CollectionItemMapperComponent;
|
let comp: CollectionItemMapperComponent;
|
||||||
@@ -143,6 +147,25 @@ describe('CollectionItemMapperComponent', () => {
|
|||||||
isAuthorized: observableOf(true)
|
isAuthorized: observableOf(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
|
imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
|
||||||
@@ -159,7 +182,10 @@ describe('CollectionItemMapperComponent', () => {
|
|||||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() },
|
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() },
|
||||||
{ provide: RouteService, useValue: routeServiceStub },
|
{ provide: RouteService, useValue: routeServiceStub },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationDataService }
|
{ provide: AuthorizationDataService, useValue: authorizationDataService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
]
|
]
|
||||||
}).overrideComponent(CollectionItemMapperComponent, {
|
}).overrideComponent(CollectionItemMapperComponent, {
|
||||||
set: {
|
set: {
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="collection-page"
|
<div class="collection-page"
|
||||||
*ngVar="(collectionRD$ | async) as collectionRD">
|
*ngVar="(collectionRD$ | async) as collectionRD">
|
||||||
<div *ngIf="collectionRD?.hasSucceeded" @fadeInOut>
|
<div *ngIf="collectionRD?.hasSucceeded" @fadeInOut>
|
||||||
<div *ngIf="collectionRD?.payload as collection">
|
<div *ngIf="collectionRD?.payload as collection">
|
||||||
<ds-view-tracker [object]="collection"></ds-view-tracker>
|
<ds-view-tracker [object]="collection"></ds-view-tracker>
|
||||||
<div class="d-flex flex-row border-bottom mb-4 pb-4">
|
<div class="d-flex flex-row border-bottom mb-4 pb-4">
|
||||||
<header class="comcol-header mr-auto">
|
<header class="comcol-header mr-auto">
|
||||||
@@ -13,8 +13,7 @@
|
|||||||
<!-- Collection logo -->
|
<!-- Collection logo -->
|
||||||
<ds-comcol-page-logo *ngIf="logoRD$"
|
<ds-comcol-page-logo *ngIf="logoRD$"
|
||||||
[logo]="(logoRD$ | async)?.payload"
|
[logo]="(logoRD$ | async)?.payload"
|
||||||
[alternateText]="'Collection Logo'"
|
[alternateText]="'Collection Logo'">
|
||||||
[alternateText]="'Collection Logo'">
|
|
||||||
</ds-comcol-page-logo>
|
</ds-comcol-page-logo>
|
||||||
|
|
||||||
<!-- Handle -->
|
<!-- Handle -->
|
||||||
|
@@ -6,7 +6,7 @@ import { CollectionPageComponent } from './collection-page.component';
|
|||||||
* Themed wrapper for CollectionPageComponent
|
* Themed wrapper for CollectionPageComponent
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-themed-community-page',
|
selector: 'ds-themed-collection-page',
|
||||||
styleUrls: [],
|
styleUrls: [],
|
||||||
templateUrl: '../shared/theme-support/themed.component.html',
|
templateUrl: '../shared/theme-support/themed.component.html',
|
||||||
})
|
})
|
||||||
|
@@ -25,6 +25,14 @@ import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
|||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
import { SearchServiceStub } from '../../shared/testing/search-service.stub';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
import { createPaginatedList } from '../../shared/testing/utils.test';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
||||||
|
|
||||||
describe('CommunityPageSubCollectionList Component', () => {
|
describe('CommunityPageSubCollectionList Component', () => {
|
||||||
let comp: CommunityPageSubCollectionListComponent;
|
let comp: CommunityPageSubCollectionListComponent;
|
||||||
@@ -122,6 +130,25 @@ describe('CommunityPageSubCollectionList Component', () => {
|
|||||||
|
|
||||||
themeService = getMockThemeService();
|
themeService = getMockThemeService();
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -138,6 +165,10 @@ describe('CommunityPageSubCollectionList Component', () => {
|
|||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: SelectableListService, useValue: {} },
|
{ provide: SelectableListService, useValue: {} },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -25,6 +25,13 @@ import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
|||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
import { createPaginatedList } from '../../shared/testing/utils.test';
|
||||||
|
|
||||||
describe('CommunityPageSubCommunityListComponent Component', () => {
|
describe('CommunityPageSubCommunityListComponent Component', () => {
|
||||||
let comp: CommunityPageSubCommunityListComponent;
|
let comp: CommunityPageSubCommunityListComponent;
|
||||||
@@ -119,6 +126,25 @@ describe('CommunityPageSubCommunityListComponent Component', () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
const paginationService = new PaginationServiceStub();
|
const paginationService = new PaginationServiceStub();
|
||||||
|
|
||||||
themeService = getMockThemeService();
|
themeService = getMockThemeService();
|
||||||
@@ -139,6 +165,10 @@ describe('CommunityPageSubCommunityListComponent Component', () => {
|
|||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: SelectableListService, useValue: {} },
|
{ provide: SelectableListService, useValue: {} },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -166,6 +166,7 @@ import { GroupDataService } from './eperson/group-data.service';
|
|||||||
import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model';
|
import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model';
|
||||||
import { AccessStatusObject } from '../shared/object-list/access-status-badge/access-status.model';
|
import { AccessStatusObject } from '../shared/object-list/access-status-badge/access-status.model';
|
||||||
import { AccessStatusDataService } from './data/access-status-data.service';
|
import { AccessStatusDataService } from './data/access-status-data.service';
|
||||||
|
import { LinkHeadService } from './services/link-head.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When not in production, endpoint responses can be mocked for testing purposes
|
* When not in production, endpoint responses can be mocked for testing purposes
|
||||||
@@ -205,6 +206,7 @@ const PROVIDERS = [
|
|||||||
SectionFormOperationsService,
|
SectionFormOperationsService,
|
||||||
FormService,
|
FormService,
|
||||||
EPersonDataService,
|
EPersonDataService,
|
||||||
|
LinkHeadService,
|
||||||
HALEndpointService,
|
HALEndpointService,
|
||||||
HostWindowService,
|
HostWindowService,
|
||||||
ItemDataService,
|
ItemDataService,
|
||||||
|
@@ -7,8 +7,8 @@ import { filter, map, take } from 'rxjs/operators';
|
|||||||
import { SortDirection, SortOptions } from '../cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../cache/models/sort-options.model';
|
||||||
import { hasValue, isEmpty, isNotEmpty } from '../../shared/empty.util';
|
import { hasValue, isEmpty, isNotEmpty } from '../../shared/empty.util';
|
||||||
import { difference } from '../../shared/object.util';
|
import { difference } from '../../shared/object.util';
|
||||||
import { isNumeric } from 'rxjs/internal-compatibility';
|
|
||||||
import { FindListOptions } from '../data/find-list-options.model';
|
import { FindListOptions } from '../data/find-list-options.model';
|
||||||
|
import { isNumeric } from '../../shared/numeric.util';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
45
src/app/core/services/link-head.service.spec.ts
Normal file
45
src/app/core/services/link-head.service.spec.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { DOCUMENT } from '@angular/common';
|
||||||
|
import { Renderer2, RendererFactory2 } from '@angular/core';
|
||||||
|
import { TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { MockProvider } from 'ng-mocks';
|
||||||
|
import { LinkHeadService } from './link-head.service';
|
||||||
|
|
||||||
|
describe('LinkHeadService', () => {
|
||||||
|
|
||||||
|
let service: LinkHeadService;
|
||||||
|
|
||||||
|
const renderer2: Renderer2 = {
|
||||||
|
createRenderer: jasmine.createSpy('createRenderer'),
|
||||||
|
createElement: jasmine.createSpy('createElement'),
|
||||||
|
setAttribute: jasmine.createSpy('setAttribute'),
|
||||||
|
appendChild: jasmine.createSpy('appendChild')
|
||||||
|
} as unknown as Renderer2;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
return TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
MockProvider(RendererFactory2, {
|
||||||
|
createRenderer: () => renderer2
|
||||||
|
}),
|
||||||
|
{ provide: Document, useExisting: DOCUMENT },
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
service = new LinkHeadService(TestBed.inject(RendererFactory2), TestBed.inject(DOCUMENT));
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('link', () => {
|
||||||
|
it('should create a link tag', () => {
|
||||||
|
const link = service.addTag({
|
||||||
|
href: 'test',
|
||||||
|
type: 'application/atom+xml',
|
||||||
|
rel: 'alternate',
|
||||||
|
title: 'Sitewide Atom feed'
|
||||||
|
});
|
||||||
|
expect(link).not.toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
90
src/app/core/services/link-head.service.ts
Normal file
90
src/app/core/services/link-head.service.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import { Injectable, RendererFactory2, ViewEncapsulation, Inject } from '@angular/core';
|
||||||
|
import { DOCUMENT } from '@angular/common';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LinkHead Service injects <link> tag into the head element during runtime.
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class LinkHeadService {
|
||||||
|
constructor(
|
||||||
|
private rendererFactory: RendererFactory2,
|
||||||
|
@Inject(DOCUMENT) private document
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to create a Link tag in the HEAD of the html.
|
||||||
|
* @param tag LinkDefition is the paramaters to define a link tag.
|
||||||
|
* @returns Link tag that was created
|
||||||
|
*/
|
||||||
|
addTag(tag: LinkDefinition) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
const renderer = this.rendererFactory.createRenderer(this.document, {
|
||||||
|
id: '-1',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
styles: [],
|
||||||
|
data: {}
|
||||||
|
});
|
||||||
|
|
||||||
|
const link = renderer.createElement('link');
|
||||||
|
const head = this.document.head;
|
||||||
|
|
||||||
|
if (head === null) {
|
||||||
|
throw new Error('<head> not found within DOCUMENT.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.keys(tag).forEach((prop: string) => {
|
||||||
|
return renderer.setAttribute(link, prop, tag[prop]);
|
||||||
|
});
|
||||||
|
|
||||||
|
renderer.appendChild(head, link);
|
||||||
|
return renderer;
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error within linkService : ', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a link tag in header based on the given attrSelector.
|
||||||
|
* @param attrSelector The attr assigned to a link tag which will be used to determine what link to remove.
|
||||||
|
*/
|
||||||
|
removeTag(attrSelector: string) {
|
||||||
|
if (attrSelector) {
|
||||||
|
try {
|
||||||
|
const renderer = this.rendererFactory.createRenderer(this.document, {
|
||||||
|
id: '-1',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
styles: [],
|
||||||
|
data: {}
|
||||||
|
});
|
||||||
|
const head = this.document.head;
|
||||||
|
if (head === null) {
|
||||||
|
throw new Error('<head> not found within DOCUMENT.');
|
||||||
|
}
|
||||||
|
const linkTags = this.document.querySelectorAll('link[' + attrSelector + ']');
|
||||||
|
for (const link of linkTags) {
|
||||||
|
renderer.removeChild(head, link);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Error while removing tag ' + e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare type LinkDefinition = {
|
||||||
|
charset?: string;
|
||||||
|
crossorigin?: string;
|
||||||
|
href?: string;
|
||||||
|
hreflang?: string;
|
||||||
|
media?: string;
|
||||||
|
rel?: string;
|
||||||
|
rev?: string;
|
||||||
|
sizes?: string;
|
||||||
|
target?: string;
|
||||||
|
type?: string;
|
||||||
|
} & {
|
||||||
|
[prop: string]: string;
|
||||||
|
};
|
@@ -3,7 +3,7 @@ import { getMockRequestService } from '../../shared/mocks/request.service.mock';
|
|||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { HALEndpointService } from './hal-endpoint.service';
|
import { HALEndpointService } from './hal-endpoint.service';
|
||||||
import { EndpointMapRequest } from '../data/request.models';
|
import { EndpointMapRequest } from '../data/request.models';
|
||||||
import { combineLatest as observableCombineLatest, of as observableOf } from 'rxjs';
|
import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
@@ -162,9 +162,9 @@ describe('HALEndpointService', () => {
|
|||||||
return observableOf(endpointMaps[param]);
|
return observableOf(endpointMaps[param]);
|
||||||
});
|
});
|
||||||
|
|
||||||
observableCombineLatest([
|
observableCombineLatest<string[]>([
|
||||||
(service as any).getEndpointAt(start, 'one'),
|
(service as any).getEndpointAt(start, 'one'),
|
||||||
(service as any).getEndpointAt(start, 'one', 'two')
|
(service as any).getEndpointAt(start, 'one', 'two'),
|
||||||
]).subscribe(([endpoint1, endpoint2]) => {
|
]).subscribe(([endpoint1, endpoint2]) => {
|
||||||
expect(endpoint1).toEqual(one);
|
expect(endpoint1).toEqual(one);
|
||||||
expect(endpoint2).toEqual(two);
|
expect(endpoint2).toEqual(two);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { combineLatest as observableCombineLatest, Observable } from 'rxjs';
|
import { combineLatest as observableCombineLatest, Observable, interval } from 'rxjs';
|
||||||
import { debounceTime, filter, find, map, switchMap, take, takeWhile } from 'rxjs/operators';
|
import { filter, find, map, switchMap, take, takeWhile, debounce, debounceTime } from 'rxjs/operators';
|
||||||
import { hasNoValue, hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util';
|
import { hasNoValue, hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util';
|
||||||
import { SearchResult } from '../../shared/search/models/search-result.model';
|
import { SearchResult } from '../../shared/search/models/search-result.model';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
@@ -9,6 +9,17 @@ import { MetadataSchema } from '../metadata/metadata-schema.model';
|
|||||||
import { BrowseDefinition } from './browse-definition.model';
|
import { BrowseDefinition } from './browse-definition.model';
|
||||||
import { DSpaceObject } from './dspace-object.model';
|
import { DSpaceObject } from './dspace-object.model';
|
||||||
import { InjectionToken } from '@angular/core';
|
import { InjectionToken } from '@angular/core';
|
||||||
|
import { MonoTypeOperatorFunction, SchedulerLike } from 'rxjs/internal/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this method instead of the RxJs debounceTime if you're waiting for debouncing in tests;
|
||||||
|
* debounceTime doesn't work with fakeAsync/tick anymore as of Angular 13.2.6 & RxJs 7.5.5
|
||||||
|
* Workaround suggested in https://github.com/angular/angular/issues/44351#issuecomment-1107454054
|
||||||
|
* todo: remove once the above issue is fixed
|
||||||
|
*/
|
||||||
|
export const debounceTimeWorkaround = <T>(dueTime: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T> => {
|
||||||
|
return debounce(() => interval(dueTime, scheduler));
|
||||||
|
};
|
||||||
|
|
||||||
export const DEBOUNCE_TIME_OPERATOR = new InjectionToken<<T>(dueTime: number) => (source: Observable<T>) => Observable<T>>('debounceTime', {
|
export const DEBOUNCE_TIME_OPERATOR = new InjectionToken<<T>(dueTime: number) => (source: Observable<T>) => Observable<T>>('debounceTime', {
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
@@ -0,0 +1,43 @@
|
|||||||
|
import { DSpaceObject } from './../../shared/dspace-object.model';
|
||||||
|
import { followLink } from './../../../shared/utils/follow-link-config.model';
|
||||||
|
import { ChildHALResource } from './../../shared/child-hal-resource.model';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
import { switchMap } from 'rxjs/operators';
|
||||||
|
import { DataService } from '../../data/data.service';
|
||||||
|
import { RemoteData } from '../../data/remote-data';
|
||||||
|
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class SubmissionObjectResolver<T> implements Resolve<RemoteData<T>> {
|
||||||
|
constructor(
|
||||||
|
protected dataService: DataService<any>,
|
||||||
|
protected store: Store<any>
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for resolving an item based on the parameters in the current route
|
||||||
|
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||||
|
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||||
|
* @returns Observable<<RemoteData<Item>> Emits the found item based on the parameters in the current route,
|
||||||
|
* or an error if something went wrong
|
||||||
|
*/
|
||||||
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<T>> {
|
||||||
|
const itemRD$ = this.dataService.findById(route.params.id,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
followLink('item'),
|
||||||
|
).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
switchMap((wfiRD: RemoteData<any>) => wfiRD.payload.item as Observable<RemoteData<T>>),
|
||||||
|
getFirstCompletedRemoteData()
|
||||||
|
);
|
||||||
|
return itemRD$;
|
||||||
|
}
|
||||||
|
}
|
@@ -25,6 +25,13 @@ import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
|||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
import { createPaginatedList } from '../../shared/testing/utils.test';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
||||||
|
|
||||||
describe('TopLevelCommunityList Component', () => {
|
describe('TopLevelCommunityList Component', () => {
|
||||||
let comp: TopLevelCommunityListComponent;
|
let comp: TopLevelCommunityListComponent;
|
||||||
@@ -114,6 +121,25 @@ describe('TopLevelCommunityList Component', () => {
|
|||||||
|
|
||||||
themeService = getMockThemeService();
|
themeService = getMockThemeService();
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -130,6 +156,10 @@ describe('TopLevelCommunityList Component', () => {
|
|||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: SelectableListService, useValue: {} },
|
{ provide: SelectableListService, useValue: {} },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -23,6 +23,14 @@ import { PaginationComponent } from '../../../../shared/pagination/pagination.co
|
|||||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
||||||
import { RelationshipTypeService } from '../../../../core/data/relationship-type.service';
|
import { RelationshipTypeService } from '../../../../core/data/relationship-type.service';
|
||||||
import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model';
|
import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model';
|
||||||
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
|
import { ConfigurationDataService } from '../../../../core/data/configuration-data.service';
|
||||||
|
import { LinkHeadService } from '../../../../core/services/link-head.service';
|
||||||
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub';
|
||||||
|
import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||||
|
|
||||||
let comp: EditRelationshipListComponent;
|
let comp: EditRelationshipListComponent;
|
||||||
let fixture: ComponentFixture<EditRelationshipListComponent>;
|
let fixture: ComponentFixture<EditRelationshipListComponent>;
|
||||||
@@ -174,6 +182,25 @@ describe('EditRelationshipListComponent', () => {
|
|||||||
|
|
||||||
hostWindowService = new HostWindowServiceStub(1200);
|
hostWindowService = new HostWindowServiceStub(1200);
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [SharedModule, TranslateModule.forRoot()],
|
imports: [SharedModule, TranslateModule.forRoot()],
|
||||||
declarations: [EditRelationshipListComponent],
|
declarations: [EditRelationshipListComponent],
|
||||||
@@ -185,6 +212,11 @@ describe('EditRelationshipListComponent', () => {
|
|||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: HostWindowService, useValue: hostWindowService },
|
{ provide: HostWindowService, useValue: hostWindowService },
|
||||||
{ provide: RelationshipTypeService, useValue: relationshipTypeService },
|
{ provide: RelationshipTypeService, useValue: relationshipTypeService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: Router, useValue: new RouterMock() },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
], schemas: [
|
], schemas: [
|
||||||
NO_ERRORS_SCHEMA
|
NO_ERRORS_SCHEMA
|
||||||
]
|
]
|
||||||
|
@@ -12,26 +12,28 @@
|
|||||||
[tooltipMsg]="'item.page.edit'"></ds-dso-page-edit-button>
|
[tooltipMsg]="'item.page.edit'"></ds-dso-page-edit-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="simple-view-link my-3" *ngIf="!fromWfi">
|
<div class="simple-view-link my-3" *ngIf="!fromSubmissionObject">
|
||||||
<a class="btn btn-outline-primary" [routerLink]="[(itemPageRoute$ | async)]">
|
<a class="btn btn-outline-primary" [routerLink]="[(itemPageRoute$ | async)]">
|
||||||
{{"item.page.link.simple" | translate}}
|
{{"item.page.link.simple" | translate}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-responsive table-striped">
|
<div class="table-responsive">
|
||||||
<tbody>
|
<table class="table table-striped">
|
||||||
<ng-container *ngFor="let mdEntry of (metadata$ | async) | keyvalue">
|
<tbody>
|
||||||
<tr *ngFor="let mdValue of mdEntry.value">
|
<ng-container *ngFor="let mdEntry of (metadata$ | async) | keyvalue">
|
||||||
<td>{{mdEntry.key}}</td>
|
<tr *ngFor="let mdValue of mdEntry.value">
|
||||||
<td>{{mdValue.value}}</td>
|
<td>{{mdEntry.key}}</td>
|
||||||
<td>{{mdValue.language}}</td>
|
<td>{{mdValue.value}}</td>
|
||||||
</tr>
|
<td>{{mdValue.language}}</td>
|
||||||
</ng-container>
|
</tr>
|
||||||
</tbody>
|
</ng-container>
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<ds-item-page-full-file-section [item]="item"></ds-item-page-full-file-section>
|
<ds-item-page-full-file-section [item]="item"></ds-item-page-full-file-section>
|
||||||
<ds-item-page-collections [item]="item"></ds-item-page-collections>
|
<ds-item-page-collections [item]="item"></ds-item-page-collections>
|
||||||
<ds-item-versions class="mt-2" [item]="item"></ds-item-versions>
|
<ds-item-versions class="mt-2" [item]="item"></ds-item-versions>
|
||||||
<div class="button-row bottom" *ngIf="fromWfi">
|
<div class="button-row bottom" *ngIf="fromSubmissionObject">
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<button class="btn btn-outline-secondary mr-1" (click)="back()"><i
|
<button class="btn btn-outline-secondary mr-1" (click)="back()"><i
|
||||||
class="fas fa-arrow-left"></i> {{'item.page.return' | translate}}</button>
|
class="fas fa-arrow-left"></i> {{'item.page.return' | translate}}</button>
|
||||||
|
@@ -112,7 +112,7 @@ describe('FullItemPageComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show simple view button when not originated from workflow item', () => {
|
it('should show simple view button when not originated from workflow item', () => {
|
||||||
expect(comp.fromWfi).toBe(false);
|
expect(comp.fromSubmissionObject).toBe(false);
|
||||||
const simpleViewBtn = fixture.debugElement.query(By.css('.simple-view-link'));
|
const simpleViewBtn = fixture.debugElement.query(By.css('.simple-view-link'));
|
||||||
expect(simpleViewBtn).toBeTruthy();
|
expect(simpleViewBtn).toBeTruthy();
|
||||||
});
|
});
|
||||||
@@ -122,7 +122,7 @@ describe('FullItemPageComponent', () => {
|
|||||||
comp.ngOnInit();
|
comp.ngOnInit();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
expect(comp.fromWfi).toBe(true);
|
expect(comp.fromSubmissionObject).toBe(true);
|
||||||
const simpleViewBtn = fixture.debugElement.query(By.css('.simple-view-link'));
|
const simpleViewBtn = fixture.debugElement.query(By.css('.simple-view-link'));
|
||||||
expect(simpleViewBtn).toBeFalsy();
|
expect(simpleViewBtn).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
@@ -2,7 +2,7 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Data, Router } from '@angular/router';
|
||||||
|
|
||||||
import { Observable , BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
|
||||||
import { ItemPageComponent } from '../simple/item-page.component';
|
import { ItemPageComponent } from '../simple/item-page.component';
|
||||||
import { MetadataMap } from '../../core/shared/metadata.models';
|
import { MetadataMap } from '../../core/shared/metadata.models';
|
||||||
@@ -37,9 +37,9 @@ export class FullItemPageComponent extends ItemPageComponent implements OnInit,
|
|||||||
metadata$: Observable<MetadataMap>;
|
metadata$: Observable<MetadataMap>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True when the itemRD has been originated from its workflowitem, false otherwise.
|
* True when the itemRD has been originated from its workspaceite/workflowitem, false otherwise.
|
||||||
*/
|
*/
|
||||||
fromWfi = false;
|
fromSubmissionObject = false;
|
||||||
|
|
||||||
subs = [];
|
subs = [];
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ export class FullItemPageComponent extends ItemPageComponent implements OnInit,
|
|||||||
map((item: Item) => item.metadata),);
|
map((item: Item) => item.metadata),);
|
||||||
|
|
||||||
this.subs.push(this.route.data.subscribe((data: Data) => {
|
this.subs.push(this.route.data.subscribe((data: Data) => {
|
||||||
this.fromWfi = hasValue(data.wfi);
|
this.fromSubmissionObject = hasValue(data.wfi) || hasValue(data.wsi);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -5,8 +5,9 @@ import { FormGroup } from '@angular/forms';
|
|||||||
import { hasValue, isEmpty } from '../../shared/empty.util';
|
import { hasValue, isEmpty } from '../../shared/empty.util';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { debounceTime, map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
import { debounceTimeWorkaround as debounceTime } from '../../core/shared/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-profile-page-security-form',
|
selector: 'ds-profile-page-security-form',
|
||||||
|
@@ -9,7 +9,7 @@ import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
|
|||||||
import { NativeWindowRef, NativeWindowService } from '../core/services/window.service';
|
import { NativeWindowRef, NativeWindowService } from '../core/services/window.service';
|
||||||
import { MetadataService } from '../core/metadata/metadata.service';
|
import { MetadataService } from '../core/metadata/metadata.service';
|
||||||
import { MetadataServiceMock } from '../shared/mocks/metadata-service.mock';
|
import { MetadataServiceMock } from '../shared/mocks/metadata-service.mock';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
import { AngularticsProviderMock } from '../shared/mocks/angulartics-provider.service.mock';
|
import { AngularticsProviderMock } from '../shared/mocks/angulartics-provider.service.mock';
|
||||||
import { Angulartics2DSpace } from '../statistics/angulartics/dspace-provider';
|
import { Angulartics2DSpace } from '../statistics/angulartics/dspace-provider';
|
||||||
import { AuthService } from '../core/auth/auth.service';
|
import { AuthService } from '../core/auth/auth.service';
|
||||||
|
@@ -5,7 +5,7 @@ import { Router } from '@angular/router';
|
|||||||
import { combineLatest as combineLatestObservable, Observable, of } from 'rxjs';
|
import { combineLatest as combineLatestObservable, Observable, of } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
|
|
||||||
import { MetadataService } from '../core/metadata/metadata.service';
|
import { MetadataService } from '../core/metadata/metadata.service';
|
||||||
import { HostWindowState } from '../shared/search/host-window.reducer';
|
import { HostWindowState } from '../shared/search/host-window.reducer';
|
||||||
|
@@ -38,6 +38,13 @@ import { HostWindowService } from '../host-window.service';
|
|||||||
import { RouteService } from '../../core/services/route.service';
|
import { RouteService } from '../../core/services/route.service';
|
||||||
import { routeServiceStub } from '../testing/route-service.stub';
|
import { routeServiceStub } from '../testing/route-service.stub';
|
||||||
import SpyObj = jasmine.SpyObj;
|
import SpyObj = jasmine.SpyObj;
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { createPaginatedList } from '../testing/utils.test';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
import { SearchConfigurationServiceStub } from '../testing/search-configuration-service.stub';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
|
||||||
@listableObjectComponent(BrowseEntry, ViewMode.ListElement, DEFAULT_CONTEXT, 'custom')
|
@listableObjectComponent(BrowseEntry, ViewMode.ListElement, DEFAULT_CONTEXT, 'custom')
|
||||||
@Component({
|
@Component({
|
||||||
@@ -73,6 +80,25 @@ describe('BrowseByComponent', () => {
|
|||||||
];
|
];
|
||||||
const mockItemsRD$ = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockItems));
|
const mockItemsRD$ = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockItems));
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
const paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
const paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'test-pagination',
|
id: 'test-pagination',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
@@ -103,6 +129,10 @@ describe('BrowseByComponent', () => {
|
|||||||
],
|
],
|
||||||
declarations: [],
|
declarations: [],
|
||||||
providers: [
|
providers: [
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: MockThemedBrowseEntryListElementComponent },
|
{ provide: MockThemedBrowseEntryListElementComponent },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
|
@@ -143,7 +143,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
|||||||
this.typesString = this.types.map((type: string) => type.toString().toLowerCase()).join(', ');
|
this.typesString = this.types.map((type: string) => type.toString().toLowerCase()).join(', ');
|
||||||
|
|
||||||
// Create an observable searching for the current DSO (return empty list if there's no current DSO)
|
// Create an observable searching for the current DSO (return empty list if there's no current DSO)
|
||||||
let currentDSOResult$;
|
let currentDSOResult$: Observable<PaginatedList<SearchResult<DSpaceObject>>>;
|
||||||
if (isNotEmpty(this.currentDSOId)) {
|
if (isNotEmpty(this.currentDSOId)) {
|
||||||
currentDSOResult$ = this.search(this.getCurrentDSOQuery(), 1).pipe(getFirstSucceededRemoteDataPayload());
|
currentDSOResult$ = this.search(this.getCurrentDSOQuery(), 1).pipe(getFirstSucceededRemoteDataPayload());
|
||||||
} else {
|
} else {
|
||||||
|
@@ -100,7 +100,9 @@ describe('ItemVersionsComponent', () => {
|
|||||||
isAuthenticated: observableOf(true),
|
isAuthenticated: observableOf(true),
|
||||||
setRedirectUrl: {}
|
setRedirectUrl: {}
|
||||||
});
|
});
|
||||||
const authorizationServiceSpy = jasmine.createSpyObj('authorizationService', ['isAuthorized']);
|
const authorizationServiceSpy = jasmine.createSpyObj('authorizationService', {
|
||||||
|
isAuthorized: observableOf(true)
|
||||||
|
});
|
||||||
const workspaceItemDataServiceSpy = jasmine.createSpyObj('workspaceItemDataService', {
|
const workspaceItemDataServiceSpy = jasmine.createSpyObj('workspaceItemDataService', {
|
||||||
findByItem: EMPTY,
|
findByItem: EMPTY,
|
||||||
});
|
});
|
||||||
|
@@ -1,22 +1,16 @@
|
|||||||
<ng-container *ngVar="(actionRD$ | async)?.payload as workflowAction">
|
<ng-container *ngVar="(actionRD$ | async)?.payload as workflowAction">
|
||||||
<div class="mt-1 mb-3 space-children-mr">
|
<div class="mt-1 mb-3 space-children-mr">
|
||||||
<ds-claimed-task-actions-loader *ngFor="let option of workflowAction?.options"
|
<ds-claimed-task-actions-loader *ngFor="let option of workflowAction?.options" [option]="option" [object]="object"
|
||||||
[option]="option"
|
(processCompleted)="this.processCompleted.emit($event)">
|
||||||
[object]="object"
|
|
||||||
(processCompleted)="this.processCompleted.emit($event)">
|
|
||||||
</ds-claimed-task-actions-loader>
|
</ds-claimed-task-actions-loader>
|
||||||
|
|
||||||
<ng-container *ngIf="hasViewAction(workflowAction)">
|
<button class="btn btn-primary workflow-view" ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"
|
||||||
<button class="btn btn-primary workflow-view"
|
[routerLink]="[getWorkflowItemViewRoute((workflowitem$ | async))]">
|
||||||
ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"
|
<i class="fa fa-info-circle"></i> {{"submission.workflow.generic.view" | translate}}
|
||||||
[routerLink]="[getWorkflowItemViewRoute((workflowitem$ | async))]">
|
</button>
|
||||||
<i class="fa fa-info-circle"></i> {{"submission.workflow.generic.view" | translate}}
|
|
||||||
</button>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ds-claimed-task-actions-loader [option]="returnToPoolOption"
|
<ds-claimed-task-actions-loader [option]="returnToPoolOption" [object]="object"
|
||||||
[object]="object"
|
(processCompleted)="this.processCompleted.emit($event)">
|
||||||
(processCompleted)="this.processCompleted.emit($event)">
|
|
||||||
</ds-claimed-task-actions-loader>
|
</ds-claimed-task-actions-loader>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@@ -161,25 +161,22 @@ describe('ClaimedTaskActionsComponent', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('when edit options is not available', () => {
|
it('should display a view button', waitForAsync(() => {
|
||||||
it('should display a view button', waitForAsync(() => {
|
component.object = null;
|
||||||
component.object = null;
|
component.initObjects(mockObject);
|
||||||
component.initObjects(mockObject);
|
fixture.detectChanges();
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
const debugElement = fixture.debugElement.query(By.css('.workflow-view'));
|
const debugElement = fixture.debugElement.query(By.css('.workflow-view'));
|
||||||
expect(debugElement).toBeTruthy();
|
expect(debugElement).toBeTruthy();
|
||||||
expect(debugElement.nativeElement.innerText.trim()).toBe('submission.workflow.generic.view');
|
expect(debugElement.nativeElement.innerText.trim()).toBe('submission.workflow.generic.view');
|
||||||
});
|
});
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('getWorkflowItemViewRoute should return the combined uri to show a workspaceitem', waitForAsync(() => {
|
|
||||||
const href = component.getWorkflowItemViewRoute(workflowitem);
|
|
||||||
expect(href).toEqual('/workflowitems/333/view');
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
it('getWorkflowItemViewRoute should return the combined uri to show a workspaceitem', waitForAsync(() => {
|
||||||
|
const href = component.getWorkflowItemViewRoute(workflowitem);
|
||||||
|
expect(href).toEqual('/workflowitems/333/view');
|
||||||
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -102,14 +102,6 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent<Claime
|
|||||||
this.actionRD$ = object.action;
|
this.actionRD$ = object.action;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if claimed task actions should display a view item button.
|
|
||||||
* @param workflowAction
|
|
||||||
*/
|
|
||||||
hasViewAction(workflowAction: WorkflowAction) {
|
|
||||||
return !workflowAction?.options.includes('submit_edit_metadata');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the workflowitem view route.
|
* Get the workflowitem view route.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,8 +1,13 @@
|
|||||||
<button type="button"
|
<button type="button" class="btn btn-info mt-1 mb-3"
|
||||||
class="btn btn-info mt-1 mb-3"
|
ngbTooltip="{{'submission.workflow.tasks.pool.claim_help' | translate}}" [disabled]="(processing$ | async)"
|
||||||
ngbTooltip="{{'submission.workflow.tasks.pool.claim_help' | translate}}"
|
(click)="claim()">
|
||||||
[disabled]="(processing$ | async)"
|
<span *ngIf="(processing$ | async)"><i class='fas fa-circle-notch fa-spin'></i>
|
||||||
(click)="claim()">
|
{{'submission.workflow.tasks.generic.processing' | translate}}</span>
|
||||||
<span *ngIf="(processing$ | async)"><i class='fas fa-circle-notch fa-spin'></i> {{'submission.workflow.tasks.generic.processing' | translate}}</span>
|
<span *ngIf="!(processing$ | async)"><i class="fas fa-hand-paper"></i> {{'submission.workflow.tasks.pool.claim' |
|
||||||
<span *ngIf="!(processing$ | async)"><i class="fas fa-hand-paper"></i> {{'submission.workflow.tasks.pool.claim' | translate}}</span>
|
translate}}</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary workflow-view ml-1 mt-1 mb-3" data-test="view-btn"
|
||||||
|
ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"
|
||||||
|
[routerLink]="[getWorkflowItemViewRoute((workflowitem$ | async))]">
|
||||||
|
<i class="fa fa-info-circle"></i> {{"submission.workflow.generic.view" | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
@@ -133,6 +133,12 @@ describe('PoolTaskActionsComponent', () => {
|
|||||||
expect(btn).toBeDefined();
|
expect(btn).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display view button', () => {
|
||||||
|
const btn = fixture.debugElement.query(By.css('button [data-test="view-btn"]'));
|
||||||
|
|
||||||
|
expect(btn).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
it('should call claim task with href of getPoolTaskEndpointById', ((done) => {
|
it('should call claim task with href of getPoolTaskEndpointById', ((done) => {
|
||||||
|
|
||||||
const poolTaskHref = 'poolTaskHref';
|
const poolTaskHref = 'poolTaskHref';
|
||||||
|
@@ -2,7 +2,7 @@ import { Component, Injector, Input, OnDestroy } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import {filter, map, switchMap, take} from 'rxjs/operators';
|
import { filter, map, switchMap, take } from 'rxjs/operators';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
|
||||||
@@ -19,6 +19,7 @@ import { Item } from '../../../core/shared/item.model';
|
|||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actions';
|
import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actions';
|
||||||
import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response';
|
import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response';
|
||||||
|
import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents mydspace actions related to PoolTask object.
|
* This component represents mydspace actions related to PoolTask object.
|
||||||
@@ -58,12 +59,12 @@ export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent
|
|||||||
* @param {RequestService} requestService
|
* @param {RequestService} requestService
|
||||||
*/
|
*/
|
||||||
constructor(protected injector: Injector,
|
constructor(protected injector: Injector,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected claimedTaskService: ClaimedTaskDataService,
|
protected claimedTaskService: ClaimedTaskDataService,
|
||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
protected searchService: SearchService,
|
protected searchService: SearchService,
|
||||||
protected requestService: RequestService) {
|
protected requestService: RequestService) {
|
||||||
super(PoolTask.type, injector, router, notificationsService, translate, searchService, requestService);
|
super(PoolTask.type, injector, router, notificationsService, translate, searchService, requestService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent
|
|||||||
return this.objectDataService.getPoolTaskEndpointById(this.object.id)
|
return this.objectDataService.getPoolTaskEndpointById(this.object.id)
|
||||||
.pipe(switchMap((poolTaskHref) => {
|
.pipe(switchMap((poolTaskHref) => {
|
||||||
return this.claimedTaskService.claimTask(this.object.id, poolTaskHref);
|
return this.claimedTaskService.claimTask(this.object.id, poolTaskHref);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadObjectExecution(): Observable<RemoteData<DSpaceObject> | DSpaceObject> {
|
reloadObjectExecution(): Observable<RemoteData<DSpaceObject> | DSpaceObject> {
|
||||||
@@ -107,12 +108,19 @@ export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent
|
|||||||
switchMap((workflowItem: WorkflowItem) => workflowItem.item.pipe(getFirstSucceededRemoteDataPayload())
|
switchMap((workflowItem: WorkflowItem) => workflowItem.item.pipe(getFirstSucceededRemoteDataPayload())
|
||||||
))
|
))
|
||||||
.subscribe((item: Item) => {
|
.subscribe((item: Item) => {
|
||||||
this.itemUuid = item.uuid;
|
this.itemUuid = item.uuid;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subs.forEach((sub) => sub.unsubscribe());
|
this.subs.forEach((sub) => sub.unsubscribe());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the workflowitem view route.
|
||||||
|
*/
|
||||||
|
getWorkflowItemViewRoute(workflowitem: WorkflowItem): string {
|
||||||
|
return getWorkflowItemViewRoute(workflowitem?.id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
<button class="btn btn-primary workflow-view mt-1 mb-3" data-test="view-btn"
|
||||||
|
ngbTooltip="{{'submission.workspace.generic.view-help' | translate}}"
|
||||||
|
[routerLink]="[getWorkflowItemViewRoute(object)]">
|
||||||
|
<i class="fa fa-info-circle"></i> {{"submission.workspace.generic.view" | translate}}
|
||||||
|
</button>
|
||||||
|
@@ -18,6 +18,7 @@ import { getMockRequestService } from '../../mocks/request.service.mock';
|
|||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { getMockSearchService } from '../../mocks/search-service.mock';
|
import { getMockSearchService } from '../../mocks/search-service.mock';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
let component: WorkflowitemActionsComponent;
|
let component: WorkflowitemActionsComponent;
|
||||||
let fixture: ComponentFixture<WorkflowitemActionsComponent>;
|
let fixture: ComponentFixture<WorkflowitemActionsComponent>;
|
||||||
@@ -105,4 +106,10 @@ describe('WorkflowitemActionsComponent', () => {
|
|||||||
expect(component.object).toEqual(mockObject);
|
expect(component.object).toEqual(mockObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display view button', () => {
|
||||||
|
const btn = fixture.debugElement.query(By.css('button [data-test="view-btn"]'));
|
||||||
|
|
||||||
|
expect(btn).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -9,6 +9,7 @@ import { WorkflowItemDataService } from '../../../core/submission/workflowitem-d
|
|||||||
import { NotificationsService } from '../../notifications/notifications.service';
|
import { NotificationsService } from '../../notifications/notifications.service';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
|
import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents actions related to WorkflowItem object.
|
* This component represents actions related to WorkflowItem object.
|
||||||
@@ -44,6 +45,13 @@ export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent<Workf
|
|||||||
super(WorkflowItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
super(WorkflowItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the workflowitem view route.
|
||||||
|
*/
|
||||||
|
getWorkflowItemViewRoute(workflowitem: WorkflowItem): string {
|
||||||
|
return getWorkflowItemViewRoute(workflowitem?.id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init the target object
|
* Init the target object
|
||||||
*
|
*
|
||||||
|
@@ -1,22 +1,28 @@
|
|||||||
<div class="space-children-mr">
|
<div class="space-children-mr">
|
||||||
<a class="btn btn-primary mt-1 mb-3"
|
|
||||||
id="{{'edit_' + object.id}}"
|
<button class="btn btn-primary workflow-view mt-1 mb-3" data-test="view-btn"
|
||||||
ngbTooltip="{{'submission.workflow.generic.edit-help' | translate}}"
|
ngbTooltip="{{'submission.workspace.generic.view-help' | translate}}"
|
||||||
[routerLink]="['/workspaceitems/' + object.id + '/edit']"
|
[routerLink]="[getWorkspaceItemViewRoute(object)]">
|
||||||
role="button">
|
<i class="fa fa-info-circle"></i> {{"submission.workspace.generic.view" | translate}}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<a class="btn btn-primary mt-1 mb-3" id="{{'edit_' + object.id}}"
|
||||||
|
ngbTooltip="{{'submission.workflow.generic.edit-help' | translate}}"
|
||||||
|
[routerLink]="['/workspaceitems/' + object.id + '/edit']" role="button">
|
||||||
<i class="fa fa-edit"></i> {{'submission.workflow.generic.edit' | translate}}
|
<i class="fa fa-edit"></i> {{'submission.workflow.generic.edit' | translate}}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button type="button"
|
<button type="button" id="{{'delete_' + object.id}}" class="btn btn-danger mt-1 mb-3"
|
||||||
id="{{'delete_' + object.id}}"
|
ngbTooltip="{{'submission.workflow.generic.delete-help' | translate}}"
|
||||||
class="btn btn-danger mt-1 mb-3"
|
(click)="$event.preventDefault();confirmDiscard(content)">
|
||||||
ngbTooltip="{{'submission.workflow.generic.delete-help' | translate}}"
|
<span *ngIf="(processingDelete$ | async)"><i class='fas fa-circle-notch fa-spin'></i>
|
||||||
(click)="$event.preventDefault();confirmDiscard(content)">
|
{{'submission.workflow.tasks.generic.processing' | translate}}</span>
|
||||||
<span *ngIf="(processingDelete$ | async)"><i class='fas fa-circle-notch fa-spin'></i> {{'submission.workflow.tasks.generic.processing' | translate}}</span>
|
<span *ngIf="!(processingDelete$ | async)"><i class="fa fa-trash"></i> {{'submission.workflow.generic.delete' |
|
||||||
<span *ngIf="!(processingDelete$ | async)"><i class="fa fa-trash"></i> {{'submission.workflow.generic.delete' | translate}}</span>
|
translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<ng-template #content let-c="close" let-d="dismiss">
|
<ng-template #content let-c="close" let-d="dismiss">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title text-danger">{{'submission.general.discard.confirm.title' | translate}}</h4>
|
<h4 class="modal-title text-danger">{{'submission.general.discard.confirm.title' | translate}}</h4>
|
||||||
@@ -28,7 +34,9 @@
|
|||||||
<p>{{'submission.general.discard.confirm.info' | translate}}</p>
|
<p>{{'submission.general.discard.confirm.info' | translate}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" id="delete_cancel" class="btn btn-secondary" (click)="c('cancel')">{{'submission.general.discard.confirm.cancel' | translate}}</button>
|
<button type="button" id="delete_cancel" class="btn btn-secondary"
|
||||||
<button type="button" id="delete_confirm"class="btn btn-danger" (click)="c('ok')">{{'submission.general.discard.confirm.submit' | translate}}</button>
|
(click)="c('cancel')">{{'submission.general.discard.confirm.cancel' | translate}}</button>
|
||||||
|
<button type="button" id="delete_confirm" class="btn btn-danger"
|
||||||
|
(click)="c('ok')">{{'submission.general.discard.confirm.submit' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@@ -132,6 +132,12 @@ describe('WorkspaceitemActionsComponent', () => {
|
|||||||
expect(btn).toBeDefined();
|
expect(btn).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display view button', () => {
|
||||||
|
const btn = fixture.debugElement.query(By.css('button [data-test="view-btn"]'));
|
||||||
|
|
||||||
|
expect(btn).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
describe('on discard confirmation', () => {
|
describe('on discard confirmation', () => {
|
||||||
beforeEach((done) => {
|
beforeEach((done) => {
|
||||||
mockDataService.delete.and.returnValue(observableOf(true));
|
mockDataService.delete.and.returnValue(observableOf(true));
|
||||||
|
@@ -14,6 +14,7 @@ import { SearchService } from '../../../core/shared/search/search.service';
|
|||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
|
import { getWorkspaceItemViewRoute } from '../../../workspaceitems-edit-page/workspaceitems-edit-page-routing-paths';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents actions related to WorkspaceItem object.
|
* This component represents actions related to WorkspaceItem object.
|
||||||
@@ -48,12 +49,12 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent<Work
|
|||||||
* @param {RequestService} requestService
|
* @param {RequestService} requestService
|
||||||
*/
|
*/
|
||||||
constructor(protected injector: Injector,
|
constructor(protected injector: Injector,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected modalService: NgbModal,
|
protected modalService: NgbModal,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
protected searchService: SearchService,
|
protected searchService: SearchService,
|
||||||
protected requestService: RequestService) {
|
protected requestService: RequestService) {
|
||||||
super(WorkspaceItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
super(WorkspaceItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,4 +86,11 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent<Work
|
|||||||
this.object = object;
|
this.object = object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the workflowitem view route.
|
||||||
|
*/
|
||||||
|
getWorkspaceItemViewRoute(workspaceItem: WorkspaceItem): string {
|
||||||
|
return getWorkspaceItemViewRoute(workspaceItem?.id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
53
src/app/shared/numeric.util.spec.ts
Normal file
53
src/app/shared/numeric.util.spec.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { isNumeric } from './numeric.util';
|
||||||
|
|
||||||
|
describe('Numeric Utils', () => {
|
||||||
|
describe('isNumeric', () => {
|
||||||
|
it('should return true for Number values', () => {
|
||||||
|
expect(isNumeric(0)).toBeTrue();
|
||||||
|
expect(isNumeric(123456)).toBeTrue();
|
||||||
|
expect(isNumeric(-123456)).toBeTrue();
|
||||||
|
expect(isNumeric(0.1234)).toBeTrue();
|
||||||
|
expect(isNumeric(-0.1234)).toBeTrue();
|
||||||
|
expect(isNumeric(1234e56)).toBeTrue();
|
||||||
|
expect(isNumeric(-1234e-56)).toBeTrue();
|
||||||
|
expect(isNumeric(0x123456)).toBeTrue();
|
||||||
|
expect(isNumeric(-0x123456)).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true for numeric String values', () => {
|
||||||
|
expect(isNumeric('0')).toBeTrue();
|
||||||
|
expect(isNumeric('123456')).toBeTrue();
|
||||||
|
expect(isNumeric('-123456')).toBeTrue();
|
||||||
|
expect(isNumeric('0.1234')).toBeTrue();
|
||||||
|
expect(isNumeric('-0.1234')).toBeTrue();
|
||||||
|
expect(isNumeric('1234e56')).toBeTrue();
|
||||||
|
expect(isNumeric('-1234e-56')).toBeTrue();
|
||||||
|
expect(isNumeric('0x123456')).toBeTrue();
|
||||||
|
|
||||||
|
// expect(isNumeric('-0x123456')).toBeTrue(); // not recognized as numeric, known issue
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for non-numeric String values', () => {
|
||||||
|
expect(isNumeric('just a regular string')).toBeFalse();
|
||||||
|
expect(isNumeric('')).toBeFalse();
|
||||||
|
expect(isNumeric(' ')).toBeFalse();
|
||||||
|
expect(isNumeric('\n')).toBeFalse();
|
||||||
|
expect(isNumeric('\t')).toBeFalse();
|
||||||
|
expect(isNumeric('null')).toBeFalse();
|
||||||
|
expect(isNumeric('undefined')).toBeFalse();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for any other kind of value', () => {
|
||||||
|
expect(isNumeric([1,2,3])).toBeFalse();
|
||||||
|
expect(isNumeric({ a:1, b:2, c:3 })).toBeFalse();
|
||||||
|
expect(isNumeric(() => { /* empty */ })).toBeFalse();
|
||||||
|
expect(isNumeric(null)).toBeFalse();
|
||||||
|
expect(isNumeric(undefined)).toBeFalse();
|
||||||
|
expect(isNumeric(true)).toBeFalse();
|
||||||
|
expect(isNumeric(false)).toBeFalse();
|
||||||
|
expect(isNumeric(NaN)).toBeFalse();
|
||||||
|
expect(isNumeric(Infinity)).toBeFalse();
|
||||||
|
expect(isNumeric(-Infinity)).toBeFalse();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
16
src/app/shared/numeric.util.ts
Normal file
16
src/app/shared/numeric.util.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Whether a value is a Number or numeric string.
|
||||||
|
*
|
||||||
|
* Taken from RxJs 6.x (licensed under Apache 2.0)
|
||||||
|
* This function was removed from RxJs 7.x onwards.
|
||||||
|
*
|
||||||
|
* @param val: any value
|
||||||
|
* @returns whether this value is numeric
|
||||||
|
*/
|
||||||
|
export function isNumeric(val: any): val is number | string {
|
||||||
|
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
||||||
|
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
||||||
|
// subtraction forces infinities to NaN
|
||||||
|
// adding 1 corrects loss of precision from parseFloat (#15100)
|
||||||
|
return !Array.isArray(val) && (val - parseFloat(val) + 1) >= 0;
|
||||||
|
}
|
@@ -3,9 +3,12 @@ import { Component } from '@angular/core';
|
|||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
import {
|
||||||
|
MyDspaceItemStatusType
|
||||||
|
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders item object for the search result in the detail view.
|
* This component renders item object for the search result in the detail view.
|
||||||
@@ -16,7 +19,8 @@ import { ItemSearchResult } from '../../../object-collection/shared/item-search-
|
|||||||
templateUrl: './item-search-result-detail-element.component.html'
|
templateUrl: './item-search-result-detail-element.component.html'
|
||||||
})
|
})
|
||||||
|
|
||||||
@listableObjectComponent(Item, ViewMode.DetailedListElement)
|
@listableObjectComponent(ItemSearchResult, ViewMode.DetailedListElement, Context.Workspace)
|
||||||
|
@listableObjectComponent(ItemSearchResult, ViewMode.DetailedListElement, Context.Workflow)
|
||||||
export class ItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<ItemSearchResult, Item> {
|
export class ItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<ItemSearchResult, Item> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,6 +17,12 @@ import { PaginationService } from '../../../core/pagination/pagination.service';
|
|||||||
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import { LinkHeadService } from '../../../core/services/link-head.service';
|
||||||
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub';
|
||||||
|
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||||
|
|
||||||
describe('CollectionSelectComponent', () => {
|
describe('CollectionSelectComponent', () => {
|
||||||
let comp: CollectionSelectComponent;
|
let comp: CollectionSelectComponent;
|
||||||
@@ -44,6 +50,25 @@ describe('CollectionSelectComponent', () => {
|
|||||||
isAuthorized: observableOf(true)
|
isAuthorized: observableOf(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
const paginationService = new PaginationServiceStub();
|
const paginationService = new PaginationServiceStub();
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -53,7 +78,11 @@ describe('CollectionSelectComponent', () => {
|
|||||||
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockCollectionList[1].id]) },
|
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockCollectionList[1].id]) },
|
||||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationDataService }
|
{ provide: AuthorizationDataService, useValue: authorizationDataService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -18,6 +18,12 @@ import { PaginationService } from '../../../core/pagination/pagination.service';
|
|||||||
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||||
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
|
import { LinkHeadService } from '../../../core/services/link-head.service';
|
||||||
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub';
|
||||||
|
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||||
|
|
||||||
describe('ItemSelectComponent', () => {
|
describe('ItemSelectComponent', () => {
|
||||||
let comp: ItemSelectComponent;
|
let comp: ItemSelectComponent;
|
||||||
@@ -70,6 +76,24 @@ describe('ItemSelectComponent', () => {
|
|||||||
|
|
||||||
const authorizationDataService = new AuthorizationDataService(null, null, null, null, null, null, null, null, null, null);
|
const authorizationDataService = new AuthorizationDataService(null, null, null, null, null, null, null, null, null, null);
|
||||||
|
|
||||||
|
const linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -79,7 +103,11 @@ describe('ItemSelectComponent', () => {
|
|||||||
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockItemList[1].id]) },
|
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockItemList[1].id]) },
|
||||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationDataService }
|
{ provide: AuthorizationDataService, useValue: authorizationDataService },
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
<button class="dropdown-item" *ngFor="let direction of (sortDirections | dsKeys)" (click)="doSortDirectionChange(direction.value)"><i [ngClass]="{'invisible': direction.value !== (sortDirection$ |async)}" class="fas fa-check" aria-hidden="true"></i> {{'sorting.' + direction.key | translate}} </button>
|
<button class="dropdown-item" *ngFor="let direction of (sortDirections | dsKeys)" (click)="doSortDirectionChange(direction.value)"><i [ngClass]="{'invisible': direction.value !== (sortDirection$ |async)}" class="fas fa-check" aria-hidden="true"></i> {{'sorting.' + direction.key | translate}} </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ds-rss></ds-rss>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -61,7 +61,7 @@ export function createFailedRemoteDataObject<T>(errorMessage?: string, statusCod
|
|||||||
* @param timeCompleted the moment when the remoteData was completed
|
* @param timeCompleted the moment when the remoteData was completed
|
||||||
*/
|
*/
|
||||||
export function createFailedRemoteDataObject$<T>(errorMessage?: string, statusCode?: number, timeCompleted?: number): Observable<RemoteData<T>> {
|
export function createFailedRemoteDataObject$<T>(errorMessage?: string, statusCode?: number, timeCompleted?: number): Observable<RemoteData<T>> {
|
||||||
return observableOf(createFailedRemoteDataObject(errorMessage, statusCode, timeCompleted));
|
return observableOf(createFailedRemoteDataObject<T>(errorMessage, statusCode, timeCompleted));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +85,7 @@ export function createPendingRemoteDataObject<T>(lastVerified = FIXED_TIMESTAMP)
|
|||||||
* @param lastVerified the moment when the remoteData was last verified
|
* @param lastVerified the moment when the remoteData was last verified
|
||||||
*/
|
*/
|
||||||
export function createPendingRemoteDataObject$<T>(lastVerified?: number): Observable<RemoteData<T>> {
|
export function createPendingRemoteDataObject$<T>(lastVerified?: number): Observable<RemoteData<T>> {
|
||||||
return observableOf(createPendingRemoteDataObject(lastVerified));
|
return observableOf(createPendingRemoteDataObject<T>(lastVerified));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
5
src/app/shared/rss-feed/rss.component.html
Normal file
5
src/app/shared/rss-feed/rss.component.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ng-container *ngIf="(isEnabled$ | async) && (hasRoute('home') || hasRoute('collections') || hasRoute('communities'))">
|
||||||
|
<div *ngIf="route$ | async as route" class="d-inline-block float-right margin-right">
|
||||||
|
<a [href]="route" class="btn btn-secondary" [title]="'feed.description' | translate" [attr.aria-label]="'feed.description' | translate"><i class="fas fa-rss-square"></i></a>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
12
src/app/shared/rss-feed/rss.component.scss
Normal file
12
src/app/shared/rss-feed/rss.component.scss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
:host {
|
||||||
|
.dropdown-toggle::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.dropdown-item {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.margin-right {
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
113
src/app/shared/rss-feed/rss.component.spec.ts
Normal file
113
src/app/shared/rss-feed/rss.component.spec.ts
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { Collection } from '../../core/shared/collection.model';
|
||||||
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
||||||
|
import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
|
||||||
|
import { PaginationServiceStub } from '../testing/pagination-service.stub';
|
||||||
|
import { createPaginatedList } from '../testing/utils.test';
|
||||||
|
import { RSSComponent } from './rss.component';
|
||||||
|
import { of as observableOf } from 'rxjs';
|
||||||
|
import { SearchConfigurationServiceStub } from '../testing/search-configuration-service.stub';
|
||||||
|
import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { RouterMock } from '../mocks/router.mock';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
describe('RssComponent', () => {
|
||||||
|
let comp: RSSComponent;
|
||||||
|
let options: SortOptions;
|
||||||
|
let fixture: ComponentFixture<RSSComponent>;
|
||||||
|
let uuid: string;
|
||||||
|
let query: string;
|
||||||
|
let groupDataService: GroupDataService;
|
||||||
|
let linkHeadService: LinkHeadService;
|
||||||
|
let configurationDataService: ConfigurationDataService;
|
||||||
|
let paginationService;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
const mockCollection: Collection = Object.assign(new Collection(), {
|
||||||
|
id: 'ce41d451-97ed-4a9c-94a1-7de34f16a9f4',
|
||||||
|
name: 'test-collection',
|
||||||
|
_links: {
|
||||||
|
mappedItems: {
|
||||||
|
href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4/mappedItems'
|
||||||
|
},
|
||||||
|
self: {
|
||||||
|
href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
configurationDataService = jasmine.createSpyObj('configurationDataService', {
|
||||||
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'test',
|
||||||
|
values: [
|
||||||
|
'org.dspace.ctask.general.ProfileFormats = test'
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
linkHeadService = jasmine.createSpyObj('linkHeadService', {
|
||||||
|
addTag: ''
|
||||||
|
});
|
||||||
|
const mockCollectionRD: RemoteData<Collection> = createSuccessfulRemoteDataObject(mockCollection);
|
||||||
|
const mockSearchOptions = observableOf(new PaginatedSearchOptions({
|
||||||
|
pagination: Object.assign(new PaginationComponentOptions(), {
|
||||||
|
id: 'search-page-configuration',
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1
|
||||||
|
}),
|
||||||
|
sort: new SortOptions('dc.title', SortDirection.ASC),
|
||||||
|
}));
|
||||||
|
groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
|
getGroupRegistryRouterLink: '',
|
||||||
|
getUUIDFromString: '',
|
||||||
|
});
|
||||||
|
paginationService = new PaginationServiceStub();
|
||||||
|
const searchConfigService = {
|
||||||
|
paginatedSearchOptions: mockSearchOptions
|
||||||
|
};
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
|
{ provide: LinkHeadService, useValue: linkHeadService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
|
{ provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() },
|
||||||
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
|
{ provide: Router, useValue: new RouterMock() }
|
||||||
|
],
|
||||||
|
declarations: [RSSComponent]
|
||||||
|
}).compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
options = new SortOptions('dc.title', SortDirection.DESC);
|
||||||
|
uuid = '2cfcf65e-0a51-4bcb-8592-b8db7b064790';
|
||||||
|
query = 'test';
|
||||||
|
fixture = TestBed.createComponent(RSSComponent);
|
||||||
|
comp = fixture.componentInstance;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should formulate the correct url given params in url', () => {
|
||||||
|
const route = comp.formulateRoute(uuid, 'opensearch', options, query);
|
||||||
|
expect(route).toBe('/opensearch/search?format=atom&scope=2cfcf65e-0a51-4bcb-8592-b8db7b064790&sort=dc.title&sort_direction=DESC&query=test');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should skip uuid if its null', () => {
|
||||||
|
const route = comp.formulateRoute(null, 'opensearch', options, query);
|
||||||
|
expect(route).toBe('/opensearch/search?format=atom&sort=dc.title&sort_direction=DESC&query=test');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should default to query * if none provided', () => {
|
||||||
|
const route = comp.formulateRoute(null, 'opensearch', options, null);
|
||||||
|
expect(route).toBe('/opensearch/search?format=atom&sort=dc.title&sort_direction=DESC&query=*');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
163
src/app/shared/rss-feed/rss.component.ts
Normal file
163
src/app/shared/rss-feed/rss.component.ts
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
import {
|
||||||
|
ChangeDetectionStrategy,
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
ViewEncapsulation
|
||||||
|
} from '@angular/core';
|
||||||
|
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
||||||
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
|
import { LinkHeadService } from '../../core/services/link-head.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
|
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||||
|
import { environment } from '../../../../src/environments/environment';
|
||||||
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
|
import { SortOptions } from '../../core/cache/models/sort-options.model';
|
||||||
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
|
import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model';
|
||||||
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Rss feed button componenet.
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
exportAs: 'rssComponent',
|
||||||
|
selector: 'ds-rss',
|
||||||
|
styleUrls: ['rss.component.scss'],
|
||||||
|
templateUrl: 'rss.component.html',
|
||||||
|
changeDetection: ChangeDetectionStrategy.Default,
|
||||||
|
encapsulation: ViewEncapsulation.Emulated
|
||||||
|
})
|
||||||
|
export class RSSComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
route$: BehaviorSubject<string>;
|
||||||
|
|
||||||
|
isEnabled$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null);
|
||||||
|
|
||||||
|
uuid: string;
|
||||||
|
configuration$: Observable<string>;
|
||||||
|
sortOption$: Observable<SortOptions>;
|
||||||
|
|
||||||
|
subs: Subscription[] = [];
|
||||||
|
|
||||||
|
constructor(private groupDataService: GroupDataService,
|
||||||
|
private linkHeadService: LinkHeadService,
|
||||||
|
private configurationService: ConfigurationDataService,
|
||||||
|
private searchConfigurationService: SearchConfigurationService,
|
||||||
|
private router: Router,
|
||||||
|
protected paginationService: PaginationService) {
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Removes the linktag created when the component gets removed from the page.
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.linkHeadService.removeTag("rel='alternate'");
|
||||||
|
this.subs.forEach(sub => {
|
||||||
|
sub.unsubscribe();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the link tags and the url to opensearch when the component is loaded.
|
||||||
|
*/
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.configuration$ = this.searchConfigurationService.getCurrentConfiguration('default');
|
||||||
|
|
||||||
|
this.subs.push(this.configurationService.findByPropertyName('websvc.opensearch.enable').pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
).subscribe((result) => {
|
||||||
|
if (result.hasSucceeded) {
|
||||||
|
const enabled = (result.payload.values[0] === 'true');
|
||||||
|
this.isEnabled$.next(enabled);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
this.subs.push(this.configurationService.findByPropertyName('websvc.opensearch.svccontext').pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
map((result: RemoteData<any>) => {
|
||||||
|
if (result.hasSucceeded) {
|
||||||
|
return result.payload.values[0];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}),
|
||||||
|
switchMap((openSearchUri: string) =>
|
||||||
|
this.searchConfigurationService.paginatedSearchOptions.pipe(
|
||||||
|
map((searchOptions: PaginatedSearchOptions) => ({ openSearchUri, searchOptions }))
|
||||||
|
)
|
||||||
|
),
|
||||||
|
).subscribe(({ openSearchUri, searchOptions }) => {
|
||||||
|
if (!openSearchUri) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
this.uuid = this.groupDataService.getUUIDFromString(this.router.url);
|
||||||
|
const route = environment.rest.baseUrl + this.formulateRoute(this.uuid, openSearchUri, searchOptions.sort, searchOptions.query);
|
||||||
|
this.addLinks(route);
|
||||||
|
this.linkHeadService.addTag({
|
||||||
|
href: environment.rest.baseUrl + '/' + openSearchUri + '/service',
|
||||||
|
type: 'application/atom+xml',
|
||||||
|
rel: 'search',
|
||||||
|
title: 'Dspace'
|
||||||
|
});
|
||||||
|
this.route$ = new BehaviorSubject<string>(route);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function created a route given the different params available to opensearch
|
||||||
|
* @param uuid The uuid if a scope is present
|
||||||
|
* @param opensearch openSearch uri
|
||||||
|
* @param sort The sort options for the opensearch request
|
||||||
|
* @param query The query string that was provided in the search
|
||||||
|
* @returns The combine URL to opensearch
|
||||||
|
*/
|
||||||
|
formulateRoute(uuid: string, opensearch: string, sort: SortOptions, query: string): string {
|
||||||
|
let route = 'search?format=atom';
|
||||||
|
if (uuid) {
|
||||||
|
route += `&scope=${uuid}`;
|
||||||
|
}
|
||||||
|
if (sort && sort.direction && sort.field && sort.field !== 'id') {
|
||||||
|
route += `&sort=${sort.field}&sort_direction=${sort.direction}`;
|
||||||
|
}
|
||||||
|
if (query) {
|
||||||
|
route += `&query=${query}`;
|
||||||
|
} else {
|
||||||
|
route += `&query=*`;
|
||||||
|
}
|
||||||
|
route = '/' + opensearch + '/' + route;
|
||||||
|
return route;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the router url contains the specified route
|
||||||
|
*
|
||||||
|
* @param {string} route
|
||||||
|
* @returns
|
||||||
|
* @memberof MyComponent
|
||||||
|
*/
|
||||||
|
hasRoute(route: string) {
|
||||||
|
return this.router.url.includes(route);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates <link> tags in the header of the page
|
||||||
|
* @param route The composed url to opensearch
|
||||||
|
*/
|
||||||
|
addLinks(route: string): void {
|
||||||
|
this.linkHeadService.addTag({
|
||||||
|
href: route,
|
||||||
|
type: 'application/atom+xml',
|
||||||
|
rel: 'alternate',
|
||||||
|
title: 'Sitewide Atom feed'
|
||||||
|
});
|
||||||
|
route = route.replace('format=atom', 'format=rss');
|
||||||
|
this.linkHeadService.addTag({
|
||||||
|
href: route,
|
||||||
|
type: 'application/rss+xml',
|
||||||
|
rel: 'alternate',
|
||||||
|
title: 'Sitewide RSS feed'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@@ -13,7 +13,9 @@ import { SearchConfigurationService } from '../../core/shared/search/search-conf
|
|||||||
import { PaginationServiceStub } from '../testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../testing/pagination-service.stub';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { SearchServiceStub } from '../testing/search-service.stub';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { RouterStub } from '../testing/router.stub';
|
||||||
|
|
||||||
describe('SearchFormComponent', () => {
|
describe('SearchFormComponent', () => {
|
||||||
let comp: SearchFormComponent;
|
let comp: SearchFormComponent;
|
||||||
@@ -21,21 +23,23 @@ describe('SearchFormComponent', () => {
|
|||||||
let de: DebugElement;
|
let de: DebugElement;
|
||||||
let el: HTMLElement;
|
let el: HTMLElement;
|
||||||
|
|
||||||
|
const router = new RouterStub();
|
||||||
|
const searchService = new SearchServiceStub();
|
||||||
const paginationService = new PaginationServiceStub();
|
const paginationService = new PaginationServiceStub();
|
||||||
|
const searchConfigService = { paginationID: 'test-id' };
|
||||||
const searchConfigService = {paginationID: 'test-id'};
|
const dspaceObjectService = {
|
||||||
|
findById: () => createSuccessfulRemoteDataObject$(undefined),
|
||||||
|
};
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot()],
|
imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot()],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{ provide: Router, useValue: router },
|
||||||
provide: SearchService,
|
{ provide: SearchService, useValue: searchService },
|
||||||
useValue: {}
|
|
||||||
},
|
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: SearchConfigurationService, useValue: searchConfigService },
|
{ provide: SearchConfigurationService, useValue: searchConfigService },
|
||||||
{ provide: DSpaceObjectDataService, useValue: { findById: () => createSuccessfulRemoteDataObject$(undefined)} }
|
{ provide: DSpaceObjectDataService, useValue: dspaceObjectService },
|
||||||
],
|
],
|
||||||
declarations: [SearchFormComponent]
|
declarations: [SearchFormComponent]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
@@ -90,6 +94,81 @@ describe('SearchFormComponent', () => {
|
|||||||
|
|
||||||
expect(scopeSelect.textContent).toBe(testCommunity.name);
|
expect(scopeSelect.textContent).toBe(testCommunity.name);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
describe('updateSearch', () => {
|
||||||
|
const query = 'THOR';
|
||||||
|
const scope = 'MCU';
|
||||||
|
let searchQuery = {};
|
||||||
|
|
||||||
|
it('should navigate to the search page even when no parameters are provided', () => {
|
||||||
|
comp.updateSearch(searchQuery);
|
||||||
|
|
||||||
|
expect(router.navigate).toHaveBeenCalledWith(comp.getSearchLinkParts(), {
|
||||||
|
queryParams: searchQuery,
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should navigate to the search page with parameters only query if only query is provided', () => {
|
||||||
|
searchQuery = {
|
||||||
|
query: query
|
||||||
|
};
|
||||||
|
|
||||||
|
comp.updateSearch(searchQuery);
|
||||||
|
|
||||||
|
expect(router.navigate).toHaveBeenCalledWith(comp.getSearchLinkParts(), {
|
||||||
|
queryParams: searchQuery,
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should navigate to the search page with parameters only query if only scope is provided', () => {
|
||||||
|
searchQuery = {
|
||||||
|
scope: scope
|
||||||
|
};
|
||||||
|
|
||||||
|
comp.updateSearch(searchQuery);
|
||||||
|
|
||||||
|
expect(router.navigate).toHaveBeenCalledWith(comp.getSearchLinkParts(), {
|
||||||
|
queryParams: searchQuery,
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the scope variable is used', () => {
|
||||||
|
const query = 'THOR';
|
||||||
|
const scope = 'MCU';
|
||||||
|
let searchQuery = {};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
spyOn(comp, 'updateSearch');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should only search in the provided scope', () => {
|
||||||
|
searchQuery = {
|
||||||
|
query: query,
|
||||||
|
scope: scope
|
||||||
|
};
|
||||||
|
|
||||||
|
comp.scope = scope;
|
||||||
|
comp.onSubmit(searchQuery);
|
||||||
|
|
||||||
|
expect(comp.updateSearch).toHaveBeenCalledWith(searchQuery);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not create searchQuery with the scope if an empty scope is provided', () => {
|
||||||
|
searchQuery = {
|
||||||
|
query: query
|
||||||
|
};
|
||||||
|
|
||||||
|
comp.scope = '';
|
||||||
|
comp.onSubmit(searchQuery);
|
||||||
|
|
||||||
|
expect(comp.updateSearch).toHaveBeenCalledWith(searchQuery);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// it('should call updateSearch when clicking the submit button with correct parameters', fakeAsync(() => {
|
// it('should call updateSearch when clicking the submit button with correct parameters', fakeAsync(() => {
|
||||||
// comp.query = 'Test String'
|
// comp.query = 'Test String'
|
||||||
// fixture.detectChanges();
|
// fixture.detectChanges();
|
||||||
@@ -112,7 +191,7 @@ describe('SearchFormComponent', () => {
|
|||||||
//
|
//
|
||||||
// expect(comp.updateSearch).toHaveBeenCalledWith({ scope: scope, query: query });
|
// expect(comp.updateSearch).toHaveBeenCalledWith({ scope: scope, query: query });
|
||||||
// }));
|
// }));
|
||||||
});
|
});
|
||||||
|
|
||||||
export const objects: DSpaceObject[] = [
|
export const objects: DSpaceObject[] = [
|
||||||
Object.assign(new Community(), {
|
Object.assign(new Community(), {
|
||||||
|
@@ -98,6 +98,9 @@ export class SearchFormComponent implements OnInit {
|
|||||||
* @param data Values submitted using the form
|
* @param data Values submitted using the form
|
||||||
*/
|
*/
|
||||||
onSubmit(data: any) {
|
onSubmit(data: any) {
|
||||||
|
if (isNotEmpty(this.scope)) {
|
||||||
|
data = Object.assign(data, { scope: this.scope });
|
||||||
|
}
|
||||||
this.updateSearch(data);
|
this.updateSearch(data);
|
||||||
this.submitSearch.emit(data);
|
this.submitSearch.emit(data);
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ describe('SearchFiltersComponent', () => {
|
|||||||
|
|
||||||
expect(comp.initFilters).toHaveBeenCalledTimes(1);
|
expect(comp.initFilters).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
refreshFiltersEmitter.next();
|
refreshFiltersEmitter.next(null);
|
||||||
|
|
||||||
expect(comp.initFilters).toHaveBeenCalledTimes(2);
|
expect(comp.initFilters).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
@@ -173,10 +173,10 @@ import { BitstreamRequestACopyPageComponent } from './bitstream-request-a-copy-p
|
|||||||
import { DsSelectComponent } from './ds-select/ds-select.component';
|
import { DsSelectComponent } from './ds-select/ds-select.component';
|
||||||
import { LogInOidcComponent } from './log-in/methods/oidc/log-in-oidc.component';
|
import { LogInOidcComponent } from './log-in/methods/oidc/log-in-oidc.component';
|
||||||
import { ThemedItemListPreviewComponent } from './object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component';
|
import { ThemedItemListPreviewComponent } from './object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component';
|
||||||
|
import { RSSComponent } from './rss-feed/rss.component';
|
||||||
import { ExternalLinkMenuItemComponent } from './menu/menu-item/external-link-menu-item.component';
|
import { ExternalLinkMenuItemComponent } from './menu/menu-item/external-link-menu-item.component';
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
SortablejsModule,
|
SortablejsModule,
|
||||||
FileUploadModule,
|
FileUploadModule,
|
||||||
@@ -239,6 +239,7 @@ const COMPONENTS = [
|
|||||||
AbstractListableElementComponent,
|
AbstractListableElementComponent,
|
||||||
ObjectCollectionComponent,
|
ObjectCollectionComponent,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
|
RSSComponent,
|
||||||
SearchFormComponent,
|
SearchFormComponent,
|
||||||
PageWithSidebarComponent,
|
PageWithSidebarComponent,
|
||||||
SidebarDropdownComponent,
|
SidebarDropdownComponent,
|
||||||
|
@@ -17,6 +17,10 @@ export class SearchConfigurationServiceStub {
|
|||||||
return observableOf('test-id');
|
return observableOf('test-id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCurrentQuery(a) {
|
||||||
|
return observableOf(a);
|
||||||
|
}
|
||||||
|
|
||||||
getCurrentConfiguration(a) {
|
getCurrentConfiguration(a) {
|
||||||
return observableOf(a);
|
return observableOf(a);
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ export class VocabularyTreeFlatDataSource<T, F> extends DataSource<F> {
|
|||||||
this._treeControl.expansionModel.changed,
|
this._treeControl.expansionModel.changed,
|
||||||
this._flattenedData
|
this._flattenedData
|
||||||
];
|
];
|
||||||
return merge(...changes).pipe(map(() => {
|
return merge<any>(...changes).pipe(map((): F[] => {
|
||||||
this._expandedData.next(
|
this._expandedData.next(
|
||||||
this._treeFlattener.expandFlattenedNodes(this._flattenedData.value, this._treeControl));
|
this._treeFlattener.expandFlattenedNodes(this._flattenedData.value, this._treeControl));
|
||||||
return this._expandedData.value;
|
return this._expandedData.value;
|
||||||
|
@@ -2,7 +2,7 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
|
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { getTestScheduler, hot } from 'jasmine-marbles';
|
import { cold, getTestScheduler, hot } from 'jasmine-marbles';
|
||||||
|
|
||||||
import { VocabularyTreeviewService } from './vocabulary-treeview.service';
|
import { VocabularyTreeviewService } from './vocabulary-treeview.service';
|
||||||
import { VocabularyService } from '../../core/submission/vocabularies/vocabulary.service';
|
import { VocabularyService } from '../../core/submission/vocabularies/vocabulary.service';
|
||||||
@@ -14,6 +14,8 @@ import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models
|
|||||||
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
||||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||||
|
import { expand, map, switchMap } from 'rxjs/operators';
|
||||||
|
import { from as observableFrom } from 'rxjs';
|
||||||
|
|
||||||
describe('VocabularyTreeviewService test suite', () => {
|
describe('VocabularyTreeviewService test suite', () => {
|
||||||
|
|
||||||
@@ -320,10 +322,25 @@ describe('VocabularyTreeviewService test suite', () => {
|
|||||||
scheduler.schedule(() => service.searchByQuery(vocabularyOptions));
|
scheduler.schedule(() => service.searchByQuery(vocabularyOptions));
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
|
|
||||||
searchChildNode.childrenChange.next([searchChildNode3]);
|
// We can't check the tree by comparing root TreeviewNodes directly in this particular test;
|
||||||
searchItemNode.childrenChange.next([searchChildNode]);
|
// Since RxJs 7, BehaviorSubjects can no longer be reliably compared because of the new currentObservers property
|
||||||
expect(serviceAsAny.dataChange.value.length).toEqual(1);
|
// (see https://github.com/ReactiveX/rxjs/pull/6842)
|
||||||
expect(serviceAsAny.dataChange.value).toEqual([searchItemNode]);
|
const levels$ = serviceAsAny.dataChange.pipe(
|
||||||
|
expand((nodes: TreeviewNode[]) => { // recursively apply:
|
||||||
|
return observableFrom(nodes).pipe( // for each node in the array...
|
||||||
|
switchMap(node => node.childrenChange) // ...map it to the array its child nodes.
|
||||||
|
); // because we only have one child per node in this case,
|
||||||
|
}), // this results in an array of nodes for each level of the tree.
|
||||||
|
map((nodes: TreeviewNode[]) => nodes.map(node => node.item)), // finally, replace nodes with their vocab entries
|
||||||
|
);
|
||||||
|
|
||||||
|
// Confirm that this corresponds to the hierarchy we set up above
|
||||||
|
expect(levels$).toBeObservable(cold('-(abcd)', {
|
||||||
|
a: [item],
|
||||||
|
b: [child],
|
||||||
|
c: [child3],
|
||||||
|
d: [] // ensure that grandchild has no children & the recursion stopped there
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { GoogleAnalyticsService } from './google-analytics.service';
|
import { GoogleAnalyticsService } from './google-analytics.service';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
import { ConfigurationDataService } from '../core/data/configuration-data.service';
|
import { ConfigurationDataService } from '../core/data/configuration-data.service';
|
||||||
import {
|
import {
|
||||||
createFailedRemoteDataObject$,
|
createFailedRemoteDataObject$,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
import { ConfigurationDataService } from '../core/data/configuration-data.service';
|
import { ConfigurationDataService } from '../core/data/configuration-data.service';
|
||||||
import { getFirstCompletedRemoteData } from '../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../core/shared/operators';
|
||||||
import { isEmpty } from '../shared/empty.util';
|
import { isEmpty } from '../shared/empty.util';
|
||||||
|
@@ -64,14 +64,24 @@ describe('SubmissionImportExternalCollectionComponent test suite', () => {
|
|||||||
compAsAny = null;
|
compAsAny = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('The variable \'selectedEvent\' should be assigned', () => {
|
it('should emit from selectedEvent on selectObject', () => {
|
||||||
const event = new EventEmitter<CollectionListEntry>();
|
spyOn(comp.selectedEvent, 'emit').and.callThrough();
|
||||||
comp.selectObject(event);
|
|
||||||
|
|
||||||
expect(comp.selectedEvent).toEqual(event);
|
const entry = {
|
||||||
|
communities: [
|
||||||
|
{ id: 'community1' },
|
||||||
|
{ id: 'community2' }
|
||||||
|
],
|
||||||
|
collection: {
|
||||||
|
id: 'collection'
|
||||||
|
}
|
||||||
|
} as CollectionListEntry;
|
||||||
|
comp.selectObject(entry);
|
||||||
|
|
||||||
|
expect(comp.selectedEvent.emit).toHaveBeenCalledWith(entry);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('The variable \'selectedEvent\' should be assigned', () => {
|
it('should dismiss modal on closeCollectionModal', () => {
|
||||||
spyOn(compAsAny.activeModal, 'dismiss');
|
spyOn(compAsAny.activeModal, 'dismiss');
|
||||||
comp.closeCollectionModal();
|
comp.closeCollectionModal();
|
||||||
|
|
||||||
|
@@ -35,10 +35,10 @@ export class SubmissionImportExternalCollectionComponent {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method populates the 'selectedEvent' variable.
|
* This method emits the selected Collection from the 'selectedEvent' variable.
|
||||||
*/
|
*/
|
||||||
public selectObject(event): void {
|
public selectObject(object: CollectionListEntry): void {
|
||||||
this.selectedEvent.emit(event);
|
this.selectedEvent.emit(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,43 +1,21 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
import { Resolve } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { Item } from '../core/shared/item.model';
|
import { Item } from '../core/shared/item.model';
|
||||||
import { followLink } from '../shared/utils/follow-link-config.model';
|
|
||||||
import { getFirstCompletedRemoteData } from '../core/shared/operators';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
||||||
import { WorkflowItem } from '../core/submission/models/workflowitem.model';
|
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
||||||
import { switchMap } from 'rxjs/operators';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a resolver that requests a specific item before the route is activated
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ItemFromWorkflowResolver implements Resolve<RemoteData<Item>> {
|
export class ItemFromWorkflowResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
||||||
constructor(
|
constructor(
|
||||||
private workflowItemService: WorkflowItemDataService,
|
private workflowItemService: WorkflowItemDataService,
|
||||||
protected store: Store<any>
|
protected store: Store<any>
|
||||||
) {
|
) {
|
||||||
|
super(workflowItemService, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method for resolving an item based on the parameters in the current route
|
|
||||||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
|
||||||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
|
||||||
* @returns Observable<<RemoteData<Item>> Emits the found item based on the parameters in the current route,
|
|
||||||
* or an error if something went wrong
|
|
||||||
*/
|
|
||||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<Item>> {
|
|
||||||
const itemRD$ = this.workflowItemService.findById(route.params.id,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
followLink('item'),
|
|
||||||
).pipe(
|
|
||||||
getFirstCompletedRemoteData(),
|
|
||||||
switchMap((wfiRD: RemoteData<WorkflowItem>) => wfiRD.payload.item as Observable<RemoteData<Item>>),
|
|
||||||
getFirstCompletedRemoteData()
|
|
||||||
);
|
|
||||||
return itemRD$;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,36 @@
|
|||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
|
||||||
|
import { ItemFromWorkspaceResolver } from './item-from-workspace.resolver';
|
||||||
|
|
||||||
|
describe('ItemFromWorkspaceResolver', () => {
|
||||||
|
describe('resolve', () => {
|
||||||
|
let resolver: ItemFromWorkspaceResolver;
|
||||||
|
let wfiService: WorkspaceitemDataService;
|
||||||
|
const uuid = '1234-65487-12354-1235';
|
||||||
|
const itemUuid = '8888-8888-8888-8888';
|
||||||
|
const wfi = {
|
||||||
|
id: uuid,
|
||||||
|
item: createSuccessfulRemoteDataObject$({ id: itemUuid })
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wfiService = {
|
||||||
|
findById: (id: string) => createSuccessfulRemoteDataObject$(wfi)
|
||||||
|
} as any;
|
||||||
|
resolver = new ItemFromWorkspaceResolver(wfiService, null);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should resolve a an item from from the workflow item with the correct id', (done) => {
|
||||||
|
resolver.resolve({ params: { id: uuid } } as any, undefined)
|
||||||
|
.pipe(first())
|
||||||
|
.subscribe(
|
||||||
|
(resolved) => {
|
||||||
|
expect(resolved.payload.id).toEqual(itemUuid);
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,21 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Resolve } from '@angular/router';
|
||||||
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
|
import { Item } from '../core/shared/item.model';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
||||||
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class ItemFromWorkspaceResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
||||||
|
constructor(
|
||||||
|
private workspaceItemService: WorkspaceitemDataService,
|
||||||
|
protected store: Store<any>
|
||||||
|
) {
|
||||||
|
super(workspaceItemService, store);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
||||||
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
|
||||||
|
|
||||||
|
describe('WorkflowItemPageResolver', () => {
|
||||||
|
describe('resolve', () => {
|
||||||
|
let resolver: WorkspaceItemPageResolver;
|
||||||
|
let wsiService: WorkspaceitemDataService;
|
||||||
|
const uuid = '1234-65487-12354-1235';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wsiService = {
|
||||||
|
findById: (id: string) => createSuccessfulRemoteDataObject$({ id })
|
||||||
|
} as any;
|
||||||
|
resolver = new WorkspaceItemPageResolver(wsiService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should resolve a workspace item with the correct id', (done) => {
|
||||||
|
resolver.resolve({ params: { id: uuid } } as any, undefined)
|
||||||
|
.pipe(first())
|
||||||
|
.subscribe(
|
||||||
|
(resolved) => {
|
||||||
|
expect(resolved.payload.id).toEqual(uuid);
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,34 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
|
import { followLink } from '../shared/utils/follow-link-config.model';
|
||||||
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
import { WorkflowItem } from '../core/submission/models/workflowitem.model';
|
||||||
|
import { getFirstCompletedRemoteData } from '../core/shared/operators';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that requests a specific workflow item before the route is activated
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class WorkspaceItemPageResolver implements Resolve<RemoteData<WorkflowItem>> {
|
||||||
|
constructor(private workspaceItemService: WorkspaceitemDataService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for resolving a workflow item based on the parameters in the current route
|
||||||
|
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||||
|
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||||
|
* @returns Observable<<RemoteData<Item>> Emits the found workflow item based on the parameters in the current route,
|
||||||
|
* or an error if something went wrong
|
||||||
|
*/
|
||||||
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<WorkflowItem>> {
|
||||||
|
return this.workspaceItemService.findById(route.params.id,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
followLink('item'),
|
||||||
|
).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,8 @@
|
|||||||
|
import { getWorkspaceItemModuleRoute } from '../app-routing-paths';
|
||||||
|
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||||
|
|
||||||
|
export function getWorkspaceItemViewRoute(wfiId: string) {
|
||||||
|
return new URLCombiner(getWorkspaceItemModuleRoute(), wfiId, WORKSPACE_ITEM_VIEW_PATH).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
export const WORKSPACE_ITEM_VIEW_PATH = 'view';
|
@@ -4,22 +4,42 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||||
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
|
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
|
||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
|
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
||||||
|
import { ItemFromWorkspaceResolver } from './item-from-workspace.resolver';
|
||||||
|
import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
path: ':id',
|
||||||
path: ':id/edit',
|
resolve: { wsi: WorkspaceItemPageResolver },
|
||||||
component: ThemedSubmissionEditComponent,
|
children: [
|
||||||
resolve: {
|
{
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
canActivate: [AuthenticatedGuard],
|
||||||
},
|
path: 'edit',
|
||||||
data: { title: 'submission.edit.title', breadcrumbKey: 'submission.edit' }
|
component: ThemedSubmissionEditComponent,
|
||||||
|
resolve: {
|
||||||
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
|
},
|
||||||
|
data: { title: 'submission.edit.title', breadcrumbKey: 'submission.edit' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
canActivate: [AuthenticatedGuard],
|
||||||
|
path: 'view',
|
||||||
|
component: ThemedFullItemPageComponent,
|
||||||
|
resolve: {
|
||||||
|
dso: ItemFromWorkspaceResolver,
|
||||||
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
|
},
|
||||||
|
data: { title: 'workspace-item.view.title', breadcrumbKey: 'workspace-item.view' }
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
]
|
],
|
||||||
|
providers: [WorkspaceItemPageResolver, ItemFromWorkspaceResolver]
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* This module defines the default component to load when navigating to the workspaceitems edit page path
|
* This module defines the default component to load when navigating to the workspaceitems edit page path
|
||||||
|
@@ -548,6 +548,10 @@
|
|||||||
|
|
||||||
"admin.metadata-import.page.error.addFile": "Select file first!",
|
"admin.metadata-import.page.error.addFile": "Select file first!",
|
||||||
|
|
||||||
|
"admin.metadata-import.page.validateOnly": "Validate Only",
|
||||||
|
|
||||||
|
"admin.metadata-import.page.validateOnly.hint": "When selected, the uploaded CSV will be validated. You will receive a report of detected changes, but no changes will be saved.",
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1397,6 +1401,9 @@
|
|||||||
"error.validation.groupExists": "This group already exists",
|
"error.validation.groupExists": "This group already exists",
|
||||||
|
|
||||||
|
|
||||||
|
"feed.description": "Syndication feed",
|
||||||
|
|
||||||
|
|
||||||
"file-section.error.header": "Error obtaining files for this item",
|
"file-section.error.header": "Error obtaining files for this item",
|
||||||
|
|
||||||
|
|
||||||
@@ -4072,6 +4079,10 @@
|
|||||||
"submission.workflow.tasks.pool.show-detail": "Show detail",
|
"submission.workflow.tasks.pool.show-detail": "Show detail",
|
||||||
|
|
||||||
|
|
||||||
|
"submission.workspace.generic.view": "View",
|
||||||
|
|
||||||
|
"submission.workspace.generic.view-help": "Select this option to view the item's metadata.",
|
||||||
|
|
||||||
|
|
||||||
"thumbnail.default.alt": "Thumbnail Image",
|
"thumbnail.default.alt": "Thumbnail Image",
|
||||||
|
|
||||||
@@ -4178,6 +4189,9 @@
|
|||||||
|
|
||||||
"workflow-item.view.breadcrumbs": "Workflow View",
|
"workflow-item.view.breadcrumbs": "Workflow View",
|
||||||
|
|
||||||
|
"workspace-item.view.breadcrumbs": "Workspace View",
|
||||||
|
|
||||||
|
"workspace-item.view.title": "Workspace View",
|
||||||
|
|
||||||
"idle-modal.header": "Session will expire soon",
|
"idle-modal.header": "Session will expire soon",
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ import { DSpaceTransferState } from '../transfer-state/dspace-transfer-state.ser
|
|||||||
import { ClientCookieService } from '../../app/core/services/client-cookie.service';
|
import { ClientCookieService } from '../../app/core/services/client-cookie.service';
|
||||||
import { CookieService } from '../../app/core/services/cookie.service';
|
import { CookieService } from '../../app/core/services/cookie.service';
|
||||||
import { AuthService } from '../../app/core/auth/auth.service';
|
import { AuthService } from '../../app/core/auth/auth.service';
|
||||||
import { Angulartics2RouterlessModule } from 'angulartics2/routerlessmodule';
|
import { Angulartics2RouterlessModule } from 'angulartics2';
|
||||||
import { SubmissionService } from '../../app/submission/submission.service';
|
import { SubmissionService } from '../../app/submission/submission.service';
|
||||||
import { StatisticsModule } from '../../app/statistics/statistics.module';
|
import { StatisticsModule } from '../../app/statistics/statistics.module';
|
||||||
import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service';
|
import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service';
|
||||||
|
@@ -8,7 +8,7 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2';
|
||||||
|
|
||||||
import { AppComponent } from '../../app/app.component';
|
import { AppComponent } from '../../app/app.component';
|
||||||
|
|
||||||
|
73
yarn.lock
73
yarn.lock
@@ -1670,17 +1670,17 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.3.0"
|
tslib "^2.3.0"
|
||||||
|
|
||||||
"@ng-dynamic-forms/core@^14.0.1":
|
"@ng-dynamic-forms/core@^15.0.0":
|
||||||
version "14.0.1"
|
version "15.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@ng-dynamic-forms/core/-/core-14.0.1.tgz#e5815a7f67b4e23a5c726afd137b3e27afe09ab9"
|
resolved "https://registry.yarnpkg.com/@ng-dynamic-forms/core/-/core-15.0.0.tgz#674a88c253aa100b30144bf7ebf518e24b72f553"
|
||||||
integrity sha512-Pys4H0lSk2Ae8y80mRD4yZMTu+80DIOmf4B2L9fK2q/zYyxVSexu0DynDR8XApArXYU78EPsWnEwgNSWwX6RKw==
|
integrity sha512-JJ0w8WdOA+wsHyt/hwitGhv/e1j95/TlRS82vvZetP/Ip3kjvD/Ge8jbg4bEssIAXZjfBqS/Gy00Hxo4h57DgQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.0.0"
|
tslib "^2.0.0"
|
||||||
|
|
||||||
"@ng-dynamic-forms/ui-ng-bootstrap@^14.0.1":
|
"@ng-dynamic-forms/ui-ng-bootstrap@^15.0.0":
|
||||||
version "14.0.1"
|
version "15.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@ng-dynamic-forms/ui-ng-bootstrap/-/ui-ng-bootstrap-14.0.1.tgz#10f271b85eceadad02f616f752cf9806eb085106"
|
resolved "https://registry.yarnpkg.com/@ng-dynamic-forms/ui-ng-bootstrap/-/ui-ng-bootstrap-15.0.0.tgz#0ab5614bc2efccc4cddbb384865b66d4740bcd3d"
|
||||||
integrity sha512-Xf56kZBwM0vsRgEKcZvh8SsypCWcVTKeyq9id68+jQzH9/bQ+qriLBF35zDHrS9vJWmSufa5xqqRx/ycxhfpLw==
|
integrity sha512-b/+tOJxtDRMzoFA7KLA8JRxbAnXd8d8072/P6C+2xOMaG0Ttc1UUiNQOZ5w82y78nr0bZ63oFHSR0xzSVtMXnA==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.0.0"
|
tslib "^2.0.0"
|
||||||
|
|
||||||
@@ -2920,12 +2920,12 @@ angular-idle-preload@3.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/angular-idle-preload/-/angular-idle-preload-3.0.0.tgz#decace34d9fac1cb00000727a6dc5caafdb84e4d"
|
resolved "https://registry.yarnpkg.com/angular-idle-preload/-/angular-idle-preload-3.0.0.tgz#decace34d9fac1cb00000727a6dc5caafdb84e4d"
|
||||||
integrity sha512-W3P2m2B6MHdt1DVunH6H3VWkAZrG3ZwxGcPjedVvIyRhg/LmMtILoizHSxTXw3fsKIEdAPwGObXGpML9WD1jJA==
|
integrity sha512-W3P2m2B6MHdt1DVunH6H3VWkAZrG3ZwxGcPjedVvIyRhg/LmMtILoizHSxTXw3fsKIEdAPwGObXGpML9WD1jJA==
|
||||||
|
|
||||||
angulartics2@^10.0.0:
|
angulartics2@^12.0.0:
|
||||||
version "10.1.0"
|
version "12.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/angulartics2/-/angulartics2-10.1.0.tgz#2988f95f25cf6a8dd630d63ea604eb6643e076c3"
|
resolved "https://registry.yarnpkg.com/angulartics2/-/angulartics2-12.0.0.tgz#d9440ff98d133ae02d97b991a32a711a5b88559f"
|
||||||
integrity sha512-MnwQxRXJkfbBF7417Cs7L/SIuTRNWHCOBnGolZXHFz5ogw1e51KdCKUaUkfgBogR7JpXP279FU9UDkzerIS3xw==
|
integrity sha512-hNjvOp/IvKD00Ix3zRGfGJUwwOhSM5RFhvM/iSBH7dvJKavCBWbI464PWshjXfRBbruangPUbJGhSLnoENNtmg==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.0.0"
|
tslib "^2.3.0"
|
||||||
|
|
||||||
ansi-align@^3.0.0:
|
ansi-align@^3.0.0:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
@@ -4613,10 +4613,10 @@ custom-event@~1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425"
|
resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425"
|
||||||
integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=
|
integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=
|
||||||
|
|
||||||
cypress-axe@^0.13.0:
|
cypress-axe@^0.14.0:
|
||||||
version "0.13.0"
|
version "0.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-0.13.0.tgz#3234e1a79a27701f2451fcf2f333eb74204c7966"
|
resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-0.14.0.tgz#5f5e70fb36b8cb3ba73a8ba01e9262ff1268d5e2"
|
||||||
integrity sha512-fCIy7RiDCm7t30U3C99gGwQrUO307EYE1QqXNaf9ToK4DVqW8y5on+0a/kUHMrHdlls2rENF6TN9ZPpPpwLrnw==
|
integrity sha512-7Rdjnko0MjggCmndc1wECAkvQBIhuy+DRtjF7bd5YPZRFvubfMNvrxfqD8PWQmxm7MZE0ffS4Xr43V6ZmvLopg==
|
||||||
|
|
||||||
cypress@9.5.1:
|
cypress@9.5.1:
|
||||||
version "9.5.1"
|
version "9.5.1"
|
||||||
@@ -7536,12 +7536,12 @@ jasmine-core@~2.8.0:
|
|||||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
|
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
|
||||||
integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=
|
integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=
|
||||||
|
|
||||||
jasmine-marbles@0.6.0:
|
jasmine-marbles@0.9.2:
|
||||||
version "0.6.0"
|
version "0.9.2"
|
||||||
resolved "https://registry.yarnpkg.com/jasmine-marbles/-/jasmine-marbles-0.6.0.tgz#f78dc1a3bc452976de10ee8b47c73d616532a954"
|
resolved "https://registry.yarnpkg.com/jasmine-marbles/-/jasmine-marbles-0.9.2.tgz#5adfee5f72c7f24270687fa64a6e8a8613ffa841"
|
||||||
integrity sha512-1uzgjEesEeCb+r+v46qn5x326TiGqk5SUZa+A3O+XnMCjG/pGcUOhL9Xsg5L7gLC6RFHyWGTkB5fei4rcvIOiQ==
|
integrity sha512-T7RjG4fRsdiGGzbQZ6Kj39qYt6O1/KIcR4FkUNsD3DUGkd/AzpwzN+xtk0DXlLWEz5BaVdK1SzMgQDVw879c4Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
lodash "^4.5.0"
|
lodash "^4.17.20"
|
||||||
|
|
||||||
jasmine-spec-reporter@~5.0.0:
|
jasmine-spec-reporter@~5.0.0:
|
||||||
version "5.0.2"
|
version "5.0.2"
|
||||||
@@ -8211,7 +8211,7 @@ lodash.uniq@^4.5.0:
|
|||||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||||
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
||||||
|
|
||||||
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.5.0, lodash@^4.7.0:
|
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0:
|
||||||
version "4.17.21"
|
version "4.17.21"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||||
@@ -8853,12 +8853,12 @@ ngx-infinite-scroll@^10.0.1:
|
|||||||
"@scarf/scarf" "^1.1.0"
|
"@scarf/scarf" "^1.1.0"
|
||||||
opencollective-postinstall "^2.0.2"
|
opencollective-postinstall "^2.0.2"
|
||||||
|
|
||||||
ngx-mask@^12.0.0:
|
ngx-mask@^13.1.7:
|
||||||
version "12.0.0"
|
version "13.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/ngx-mask/-/ngx-mask-12.0.0.tgz#8eb363cc609ab71b687bbe6f87497c461ca120b1"
|
resolved "https://registry.yarnpkg.com/ngx-mask/-/ngx-mask-13.1.7.tgz#9ef40354a83484aaf77aff74742cd0f43b4a65cd"
|
||||||
integrity sha512-q4vUjhjJfg4faRud/tUdCTOs3JA6B+rBB2OPZ2xBZy4LNTRKGfUK683LrDCitMVBezjEAVrkQdUT1I4C7LXBZQ==
|
integrity sha512-zwGSEGt+WRlb31qMd92K25MCNUhfI2XKOMv+m5NypkZ+stONdBxAXjp8wA/1MJ46uYF5UYLmKPdkXloZBtOXQQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.1.0"
|
tslib "^2.3.0"
|
||||||
|
|
||||||
ngx-moment@^5.0.0:
|
ngx-moment@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.0"
|
||||||
@@ -11125,10 +11125,10 @@ rxjs-report-usage@^1.0.4:
|
|||||||
glob "~7.2.0"
|
glob "~7.2.0"
|
||||||
prompts "~2.4.2"
|
prompts "~2.4.2"
|
||||||
|
|
||||||
rxjs-spy@^7.5.3:
|
rxjs-spy@^8.0.2:
|
||||||
version "7.5.3"
|
version "8.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/rxjs-spy/-/rxjs-spy-7.5.3.tgz#0194bc23ed0c30fb6a61f8bccbc8090e545b91b9"
|
resolved "https://registry.yarnpkg.com/rxjs-spy/-/rxjs-spy-8.0.2.tgz#dd510bdb58d798e0bc23121ab67714dd6fd95f88"
|
||||||
integrity sha512-8QsSL6Ma51dTeaJ5Q9zWqhqnCSEkDf56Evs1gUsI9N22oB7bYrPMMx4UnoifNGc+Pko2sGX/xydzinLwGO+2pw==
|
integrity sha512-w2yc+EiwYA8J97hxqMD+pxGZkNbRCQwxR660r4nw4Soa8kCvatsdSRc0THndYk9uk6SvZy2RNyiVcxfX39pWpw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/circular-json" "^0.4.0"
|
"@types/circular-json" "^0.4.0"
|
||||||
"@types/stacktrace-js" "^0.0.33"
|
"@types/stacktrace-js" "^0.0.33"
|
||||||
@@ -11137,7 +11137,7 @@ rxjs-spy@^7.5.3:
|
|||||||
rxjs-report-usage "^1.0.4"
|
rxjs-report-usage "^1.0.4"
|
||||||
stacktrace-gps "^3.0.2"
|
stacktrace-gps "^3.0.2"
|
||||||
|
|
||||||
rxjs@6.6.7, rxjs@^6.5.4, rxjs@^6.5.5, rxjs@^6.6.3, rxjs@~6.6.0:
|
rxjs@6.6.7, rxjs@^6.5.4, rxjs@^6.5.5, rxjs@~6.6.0:
|
||||||
version "6.6.7"
|
version "6.6.7"
|
||||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
|
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
|
||||||
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
|
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
|
||||||
@@ -11158,6 +11158,13 @@ rxjs@^7.2.0, rxjs@^7.5.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.1.0"
|
tslib "^2.1.0"
|
||||||
|
|
||||||
|
rxjs@^7.5.5:
|
||||||
|
version "7.5.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f"
|
||||||
|
integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==
|
||||||
|
dependencies:
|
||||||
|
tslib "^2.1.0"
|
||||||
|
|
||||||
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||||
version "5.1.2"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||||
|
Reference in New Issue
Block a user