mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Added more comments
This commit is contained in:
@@ -6,6 +6,9 @@ import { NormalizedSubmissionFormsModel } from './normalized-config-submission-f
|
||||
import { NormalizedSubmissionSectionModel } from './normalized-config-submission-section.model';
|
||||
import { NormalizedSubmissionUploadsModel } from './normalized-config-submission-uploads.model';
|
||||
|
||||
/**
|
||||
* Class to return normalized models for config objects
|
||||
*/
|
||||
export class ConfigObjectFactory {
|
||||
public static getConstructor(type): GenericConstructor<ConfigObject> {
|
||||
switch (type) {
|
||||
|
@@ -2,6 +2,9 @@ import { ServerResponseService } from '../shared/services/server-response.servic
|
||||
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
|
||||
import { AuthService } from '../core/auth/auth.service';
|
||||
|
||||
/**
|
||||
* This component representing the `PageNotFound` DSpace page.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-pagenotfound',
|
||||
styleUrls: ['./pagenotfound.component.scss'],
|
||||
@@ -9,10 +12,20 @@ import { AuthService } from '../core/auth/auth.service';
|
||||
changeDetection: ChangeDetectionStrategy.Default
|
||||
})
|
||||
export class PageNotFoundComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* Initialize instance variables
|
||||
*
|
||||
* @param {AuthService} authservice
|
||||
* @param {ServerResponseService} responseService
|
||||
*/
|
||||
constructor(private authservice: AuthService, private responseService: ServerResponseService) {
|
||||
this.responseService.setNotFound();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove redirect url from the state
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
this.authservice.clearRedirectUrl();
|
||||
}
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { SectionFormOperationsService } from '../../submission/sections/form/section-form-operations.service';
|
||||
|
||||
/**
|
||||
* Mock for [[FormOperationsService]]
|
||||
*/
|
||||
export function getMockFormOperationsService(): SectionFormOperationsService {
|
||||
return jasmine.createSpyObj('SectionFormOperationsService', {
|
||||
dispatchOperationsFromEvent: jasmine.createSpy('dispatchOperationsFromEvent'),
|
||||
|
@@ -2,6 +2,9 @@ import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { FormService } from '../form/form.service';
|
||||
|
||||
/**
|
||||
* Mock for [[FormService]]
|
||||
*/
|
||||
export function getMockFormService(
|
||||
id$: string = 'random_id'
|
||||
): FormService {
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
/**
|
||||
* Mock for [[RouterService]]
|
||||
*/
|
||||
export class MockRouter {
|
||||
public events = observableOf({});
|
||||
public routerState = {
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
|
||||
|
||||
/**
|
||||
* Mock for [[ScrollToService]]
|
||||
*/
|
||||
export function getMockScrollToService(): ScrollToService {
|
||||
return jasmine.createSpyObj('scrollToService', {
|
||||
scrollTo: jasmine.createSpy('scrollTo')
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { SubmissionFormsConfigService } from '../../core/config/submission-forms-config.service';
|
||||
|
||||
/**
|
||||
* Mock for [[SubmissionFormsConfigService]]
|
||||
*/
|
||||
export function getMockSectionUploadService(): SubmissionFormsConfigService {
|
||||
return jasmine.createSpyObj('SectionUploadService', {
|
||||
getUploadedFileList: jasmine.createSpy('getUploadedFileList'),
|
||||
|
Reference in New Issue
Block a user