Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Detection ported from DSpace CRIS 7 Angular #1732

Closed
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Item } from '../../shared/item.model';

export interface WorkspaceitemSectionDetectDuplicateObject {
matches: {
[itemId: string]: DetectDuplicateMatch;
};
}

export interface DetectDuplicateMatch {
submitterDecision?: string; // [reject|verify]
submitterNote?: string;
submitterTime?: string; // (readonly)

workflowDecision?: string; // [reject|verify]
workflowNote?: string;
workflowTime?: string; // (readonly)

adminDecision?: string;

matchObject?: Item;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { WorkspaceitemSectionLicenseObject } from './workspaceitem-section-licen
import { WorkspaceitemSectionUploadObject } from './workspaceitem-section-upload.model';
import { WorkspaceitemSectionCcLicenseObject } from './workspaceitem-section-cc-license.model';
import { WorkspaceitemSectionSherpaPoliciesObject } from './workspaceitem-section-sherpa-policies.model';
import { WorkspaceitemSectionDetectDuplicateObject } from './workspaceitem-section-deduplication.model';

/**
* An interface to represent submission's section object.
Expand All @@ -23,4 +24,5 @@ export type WorkspaceitemSectionDataType
| WorkspaceitemSectionCcLicenseObject
| WorkspaceitemSectionAccessesObject
| WorkspaceitemSectionSherpaPoliciesObject
| WorkspaceitemSectionDetectDuplicateObject
| string;
17 changes: 14 additions & 3 deletions src/app/my-dspace-page/my-dspace-search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ import { ResearchEntitiesModule } from '../entity-groups/research-entities/resea
import { ItemSubmitterComponent } from '../shared/object-collection/shared/mydspace-item-submitter/item-submitter.component';
import { ItemDetailPreviewComponent } from '../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component';
import { ItemDetailPreviewFieldComponent } from '../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component';
import { ItemListPreviewComponent } from '../shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component';
import { ThemedItemListPreviewComponent } from '../shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component';
//import { ItemListPreviewComponent } from '../shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component';
//import { ThemedItemListPreviewComponent } from '../shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component';
import { MyDSpaceItemStatusComponent } from '../shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component';
import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
import { MyDSpaceActionsModule } from '../shared/mydspace-actions/mydspace-actions.module';
import {
ThemedItemListPreviewComponent
} from '../shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component';
import {
ItemListPreviewComponent
} from '../shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component';

const ENTRY_COMPONENTS = [
WorkspaceItemSearchResultListElementComponent,
Expand All @@ -39,6 +45,8 @@ const ENTRY_COMPONENTS = [
ClaimedTaskSearchResultDetailElementComponent,
PoolSearchResultDetailElementComponent,
ItemSearchResultListElementSubmissionComponent,
//ItemListPreviewComponent,
//ThemedItemListPreviewComponent,
];

const DECLARATIONS = [
Expand All @@ -62,7 +70,10 @@ const DECLARATIONS = [
],
declarations: [
...DECLARATIONS,
]
],
exports: [
...DECLARATIONS,
]
})

/**
Expand Down
14 changes: 14 additions & 0 deletions src/app/shared/mocks/mock-detect-duplicate-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DetectDuplicateService } from '../../submission/sections/detect-duplicate/detect-duplicate.service';

/**
* Mock for [[DetectDuplicateService]]
*/
export function getMockDetectDuplicateService():
DetectDuplicateService {
return jasmine.createSpyObj('DetectDuplicateService', {
getDuplicateMatches: jasmine.createSpy('getDuplicateMatches'),
getDuplicateTotalMatches: jasmine.createSpy('getDuplicateTotalMatches'),
saveDuplicateDecision: jasmine.createSpy('saveDuplicateDecision'),
getDuplicateMatchesByScope: jasmine.createSpy('getDuplicateMatchesByScope'),
});
}
Loading