-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DURACOM-191] Fix issue with admin workflow page
- Loading branch information
Showing
12 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
src/app/admin/admin-notify-dashboard/models/admin-notify-message-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { SearchResult } from '../../../shared/search/models/search-result.model'; | ||
import { searchResultFor } from '../../../shared/search/search-result-element-decorator'; | ||
import { AdminNotifyMessage } from './admin-notify-message.model'; | ||
|
||
@searchResultFor(AdminNotifyMessage) | ||
export class AdminNotifySearchResult extends SearchResult<AdminNotifyMessage> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/claimed-task-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
/** | ||
* Represents a search result object of a ClaimedTask object | ||
*/ | ||
@searchResultFor(ClaimedTask) | ||
export class ClaimedTaskSearchResult extends SearchResult<ClaimedTask> { | ||
} |
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/collection-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { Collection } from '../../../core/shared/collection.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
@searchResultFor(Collection) | ||
export class CollectionSearchResult extends SearchResult<Collection> { | ||
} |
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/community-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { Community } from '../../../core/shared/community.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
@searchResultFor(Community) | ||
export class CommunitySearchResult extends SearchResult<Community> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/pool-task-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
/** | ||
* Represents a search result object of a PoolTask object | ||
*/ | ||
@searchResultFor(PoolTask) | ||
export class PoolTaskSearchResult extends SearchResult<PoolTask> { | ||
} |
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/workflow-item-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
/** | ||
* Represents a search result object of a WorkflowItem object | ||
*/ | ||
@searchResultFor(WorkflowItem) | ||
export class WorkflowItemSearchResult extends SearchResult<WorkflowItem> { | ||
} |
2 changes: 0 additions & 2 deletions
2
src/app/shared/object-collection/shared/workspace-item-search-result.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; | ||
import { SearchResult } from '../../search/models/search-result.model'; | ||
import { searchResultFor } from '../../search/search-result-element-decorator'; | ||
|
||
/** | ||
* Represents a search result object of a WorkspaceItem object | ||
*/ | ||
@searchResultFor(WorkspaceItem) | ||
export class WorkspaceItemSearchResult extends SearchResult<WorkspaceItem> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,42 @@ | ||
import { AdminNotifyMessage } from '../../admin/admin-notify-dashboard/models/admin-notify-message.model'; | ||
import { AdminNotifySearchResult } from '../../admin/admin-notify-dashboard/models/admin-notify-message-search-result.model'; | ||
import { Collection } from '../../core/shared/collection.model'; | ||
import { Community } from '../../core/shared/community.model'; | ||
import { GenericConstructor } from '../../core/shared/generic-constructor'; | ||
import { Item } from '../../core/shared/item.model'; | ||
import { WorkflowItem } from '../../core/submission/models/workflowitem.model'; | ||
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; | ||
import { ClaimedTask } from '../../core/tasks/models/claimed-task-object.model'; | ||
import { PoolTask } from '../../core/tasks/models/pool-task-object.model'; | ||
import { ClaimedTaskSearchResult } from '../object-collection/shared/claimed-task-search-result.model'; | ||
import { CollectionSearchResult } from '../object-collection/shared/collection-search-result.model'; | ||
import { CommunitySearchResult } from '../object-collection/shared/community-search-result.model'; | ||
import { ItemSearchResult } from '../object-collection/shared/item-search-result.model'; | ||
import { ListableObject } from '../object-collection/shared/listable-object.model'; | ||
import { PoolTaskSearchResult } from '../object-collection/shared/pool-task-search-result.model'; | ||
import { WorkflowItemSearchResult } from '../object-collection/shared/workflow-item-search-result.model'; | ||
import { WorkspaceItemSearchResult } from '../object-collection/shared/workspace-item-search-result.model'; | ||
|
||
/** | ||
* Contains the mapping between a search result component and a DSpaceObject | ||
*/ | ||
const searchResultMap = new Map(); | ||
export const SEARCH_RESULT_MAP = new Map<string| GenericConstructor<ListableObject>, GenericConstructor<ListableObject>>([ | ||
[AdminNotifyMessage, AdminNotifySearchResult], | ||
[ClaimedTask, ClaimedTaskSearchResult], | ||
[PoolTask, PoolTaskSearchResult], | ||
[Collection, CollectionSearchResult], | ||
[Community, CommunitySearchResult], | ||
[Item, ItemSearchResult], | ||
[WorkflowItem, WorkflowItemSearchResult], | ||
[WorkspaceItem, WorkspaceItemSearchResult], | ||
]); | ||
|
||
/** | ||
* Used to map Search Result components to their matching DSpaceObject | ||
* @param {GenericConstructor<ListableObject>} domainConstructor The constructor of the DSpaceObject | ||
* @returns Decorator function that performs the actual mapping on initialization of the component | ||
*/ | ||
export function searchResultFor(domainConstructor: GenericConstructor<ListableObject>) { | ||
return function decorator(searchResult: any) { | ||
if (!searchResult) { | ||
return; | ||
} | ||
searchResultMap.set(domainConstructor, searchResult); | ||
}; | ||
} | ||
|
||
/** | ||
* Requests the matching component based on a given DSpaceObject's constructor | ||
* @param {GenericConstructor<ListableObject>} domainConstructor The DSpaceObject's constructor for which the search result component is requested | ||
* @returns The component's constructor that matches the given DSpaceObject | ||
*/ | ||
export function getSearchResultFor(domainConstructor: GenericConstructor<ListableObject>) { | ||
return searchResultMap.get(domainConstructor); | ||
return SEARCH_RESULT_MAP.get(domainConstructor); | ||
} |