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