mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
taskid 66074 Keep virtual metadata on relationship delete - fix lint issues
This commit is contained in:
@@ -11,9 +11,9 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { FieldChangeType } from '../../../../core/data/object-updates/object-updates.actions';
|
import { FieldChangeType } from '../../../../core/data/object-updates/object-updates.actions';
|
||||||
import {NgbModal} from "@ng-bootstrap/ng-bootstrap";
|
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {Store} from "@ngrx/store";
|
import {Store} from '@ngrx/store';
|
||||||
import {CoreState} from "../../../../core/core.reducers";
|
import {CoreState} from '../../../../core/core.reducers';
|
||||||
|
|
||||||
let objectUpdatesService;
|
let objectUpdatesService;
|
||||||
const url = 'http://test-url.com/test-url';
|
const url = 'http://test-url.com/test-url';
|
||||||
|
@@ -9,7 +9,7 @@ import {
|
|||||||
SetEditableFieldUpdateAction, SetValidFieldUpdateAction
|
SetEditableFieldUpdateAction, SetValidFieldUpdateAction
|
||||||
} from './object-updates.actions';
|
} from './object-updates.actions';
|
||||||
import { OBJECT_UPDATES_TRASH_PATH, objectUpdatesReducer } from './object-updates.reducer';
|
import { OBJECT_UPDATES_TRASH_PATH, objectUpdatesReducer } from './object-updates.reducer';
|
||||||
import {Relationship} from "../../shared/item-relationships/relationship.model";
|
import {Relationship} from '../../shared/item-relationships/relationship.model';
|
||||||
|
|
||||||
class NullAction extends RemoveFieldUpdateAction {
|
class NullAction extends RemoveFieldUpdateAction {
|
||||||
type = null;
|
type = null;
|
||||||
@@ -45,7 +45,7 @@ const identifiable3 = {
|
|||||||
language: null,
|
language: null,
|
||||||
value: 'Unchanged value'
|
value: 'Unchanged value'
|
||||||
};
|
};
|
||||||
const relationship: Relationship = Object.assign(new Relationship, {uuid: 'test relationship uuid'});
|
const relationship: Relationship = Object.assign(new Relationship(), {uuid: 'test relationship uuid'});
|
||||||
|
|
||||||
const modDate = new Date(2010, 2, 11);
|
const modDate = new Date(2010, 2, 11);
|
||||||
const uuid = identifiable1.uuid;
|
const uuid = identifiable1.uuid;
|
||||||
|
@@ -11,7 +11,7 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Notification } from '../../../shared/notifications/models/notification.model';
|
import { Notification } from '../../../shared/notifications/models/notification.model';
|
||||||
import { NotificationType } from '../../../shared/notifications/models/notification-type';
|
import { NotificationType } from '../../../shared/notifications/models/notification-type';
|
||||||
import { OBJECT_UPDATES_TRASH_PATH } from './object-updates.reducer';
|
import { OBJECT_UPDATES_TRASH_PATH } from './object-updates.reducer';
|
||||||
import {Relationship} from "../../shared/item-relationships/relationship.model";
|
import {Relationship} from '../../shared/item-relationships/relationship.model';
|
||||||
|
|
||||||
describe('ObjectUpdatesService', () => {
|
describe('ObjectUpdatesService', () => {
|
||||||
let service: ObjectUpdatesService;
|
let service: ObjectUpdatesService;
|
||||||
@@ -23,7 +23,7 @@ describe('ObjectUpdatesService', () => {
|
|||||||
const identifiable2 = { uuid: '26cbb5ce-5786-4e57-a394-b9fcf8eaf241' };
|
const identifiable2 = { uuid: '26cbb5ce-5786-4e57-a394-b9fcf8eaf241' };
|
||||||
const identifiable3 = { uuid: 'c5d2c2f7-d757-48bf-84cc-8c9229c8407e' };
|
const identifiable3 = { uuid: 'c5d2c2f7-d757-48bf-84cc-8c9229c8407e' };
|
||||||
const identifiables = [identifiable1, identifiable2];
|
const identifiables = [identifiable1, identifiable2];
|
||||||
const relationship: Relationship = Object.assign(new Relationship, {uuid: 'test relationship uuid'});
|
const relationship: Relationship = Object.assign(new Relationship(), {uuid: 'test relationship uuid'});
|
||||||
|
|
||||||
const fieldUpdates = {
|
const fieldUpdates = {
|
||||||
[identifiable1.uuid]: { field: identifiable1Updated, changeType: FieldChangeType.UPDATE },
|
[identifiable1.uuid]: { field: identifiable1Updated, changeType: FieldChangeType.UPDATE },
|
||||||
@@ -44,7 +44,7 @@ describe('ObjectUpdatesService', () => {
|
|||||||
};
|
};
|
||||||
store = new Store<CoreState>(undefined, undefined, undefined);
|
store = new Store<CoreState>(undefined, undefined, undefined);
|
||||||
spyOn(store, 'dispatch');
|
spyOn(store, 'dispatch');
|
||||||
service = new ObjectUpdatesService(store);
|
service = (new ObjectUpdatesService(store));
|
||||||
|
|
||||||
spyOn(service as any, 'getObjectEntry').and.returnValue(observableOf(objectEntry));
|
spyOn(service as any, 'getObjectEntry').and.returnValue(observableOf(objectEntry));
|
||||||
spyOn(service as any, 'getFieldState').and.callFake((uuid) => {
|
spyOn(service as any, 'getFieldState').and.callFake((uuid) => {
|
||||||
|
Reference in New Issue
Block a user