mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
Merge pull request #2068 from atmire/w2p-97184_theme-feedback_contribute-main
Refactor badges
This commit is contained in:
@@ -19,7 +19,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-
|
|||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service';
|
import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service';
|
||||||
import { AccessStatusObject } from '../../../../../shared/object-list/access-status-badge/access-status.model';
|
import { AccessStatusObject } from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||||
import { FileService } from '../../../../../core/shared/file.service';
|
import { FileService } from '../../../../../core/shared/file.service';
|
||||||
|
@@ -2,6 +2,5 @@
|
|||||||
[viewMode]="viewModes.ListElement"
|
[viewMode]="viewModes.ListElement"
|
||||||
[index]="index"
|
[index]="index"
|
||||||
[linkType]="linkType"
|
[linkType]="linkType"
|
||||||
[listID]="listID"
|
[listID]="listID"></ds-listable-object-component-loader>
|
||||||
[hideBadges]="true"></ds-listable-object-component-loader>
|
|
||||||
<ds-item-admin-search-result-actions-element [item]="dso" [small]="false"></ds-item-admin-search-result-actions-element>
|
<ds-item-admin-search-result-actions-element [item]="dso" [small]="false"></ds-item-admin-search-result-actions-element>
|
||||||
|
@@ -160,7 +160,7 @@ import { SubmissionAccessesModel } from './config/models/config-submission-acces
|
|||||||
import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model';
|
import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model';
|
||||||
import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model';
|
import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model';
|
||||||
import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model';
|
import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model';
|
||||||
import { AccessStatusObject } from '../shared/object-list/access-status-badge/access-status.model';
|
import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
import { AccessStatusDataService } from './data/access-status-data.service';
|
import { AccessStatusDataService } from './data/access-status-data.service';
|
||||||
import { LinkHeadService } from './services/link-head.service';
|
import { LinkHeadService } from './services/link-head.service';
|
||||||
import { ResearcherProfileDataService } from './profile/researcher-profile-data.service';
|
import { ResearcherProfileDataService } from './profile/researcher-profile-data.service';
|
||||||
|
@@ -3,8 +3,8 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { AccessStatusObject } from 'src/app/shared/object-list/access-status-badge/access-status.model';
|
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
import { ACCESS_STATUS } from 'src/app/shared/object-list/access-status-badge/access-status.resource-type';
|
import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
|
@@ -3,17 +3,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export enum Context {
|
export enum Context {
|
||||||
|
/** Default context */
|
||||||
Any = 'undefined',
|
Any = 'undefined',
|
||||||
|
|
||||||
|
/** General item page context */
|
||||||
ItemPage = 'itemPage',
|
ItemPage = 'itemPage',
|
||||||
|
|
||||||
|
/** General search page context */
|
||||||
Search = 'search',
|
Search = 'search',
|
||||||
|
|
||||||
Workflow = 'workflow',
|
Workflow = 'workflow',
|
||||||
Workspace = 'workspace',
|
Workspace = 'workspace',
|
||||||
SupervisedItems = 'supervisedWorkspace',
|
SupervisedItems = 'supervisedWorkspace',
|
||||||
|
|
||||||
|
/** Administrative menu context */
|
||||||
AdminMenu = 'adminMenu',
|
AdminMenu = 'adminMenu',
|
||||||
|
|
||||||
EntitySearchModalWithNameVariants = 'EntitySearchModalWithNameVariants',
|
EntitySearchModalWithNameVariants = 'EntitySearchModalWithNameVariants',
|
||||||
EntitySearchModal = 'EntitySearchModal',
|
EntitySearchModal = 'EntitySearchModal',
|
||||||
|
|
||||||
|
/** Administrative search page context */
|
||||||
AdminSearch = 'adminSearch',
|
AdminSearch = 'adminSearch',
|
||||||
AdminWorkflowSearch = 'adminWorkflowSearch',
|
AdminWorkflowSearch = 'adminWorkflowSearch',
|
||||||
|
|
||||||
SideBarSearchModal = 'sideBarSearchModal',
|
SideBarSearchModal = 'sideBarSearchModal',
|
||||||
SideBarSearchModalCurrent = 'sideBarSearchModalCurrent',
|
SideBarSearchModalCurrent = 'sideBarSearchModalCurrent',
|
||||||
|
|
||||||
|
/** The MyDSpace* Context values below are used for badge display in MyDSpace. */
|
||||||
|
MyDSpaceArchived = 'mydspaceArchived',
|
||||||
|
MyDSpaceWorkspace = 'mydspaceWorkspace',
|
||||||
|
MyDSpaceWorkflow = 'mydspaceWorkflow',
|
||||||
|
MyDSpaceDeclined = 'mydspaceDeclined',
|
||||||
|
MyDSpaceApproved = 'mydspaceApproved',
|
||||||
|
MyDSpaceWaitingController = 'mydspaceWaitingController',
|
||||||
|
MyDSpaceValidation = 'mydspaceValidation',
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,8 @@ import { Version } from './version.model';
|
|||||||
import { VERSION } from './version.resource-type';
|
import { VERSION } from './version.resource-type';
|
||||||
import { BITSTREAM } from './bitstream.resource-type';
|
import { BITSTREAM } from './bitstream.resource-type';
|
||||||
import { Bitstream } from './bitstream.model';
|
import { Bitstream } from './bitstream.model';
|
||||||
import { ACCESS_STATUS } from 'src/app/shared/object-list/access-status-badge/access-status.resource-type';
|
import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
|
||||||
import { AccessStatusObject } from 'src/app/shared/object-list/access-status-badge/access-status.model';
|
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
import { HandleObject } from './handle-object.model';
|
import { HandleObject } from './handle-object.model';
|
||||||
import { IDENTIFIERS } from '../../shared/object-list/identifier-data/identifier-data.resource-type';
|
import { IDENTIFIERS } from '../../shared/object-list/identifier-data/identifier-data.resource-type';
|
||||||
import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model';
|
import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model';
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
[dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea>
|
[dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea>
|
||||||
<div class="d-flex" *ngIf="mdRepresentation">
|
<div class="d-flex" *ngIf="mdRepresentation">
|
||||||
<a class="mr-2" target="_blank" [routerLink]="mdRepresentationItemRoute$ | async">{{ mdRepresentationName$ | async }}</a>
|
<a class="mr-2" target="_blank" [routerLink]="mdRepresentationItemRoute$ | async">{{ mdRepresentationName$ | async }}</a>
|
||||||
<ds-type-badge [object]="mdRepresentation"></ds-type-badge>
|
<ds-themed-type-badge [object]="mdRepresentation"></ds-themed-type-badge>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ds-flex-cell ds-lang-cell" role="cell">
|
<div class="ds-flex-cell ds-lang-cell" role="cell">
|
||||||
|
@@ -68,7 +68,7 @@ describe('DsoEditMetadataValueComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should not show a badge', () => {
|
it('should not show a badge', () => {
|
||||||
expect(fixture.debugElement.query(By.css('ds-type-badge'))).toBeNull();
|
expect(fixture.debugElement.query(By.css('ds-themed-type-badge'))).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when no changes have been made', () => {
|
describe('when no changes have been made', () => {
|
||||||
@@ -134,7 +134,7 @@ describe('DsoEditMetadataValueComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show a badge', () => {
|
it('should show a badge', () => {
|
||||||
expect(fixture.debugElement.query(By.css('ds-type-badge'))).toBeTruthy();
|
expect(fixture.debugElement.query(By.css('ds-themed-type-badge'))).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
assertButton(EDIT_BTN, true, true);
|
assertButton(EDIT_BTN, true, true);
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||||
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9 col-md-10' : 'col-12'">
|
<div [ngClass]="showThumbnails ? 'col-9 col-md-10' : 'col-12'">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
||||||
|
@@ -4,6 +4,6 @@
|
|||||||
<ds-view-tracker [object]="site"></ds-view-tracker>
|
<ds-view-tracker [object]="site"></ds-view-tracker>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ds-themed-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-themed-search-form>
|
<ds-themed-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-themed-search-form>
|
||||||
<ds-top-level-community-list></ds-top-level-community-list>
|
<ds-themed-top-level-community-list></ds-themed-top-level-community-list>
|
||||||
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
|
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -12,11 +12,13 @@ import { ThemedHomePageComponent } from './themed-home-page.component';
|
|||||||
import { RecentItemListComponent } from './recent-item-list/recent-item-list.component';
|
import { RecentItemListComponent } from './recent-item-list/recent-item-list.component';
|
||||||
import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
|
import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
|
||||||
import { ResearchEntitiesModule } from '../entity-groups/research-entities/research-entities.module';
|
import { ResearchEntitiesModule } from '../entity-groups/research-entities/research-entities.module';
|
||||||
|
import { ThemedTopLevelCommunityListComponent } from './top-level-community-list/themed-top-level-community-list.component';
|
||||||
|
|
||||||
const DECLARATIONS = [
|
const DECLARATIONS = [
|
||||||
HomePageComponent,
|
HomePageComponent,
|
||||||
ThemedHomePageComponent,
|
ThemedHomePageComponent,
|
||||||
TopLevelCommunityListComponent,
|
TopLevelCommunityListComponent,
|
||||||
|
ThemedTopLevelCommunityListComponent,
|
||||||
ThemedHomeNewsComponent,
|
ThemedHomeNewsComponent,
|
||||||
HomeNewsComponent,
|
HomeNewsComponent,
|
||||||
RecentItemListComponent
|
RecentItemListComponent
|
||||||
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { TopLevelCommunityListComponent } from './top-level-community-list.component';
|
||||||
|
import { ThemedComponent } from '../../shared/theme-support/themed.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-top-level-community-list',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedTopLevelCommunityListComponent extends ThemedComponent<TopLevelCommunityListComponent> {
|
||||||
|
protected inAndOutputNames: (keyof TopLevelCommunityListComponent & keyof this)[];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'TopLevelCommunityListComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../themes/${themeName}/app/home-page/top-level-community-list/top-level-community-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./top-level-community-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -23,7 +23,6 @@ import { ItemDetailPreviewComponent } from '../shared/object-detail/my-dspace-re
|
|||||||
import { ItemDetailPreviewFieldComponent } from '../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.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 { 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 { 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 { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
|
||||||
import { MyDSpaceActionsModule } from '../shared/mydspace-actions/mydspace-actions.module';
|
import { MyDSpaceActionsModule } from '../shared/mydspace-actions/mydspace-actions.module';
|
||||||
import { ClaimedDeclinedTaskSearchResultListElementComponent } from '../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component';
|
import { ClaimedDeclinedTaskSearchResultListElementComponent } from '../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component';
|
||||||
@@ -52,7 +51,6 @@ const DECLARATIONS = [
|
|||||||
ItemDetailPreviewFieldComponent,
|
ItemDetailPreviewFieldComponent,
|
||||||
ItemListPreviewComponent,
|
ItemListPreviewComponent,
|
||||||
ThemedItemListPreviewComponent,
|
ThemedItemListPreviewComponent,
|
||||||
MyDSpaceItemStatusComponent,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
48
src/app/process-page/process-page-shared.module.ts
Normal file
48
src/app/process-page/process-page-shared.module.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { SharedModule } from '../shared/shared.module';
|
||||||
|
import { NewProcessComponent } from './new/new-process.component';
|
||||||
|
import { ScriptsSelectComponent } from './form/scripts-select/scripts-select.component';
|
||||||
|
import { ScriptHelpComponent } from './form/script-help/script-help.component';
|
||||||
|
import { ParameterSelectComponent } from './form/process-parameters/parameter-select/parameter-select.component';
|
||||||
|
import { ProcessParametersComponent } from './form/process-parameters/process-parameters.component';
|
||||||
|
import { StringValueInputComponent } from './form/process-parameters/parameter-value-input/string-value-input/string-value-input.component';
|
||||||
|
import { ParameterValueInputComponent } from './form/process-parameters/parameter-value-input/parameter-value-input.component';
|
||||||
|
import { FileValueInputComponent } from './form/process-parameters/parameter-value-input/file-value-input/file-value-input.component';
|
||||||
|
import { BooleanValueInputComponent } from './form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component';
|
||||||
|
import { DateValueInputComponent } from './form/process-parameters/parameter-value-input/date-value-input/date-value-input.component';
|
||||||
|
import { ProcessOverviewComponent } from './overview/process-overview.component';
|
||||||
|
import { ProcessDetailComponent } from './detail/process-detail.component';
|
||||||
|
import { ProcessDetailFieldComponent } from './detail/process-detail-field/process-detail-field.component';
|
||||||
|
import { ProcessBreadcrumbsService } from './process-breadcrumbs.service';
|
||||||
|
import { ProcessBreadcrumbResolver } from './process-breadcrumb.resolver';
|
||||||
|
import { ProcessFormComponent } from './form/process-form.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
SharedModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
NewProcessComponent,
|
||||||
|
ScriptsSelectComponent,
|
||||||
|
ScriptHelpComponent,
|
||||||
|
ParameterSelectComponent,
|
||||||
|
ProcessParametersComponent,
|
||||||
|
StringValueInputComponent,
|
||||||
|
ParameterValueInputComponent,
|
||||||
|
FileValueInputComponent,
|
||||||
|
BooleanValueInputComponent,
|
||||||
|
DateValueInputComponent,
|
||||||
|
ProcessOverviewComponent,
|
||||||
|
ProcessDetailComponent,
|
||||||
|
ProcessDetailFieldComponent,
|
||||||
|
ProcessFormComponent
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
ProcessBreadcrumbResolver,
|
||||||
|
ProcessBreadcrumbsService
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ProcessPageSharedModule {
|
||||||
|
|
||||||
|
}
|
@@ -1,47 +1,17 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { SharedModule } from '../shared/shared.module';
|
import { SharedModule } from '../shared/shared.module';
|
||||||
import { ProcessPageRoutingModule } from './process-page-routing.module';
|
import { ProcessPageRoutingModule } from './process-page-routing.module';
|
||||||
import { NewProcessComponent } from './new/new-process.component';
|
import { ProcessPageSharedModule } from './process-page-shared.module';
|
||||||
import { ScriptsSelectComponent } from './form/scripts-select/scripts-select.component';
|
|
||||||
import { ScriptHelpComponent } from './form/script-help/script-help.component';
|
|
||||||
import { ParameterSelectComponent } from './form/process-parameters/parameter-select/parameter-select.component';
|
|
||||||
import { ProcessParametersComponent } from './form/process-parameters/process-parameters.component';
|
|
||||||
import { StringValueInputComponent } from './form/process-parameters/parameter-value-input/string-value-input/string-value-input.component';
|
|
||||||
import { ParameterValueInputComponent } from './form/process-parameters/parameter-value-input/parameter-value-input.component';
|
|
||||||
import { FileValueInputComponent } from './form/process-parameters/parameter-value-input/file-value-input/file-value-input.component';
|
|
||||||
import { BooleanValueInputComponent } from './form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component';
|
|
||||||
import { DateValueInputComponent } from './form/process-parameters/parameter-value-input/date-value-input/date-value-input.component';
|
|
||||||
import { ProcessOverviewComponent } from './overview/process-overview.component';
|
|
||||||
import { ProcessDetailComponent } from './detail/process-detail.component';
|
|
||||||
import { ProcessDetailFieldComponent } from './detail/process-detail-field/process-detail-field.component';
|
|
||||||
import { ProcessBreadcrumbsService } from './process-breadcrumbs.service';
|
|
||||||
import { ProcessBreadcrumbResolver } from './process-breadcrumb.resolver';
|
|
||||||
import { ProcessFormComponent } from './form/process-form.component';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
ProcessPageRoutingModule,
|
ProcessPageRoutingModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
|
ProcessPageSharedModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
NewProcessComponent,
|
|
||||||
ScriptsSelectComponent,
|
|
||||||
ScriptHelpComponent,
|
|
||||||
ParameterSelectComponent,
|
|
||||||
ProcessParametersComponent,
|
|
||||||
StringValueInputComponent,
|
|
||||||
ParameterValueInputComponent,
|
|
||||||
FileValueInputComponent,
|
|
||||||
BooleanValueInputComponent,
|
|
||||||
DateValueInputComponent,
|
|
||||||
ProcessOverviewComponent,
|
|
||||||
ProcessDetailComponent,
|
|
||||||
ProcessDetailFieldComponent,
|
|
||||||
ProcessFormComponent
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
ProcessBreadcrumbResolver,
|
|
||||||
ProcessBreadcrumbsService
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<ng-container *ngIf="showAccessStatus">
|
<ng-container *ngIf="showAccessStatus">
|
||||||
<div *ngIf="accessStatus$ | async as accessStatus">
|
<span *ngIf="accessStatus$ | async as accessStatus">
|
||||||
<span class="badge badge-secondary">{{ accessStatus | translate }}</span>
|
<span class="badge badge-secondary">{{ accessStatus | translate }}</span>
|
||||||
</div>
|
</span>
|
||||||
</ng-container>
|
</ng-container>
|
@@ -1,10 +1,10 @@
|
|||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { TruncatePipe } from '../../utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { AccessStatusBadgeComponent } from './access-status-badge.component';
|
import { AccessStatusBadgeComponent } from './access-status-badge.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { AccessStatusObject } from './access-status.model';
|
import { AccessStatusObject } from './access-status.model';
|
||||||
import { AccessStatusDataService } from 'src/app/core/data/access-status-data.service';
|
import { AccessStatusDataService } from 'src/app/core/data/access-status-data.service';
|
||||||
@@ -50,7 +50,8 @@ describe('ItemAccessStatusBadgeComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
item = Object.assign(new Item(), {
|
item = Object.assign(new Item(), {
|
||||||
uuid: 'item-uuid'
|
uuid: 'item-uuid',
|
||||||
|
type: 'item'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ describe('ItemAccessStatusBadgeComponent', () => {
|
|||||||
environment.item.showAccessStatuses = true;
|
environment.item.showAccessStatuses = true;
|
||||||
fixture = TestBed.createComponent(AccessStatusBadgeComponent);
|
fixture = TestBed.createComponent(AccessStatusBadgeComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
component.item = item;
|
component.object = item;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
environment.item.showAccessStatuses = false;
|
environment.item.showAccessStatuses = false;
|
||||||
}
|
}
|
@@ -2,10 +2,12 @@ import { Component, Input } from '@angular/core';
|
|||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { AccessStatusObject } from './access-status.model';
|
import { AccessStatusObject } from './access-status.model';
|
||||||
import { hasValue } from '../../empty.util';
|
import { hasValue } from '../../../../empty.util';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Item } from 'src/app/core/shared/item.model';
|
|
||||||
import { AccessStatusDataService } from 'src/app/core/data/access-status-data.service';
|
import { AccessStatusDataService } from 'src/app/core/data/access-status-data.service';
|
||||||
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
|
import { ITEM } from '../../../../../core/shared/item.resource-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-access-status-badge',
|
selector: 'ds-access-status-badge',
|
||||||
@@ -16,7 +18,7 @@ import { AccessStatusDataService } from 'src/app/core/data/access-status-data.se
|
|||||||
*/
|
*/
|
||||||
export class AccessStatusBadgeComponent {
|
export class AccessStatusBadgeComponent {
|
||||||
|
|
||||||
@Input() item: Item;
|
@Input() object: DSpaceObject;
|
||||||
accessStatus$: Observable<string>;
|
accessStatus$: Observable<string>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,15 +35,17 @@ export class AccessStatusBadgeComponent {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.showAccessStatus = environment.item.showAccessStatuses;
|
this.showAccessStatus = environment.item.showAccessStatuses;
|
||||||
if (!this.showAccessStatus || this.item == null) {
|
if (this.object.type.toString() !== ITEM.value || !this.showAccessStatus || this.object == null) {
|
||||||
// Do not show the badge if the feature is inactive or if the item is null.
|
// Do not show the badge if the feature is inactive or if the item is null.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.item.accessStatus == null) {
|
|
||||||
|
const item = this.object as Item;
|
||||||
|
if (item.accessStatus == null) {
|
||||||
// In case the access status has not been loaded, do it individually.
|
// In case the access status has not been loaded, do it individually.
|
||||||
this.item.accessStatus = this.accessStatusDataService.findAccessStatusFor(this.item);
|
item.accessStatus = this.accessStatusDataService.findAccessStatusFor(item);
|
||||||
}
|
}
|
||||||
this.accessStatus$ = this.item.accessStatus.pipe(
|
this.accessStatus$ = item.accessStatus.pipe(
|
||||||
map((accessStatusRD) => {
|
map((accessStatusRD) => {
|
||||||
if (accessStatusRD.statusCode !== 401 && hasValue(accessStatusRD.payload)) {
|
if (accessStatusRD.statusCode !== 401 && hasValue(accessStatusRD.payload)) {
|
||||||
return accessStatusRD.payload;
|
return accessStatusRD.payload;
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../../../../theme-support/themed.component';
|
||||||
|
import { AccessStatusBadgeComponent } from './access-status-badge.component';
|
||||||
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for AccessStatusBadgeComponent
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-access-status-badge',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../../theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedAccessStatusBadgeComponent extends ThemedComponent<AccessStatusBadgeComponent> {
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof AccessStatusBadgeComponent & keyof this)[] = ['object'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'AccessStatusBadgeComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../../../themes/${themeName}/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./access-status-badge.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,10 @@
|
|||||||
|
<ds-themed-status-badge [object]="object"></ds-themed-status-badge>
|
||||||
|
<ng-container *ngIf="isMyDSpaceStatus">
|
||||||
|
<ds-themed-my-dspace-status-badge [context]="context"></ds-themed-my-dspace-status-badge>
|
||||||
|
</ng-container>
|
||||||
|
<div>
|
||||||
|
<ds-themed-type-badge class="pr-1" [object]="object"></ds-themed-type-badge>
|
||||||
|
<ng-container *ngIf="showAccessStatus">
|
||||||
|
<ds-themed-access-status-badge [object]="object"></ds-themed-access-status-badge>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { BadgesComponent } from './badges.component';
|
||||||
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../mocks/theme-service.mock';
|
||||||
|
|
||||||
|
describe('BadgesComponent', () => {
|
||||||
|
let component: BadgesComponent;
|
||||||
|
let fixture: ComponentFixture<BadgesComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ BadgesComponent ],
|
||||||
|
providers: [{provide: ThemeService, useValue: getMockThemeService()}],
|
||||||
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(BadgesComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,47 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of MyDSpace Status Contexts
|
||||||
|
*/
|
||||||
|
const MY_DSPACE_STATUS_CONTEXTS = [
|
||||||
|
Context.MyDSpaceArchived,
|
||||||
|
Context.MyDSpaceWorkspace,
|
||||||
|
Context.MyDSpaceWorkflow,
|
||||||
|
Context.MyDSpaceDeclined,
|
||||||
|
Context.MyDSpaceApproved,
|
||||||
|
Context.MyDSpaceWaitingController,
|
||||||
|
Context.MyDSpaceValidation
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component that renders all the badges for a listable object
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-badges',
|
||||||
|
templateUrl: './badges.component.html',
|
||||||
|
styleUrls: ['./badges.component.scss']
|
||||||
|
})
|
||||||
|
export class BadgesComponent {
|
||||||
|
/**
|
||||||
|
* The DSpaceObject to render the badge for
|
||||||
|
*/
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
/**
|
||||||
|
* The context that the badge is rendered in
|
||||||
|
*/
|
||||||
|
@Input() context?: Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not to show the access status
|
||||||
|
*/
|
||||||
|
@Input() showAccessStatus = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not this context is a MyDSpace status context
|
||||||
|
*/
|
||||||
|
get isMyDSpaceStatus(): boolean {
|
||||||
|
return MY_DSPACE_STATUS_CONTEXTS.includes(this.context);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
<span [className]="badgeClass">
|
<span [className]="badgeClass">
|
||||||
{{badgeContent | translate}}
|
{{('mydspace.status.' + badgeContent) | translate}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
@@ -4,17 +4,17 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
import { PoolTask } from '../../../../../core/tasks/models/pool-task-object.model';
|
||||||
import { EPersonMock } from '../../../testing/eperson.mock';
|
import { EPersonMock } from '../../../../testing/eperson.mock';
|
||||||
import { MyDSpaceItemStatusComponent } from './my-dspace-item-status.component';
|
import { MyDSpaceStatusBadgeComponent } from './my-dspace-status-badge.component';
|
||||||
import { MyDspaceItemStatusType } from './my-dspace-item-status-type';
|
import { TranslateLoaderMock } from '../../../../mocks/translate-loader.mock';
|
||||||
import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock';
|
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../../remote-data.utils';
|
||||||
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: MyDSpaceItemStatusComponent;
|
let component: MyDSpaceStatusBadgeComponent;
|
||||||
let fixture: ComponentFixture<MyDSpaceItemStatusComponent>;
|
let fixture: ComponentFixture<MyDSpaceStatusBadgeComponent>;
|
||||||
|
|
||||||
let mockResultObject: PoolTask;
|
let mockResultObject: PoolTask;
|
||||||
|
|
||||||
@@ -34,15 +34,15 @@ describe('MyDSpaceItemStatusComponent', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
declarations: [MyDSpaceItemStatusComponent],
|
declarations: [MyDSpaceStatusBadgeComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(MyDSpaceItemStatusComponent, {
|
}).overrideComponent(MyDSpaceStatusBadgeComponent, {
|
||||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(MyDSpaceItemStatusComponent);
|
fixture = TestBed.createComponent(MyDSpaceStatusBadgeComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -52,37 +52,37 @@ describe('MyDSpaceItemStatusComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should init badge content and class', () => {
|
it('should init badge content and class', () => {
|
||||||
component.status = MyDspaceItemStatusType.VALIDATION;
|
component.context = Context.MyDSpaceValidation;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.badgeContent).toBe(MyDspaceItemStatusType.VALIDATION);
|
expect(component.badgeContent).toBe(Context.MyDSpaceValidation);
|
||||||
expect(component.badgeClass).toBe('text-light badge badge-validation');
|
expect(component.badgeClass).toBe('text-light badge badge-validation');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init badge content and class', () => {
|
it('should init badge content and class', () => {
|
||||||
component.status = MyDspaceItemStatusType.WAITING_CONTROLLER;
|
component.context = Context.MyDSpaceWaitingController;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WAITING_CONTROLLER);
|
expect(component.badgeContent).toBe(Context.MyDSpaceWaitingController);
|
||||||
expect(component.badgeClass).toBe('text-light badge badge-waiting-controller');
|
expect(component.badgeClass).toBe('text-light badge badge-waiting-controller');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init badge content and class', () => {
|
it('should init badge content and class', () => {
|
||||||
component.status = MyDspaceItemStatusType.WORKSPACE;
|
component.context = Context.MyDSpaceWorkspace;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WORKSPACE);
|
expect(component.badgeContent).toBe(Context.MyDSpaceWorkspace);
|
||||||
expect(component.badgeClass).toBe('text-light badge badge-workspace');
|
expect(component.badgeClass).toBe('text-light badge badge-workspace');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init badge content and class', () => {
|
it('should init badge content and class', () => {
|
||||||
component.status = MyDspaceItemStatusType.ARCHIVED;
|
component.context = Context.MyDSpaceArchived;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.badgeContent).toBe(MyDspaceItemStatusType.ARCHIVED);
|
expect(component.badgeContent).toBe(Context.MyDSpaceArchived);
|
||||||
expect(component.badgeClass).toBe('text-light badge badge-archived');
|
expect(component.badgeClass).toBe('text-light badge badge-archived');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init badge content and class', () => {
|
it('should init badge content and class', () => {
|
||||||
component.status = MyDspaceItemStatusType.WORKFLOW;
|
component.context = Context.MyDSpaceWorkflow;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WORKFLOW);
|
expect(component.badgeContent).toBe(Context.MyDSpaceWorkflow);
|
||||||
expect(component.badgeClass).toBe('text-light badge badge-workflow');
|
expect(component.badgeClass).toBe('text-light badge badge-workflow');
|
||||||
});
|
});
|
||||||
});
|
});
|
@@ -1,20 +1,20 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { MyDspaceItemStatusType } from './my-dspace-item-status-type';
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents a badge with mydspace item status
|
* This component represents a badge with mydspace item status
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-mydspace-item-status',
|
selector: 'ds-my-dspace-status-badge',
|
||||||
styleUrls: ['./my-dspace-item-status.component.scss'],
|
styleUrls: ['./my-dspace-status-badge.component.scss'],
|
||||||
templateUrl: './my-dspace-item-status.component.html'
|
templateUrl: './my-dspace-status-badge.component.html'
|
||||||
})
|
})
|
||||||
export class MyDSpaceItemStatusComponent implements OnInit {
|
export class MyDSpaceStatusBadgeComponent implements OnInit {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This mydspace item status
|
* This mydspace item context
|
||||||
*/
|
*/
|
||||||
@Input() status: MyDspaceItemStatusType;
|
@Input() context: Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This badge class
|
* This badge class
|
||||||
@@ -30,22 +30,22 @@ export class MyDSpaceItemStatusComponent implements OnInit {
|
|||||||
* Initialize badge content and class
|
* Initialize badge content and class
|
||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.badgeContent = this.status;
|
this.badgeContent = this.context;
|
||||||
this.badgeClass = 'text-light badge ';
|
this.badgeClass = 'text-light badge ';
|
||||||
switch (this.status) {
|
switch (this.context) {
|
||||||
case MyDspaceItemStatusType.VALIDATION:
|
case Context.MyDSpaceValidation:
|
||||||
this.badgeClass += 'badge-validation';
|
this.badgeClass += 'badge-validation';
|
||||||
break;
|
break;
|
||||||
case MyDspaceItemStatusType.WAITING_CONTROLLER:
|
case Context.MyDSpaceWaitingController:
|
||||||
this.badgeClass += 'badge-waiting-controller';
|
this.badgeClass += 'badge-waiting-controller';
|
||||||
break;
|
break;
|
||||||
case MyDspaceItemStatusType.WORKSPACE:
|
case Context.MyDSpaceWorkspace:
|
||||||
this.badgeClass += 'badge-workspace';
|
this.badgeClass += 'badge-workspace';
|
||||||
break;
|
break;
|
||||||
case MyDspaceItemStatusType.ARCHIVED:
|
case Context.MyDSpaceArchived:
|
||||||
this.badgeClass += 'badge-archived';
|
this.badgeClass += 'badge-archived';
|
||||||
break;
|
break;
|
||||||
case MyDspaceItemStatusType.WORKFLOW:
|
case Context.MyDSpaceWorkflow:
|
||||||
this.badgeClass += 'badge-workflow';
|
this.badgeClass += 'badge-workflow';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
import { ThemedComponent } from '../../../../theme-support/themed.component';
|
||||||
|
import { MyDSpaceStatusBadgeComponent } from './my-dspace-status-badge.component';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for MyDSpaceStatusBadge
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-my-dspace-status-badge',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../../theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedMyDSpaceStatusBadgeComponent extends ThemedComponent<MyDSpaceStatusBadgeComponent> {
|
||||||
|
@Input() context: Context;
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof MyDSpaceStatusBadgeComponent & keyof this)[] = ['context'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'MyDSpaceStatusBadgeComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../../../themes/${themeName}/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./my-dspace-status-badge.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
<div *ngIf="privateBadge" class="private-badge">
|
||||||
|
<span class="badge badge-danger">{{ "item.badge.private" | translate }}</span>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="withdrawnBadge" class="withdrawn-badge">
|
||||||
|
<span class="badge badge-warning">{{ "item.badge.withdrawn" | translate }}</span>
|
||||||
|
</div>
|
@@ -0,0 +1,91 @@
|
|||||||
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||||
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
import { StatusBadgeComponent } from './status-badge.component';
|
||||||
|
|
||||||
|
let comp: StatusBadgeComponent;
|
||||||
|
let fixture: ComponentFixture<StatusBadgeComponent>;
|
||||||
|
|
||||||
|
let withdrawnItem = Object.assign(new Item(), { isWithdrawn: true });
|
||||||
|
let notWithdrawnItem = Object.assign(new Item(), { isWithdrawn: false });
|
||||||
|
let privateItem = Object.assign(new Item(), { isDiscoverable: false });
|
||||||
|
let notPrivateItem = Object.assign(new Item(), { isDiscoverable: true });
|
||||||
|
|
||||||
|
describe('ItemStatusBadgeComponent', () => {
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
imports: [TranslateModule.forRoot()],
|
||||||
|
declarations: [StatusBadgeComponent, TruncatePipe],
|
||||||
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
}).overrideComponent(StatusBadgeComponent, {
|
||||||
|
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||||
|
}).compileComponents();
|
||||||
|
init();
|
||||||
|
}));
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
withdrawnItem = Object.assign(new Item(), { isWithdrawn: true });
|
||||||
|
notWithdrawnItem = Object.assign(new Item(), { isWithdrawn: false });
|
||||||
|
privateItem = Object.assign(new Item(), { isDiscoverable: false });
|
||||||
|
notPrivateItem = Object.assign(new Item(), { isDiscoverable: true });
|
||||||
|
}
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
fixture = TestBed.createComponent(StatusBadgeComponent);
|
||||||
|
comp = fixture.componentInstance;
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
describe('when the item is not withdrawn', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
comp.object = notWithdrawnItem;
|
||||||
|
comp.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not show the withdrawn badge', () => {
|
||||||
|
const badge = fixture.debugElement.query(By.css('div.withdrawn-badge'));
|
||||||
|
expect(badge).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the item is withdrawn', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
comp.object = withdrawnItem;
|
||||||
|
comp.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the withdrawn badge', () => {
|
||||||
|
const badge = fixture.debugElement.query(By.css('div.withdrawn-badge'));
|
||||||
|
expect(badge).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the item is not private', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
comp.object = notPrivateItem;
|
||||||
|
comp.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
it('should not show the private badge', () => {
|
||||||
|
const badge = fixture.debugElement.query(By.css('div.private-badge'));
|
||||||
|
expect(badge).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the item is private', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
comp.object = privateItem;
|
||||||
|
comp.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the private badge', () => {
|
||||||
|
const badge = fixture.debugElement.query(By.css('div.private-badge'));
|
||||||
|
expect(badge).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,41 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
|
import { hasValue } from '../../../../empty.util';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-status-badge',
|
||||||
|
templateUrl: './status-badge.component.html'
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* Component rendering the status of an item as a badge
|
||||||
|
*/
|
||||||
|
export class StatusBadgeComponent implements OnInit {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The component used to retrieve the status from
|
||||||
|
*/
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not the "Private" badge should be displayed for this listable object
|
||||||
|
*/
|
||||||
|
privateBadge = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not the "Withdrawn" badge should be displayed for this listable object
|
||||||
|
*/
|
||||||
|
withdrawnBadge = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize which badges should be visible
|
||||||
|
*/
|
||||||
|
ngOnInit(): void {
|
||||||
|
let objectAsAny = this.object as any;
|
||||||
|
if (hasValue(objectAsAny.indexableObject)) {
|
||||||
|
objectAsAny = objectAsAny.indexableObject;
|
||||||
|
}
|
||||||
|
const objectExists = hasValue(objectAsAny);
|
||||||
|
this.privateBadge = objectExists && hasValue(objectAsAny.isDiscoverable) && !objectAsAny.isDiscoverable;
|
||||||
|
this.withdrawnBadge = objectExists && hasValue(objectAsAny.isWithdrawn) && objectAsAny.isWithdrawn;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../../../../theme-support/themed.component';
|
||||||
|
import { StatusBadgeComponent } from './status-badge.component';
|
||||||
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for StatusBadgeComponent
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-status-badge',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../../theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedStatusBadgeComponent extends ThemedComponent<StatusBadgeComponent> {
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof StatusBadgeComponent & keyof this)[] = ['object'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'StatusBadgeComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../../../themes/${themeName}/app/shared/object-collection/shared/badges/status-badge/status-badge.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./status-badge.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,33 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { BadgesComponent } from './badges.component';
|
||||||
|
import { ThemedComponent } from '../../../theme-support/themed.component';
|
||||||
|
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for BadgesComponent
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-badges',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedBadgesComponent extends ThemedComponent<BadgesComponent> {
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
@Input() context: Context;
|
||||||
|
@Input() showAccessStatus = false;
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof BadgesComponent & keyof this)[] = ['object', 'context', 'showAccessStatus'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'BadgesComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../../themes/${themeName}/app/shared/object-collection/shared/badges/badges.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./badges.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../../../../theme-support/themed.component';
|
||||||
|
import { TypeBadgeComponent } from './type-badge.component';
|
||||||
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for TypeBadgeComponent
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-type-badge',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../../theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedTypeBadgeComponent extends ThemedComponent<TypeBadgeComponent> {
|
||||||
|
@Input() object: DSpaceObject;
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof TypeBadgeComponent & keyof this)[] = ['object'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'TypeBadgeComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../../../themes/${themeName}/app/shared/object-collection/shared/badges/type-badge/type-badge.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./type-badge.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,3 +1,3 @@
|
|||||||
<div *ngIf="typeMessage">
|
<span *ngIf="typeMessage">
|
||||||
<span class="badge badge-info">{{ typeMessage | translate }}</span>
|
<span class="badge badge-info">{{ typeMessage | translate }}</span>
|
||||||
</div>
|
</span>
|
@@ -1,8 +1,8 @@
|
|||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { TruncatePipe } from '../../utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { TypeBadgeComponent } from './type-badge.component';
|
import { TypeBadgeComponent } from './type-badge.component';
|
@@ -1,7 +1,7 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
import { hasValue, isEmpty } from '../../empty.util';
|
import { hasValue, isEmpty } from '../../../../empty.util';
|
||||||
import { getResourceTypeValueFor } from '../../../core/cache/object-cache.reducer';
|
import { getResourceTypeValueFor } from '../../../../../core/cache/object-cache.reducer';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-type-badge',
|
selector: 'ds-type-badge',
|
@@ -1,9 +1 @@
|
|||||||
<div [ngClass]="{'d-none' : hideBadges}" #badges>
|
|
||||||
<div *ngIf="privateBadge" class="private-badge">
|
|
||||||
<span class="badge badge-danger">{{ "item.badge.private" | translate }}</span>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="withdrawnBadge" class="withdrawn-badge">
|
|
||||||
<span class="badge badge-warning">{{ "item.badge.withdrawn" | translate }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ng-template dsListableObject></ng-template>
|
<ng-template dsListableObject></ng-template>
|
||||||
|
@@ -11,7 +11,6 @@ import {
|
|||||||
import { ListableObjectDirective } from './listable-object.directive';
|
import { ListableObjectDirective } from './listable-object.directive';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { ThemeService } from '../../../theme-support/theme.service';
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
|
||||||
@@ -74,64 +73,6 @@ describe('ListableObjectComponentLoaderComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the object is an item and viewMode is a list', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
comp.object = Object.assign(new Item());
|
|
||||||
comp.viewMode = ViewMode.ListElement;
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the item is not withdrawn', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
(comp.object as any).isWithdrawn = false;
|
|
||||||
comp.initBadges();
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not show the withdrawn badge', () => {
|
|
||||||
const badge = fixture.debugElement.query(By.css('div.withdrawn-badge'));
|
|
||||||
expect(badge).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the item is withdrawn', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
(comp.object as any).isWithdrawn = true;
|
|
||||||
comp.initBadges();
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should show the withdrawn badge', () => {
|
|
||||||
const badge = fixture.debugElement.query(By.css('div.withdrawn-badge'));
|
|
||||||
expect(badge).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the item is not private', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
(comp.object as any).isDiscoverable = true;
|
|
||||||
comp.initBadges();
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
it('should not show the private badge', () => {
|
|
||||||
const badge = fixture.debugElement.query(By.css('div.private-badge'));
|
|
||||||
expect(badge).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the item is private', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
(comp.object as any).isDiscoverable = false;
|
|
||||||
comp.initBadges();
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should show the private badge', () => {
|
|
||||||
const badge = fixture.debugElement.query(By.css('div.private-badge'));
|
|
||||||
expect(badge).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('When a reloadedObject is emitted', () => {
|
describe('When a reloadedObject is emitted', () => {
|
||||||
let listableComponent;
|
let listableComponent;
|
||||||
let reloadedObject: any;
|
let reloadedObject: any;
|
||||||
|
@@ -2,7 +2,6 @@ import {
|
|||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
ComponentRef,
|
ComponentRef,
|
||||||
ElementRef,
|
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
@@ -76,37 +75,16 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
|
|||||||
*/
|
*/
|
||||||
@Input() value: string;
|
@Input() value: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not informational badges (e.g. Private, Withdrawn) should be hidden
|
|
||||||
*/
|
|
||||||
@Input() hideBadges = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directive hook used to place the dynamic child component
|
* Directive hook used to place the dynamic child component
|
||||||
*/
|
*/
|
||||||
@ViewChild(ListableObjectDirective, { static: true }) listableObjectDirective: ListableObjectDirective;
|
@ViewChild(ListableObjectDirective, { static: true }) listableObjectDirective: ListableObjectDirective;
|
||||||
|
|
||||||
/**
|
|
||||||
* View on the badges template, to be passed on to the loaded component (which will place the badges in the desired
|
|
||||||
* location, or on top if not specified)
|
|
||||||
*/
|
|
||||||
@ViewChild('badges', { static: true }) badges: ElementRef;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emit when the listable object has been reloaded.
|
* Emit when the listable object has been reloaded.
|
||||||
*/
|
*/
|
||||||
@Output() contentChange = new EventEmitter<ListableObject>();
|
@Output() contentChange = new EventEmitter<ListableObject>();
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not the "Private" badge should be displayed for this listable object
|
|
||||||
*/
|
|
||||||
privateBadge = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not the "Withdrawn" badge should be displayed for this listable object
|
|
||||||
*/
|
|
||||||
withdrawnBadge = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||||
* @type {Array}
|
* @type {Array}
|
||||||
@@ -161,8 +139,6 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
|
|||||||
|
|
||||||
private instantiateComponent(object) {
|
private instantiateComponent(object) {
|
||||||
|
|
||||||
this.initBadges();
|
|
||||||
|
|
||||||
const component = this.getComponent(object.getRenderTypes(), this.viewMode, this.context);
|
const component = this.getComponent(object.getRenderTypes(), this.viewMode, this.context);
|
||||||
|
|
||||||
const viewContainerRef = this.listableObjectDirective.viewContainerRef;
|
const viewContainerRef = this.listableObjectDirective.viewContainerRef;
|
||||||
@@ -171,10 +147,7 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
|
|||||||
this.compRef = viewContainerRef.createComponent(
|
this.compRef = viewContainerRef.createComponent(
|
||||||
component, {
|
component, {
|
||||||
index: 0,
|
index: 0,
|
||||||
injector: undefined,
|
injector: undefined
|
||||||
projectableNodes: [
|
|
||||||
[this.badges.nativeElement],
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -195,19 +168,6 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize which badges should be visible in the listable component
|
|
||||||
*/
|
|
||||||
initBadges() {
|
|
||||||
let objectAsAny = this.object as any;
|
|
||||||
if (hasValue(objectAsAny.indexableObject)) {
|
|
||||||
objectAsAny = objectAsAny.indexableObject;
|
|
||||||
}
|
|
||||||
const objectExistsAndValidViewMode = hasValue(objectAsAny) && this.viewMode !== ViewMode.StandalonePage;
|
|
||||||
this.privateBadge = objectExistsAndValidViewMode && hasValue(objectAsAny.isDiscoverable) && !objectAsAny.isDiscoverable;
|
|
||||||
this.withdrawnBadge = objectExistsAndValidViewMode && hasValue(objectAsAny.isWithdrawn) && objectAsAny.isWithdrawn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the component depending on the item's entity type, view mode and context
|
* Fetch the component depending on the item's entity type, view mode and context
|
||||||
* @returns {GenericConstructor<Component>}
|
* @returns {GenericConstructor<Component>}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<ds-item-detail-preview [item]="item$?.value"
|
<ds-item-detail-preview [item]="item$?.value"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[showSubmitter]="showSubmitter"
|
[showSubmitter]="showSubmitter"
|
||||||
[status]="status">
|
[badgeContext]="badgeContext">
|
||||||
</ds-item-detail-preview>
|
</ds-item-detail-preview>
|
||||||
|
|
||||||
<ds-claimed-task-actions [item]="item$.value"
|
<ds-claimed-task-actions [item]="item$.value"
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
flush,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
waitForAsync
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
@@ -7,9 +14,6 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { ClaimedTaskSearchResultDetailElementComponent } from './claimed-task-search-result-detail-element.component';
|
import { ClaimedTaskSearchResultDetailElementComponent } from './claimed-task-search-result-detail-element.component';
|
||||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
@@ -18,6 +22,7 @@ import { LinkService } from '../../../../core/cache/builders/link.service';
|
|||||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: ClaimedTaskSearchResultDetailElementComponent;
|
let component: ClaimedTaskSearchResultDetailElementComponent;
|
||||||
let fixture: ComponentFixture<ClaimedTaskSearchResultDetailElementComponent>;
|
let fixture: ComponentFixture<ClaimedTaskSearchResultDetailElementComponent>;
|
||||||
@@ -101,8 +106,8 @@ describe('ClaimedTaskSearchResultDetailElementComponent', () => {
|
|||||||
expect(component.item$.value).toEqual(item);
|
expect(component.item$.value).toEqual(item);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.VALIDATION);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceValidation);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward claimed-task-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
it('should forward claimed-task-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -8,9 +8,6 @@ import { ViewMode } from '../../../../core/shared/view-mode.model';
|
|||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
@@ -19,6 +16,7 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty } from '../../../empty.util';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task object for the search result in the detail view.
|
* This component renders claimed task object for the search result in the detail view.
|
||||||
@@ -43,9 +41,9 @@ export class ClaimedTaskSearchResultDetailElementComponent extends SearchResultD
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.VALIDATION;
|
public badgeContext = Context.MyDSpaceValidation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflowitem object that belonging to the result object
|
* The workflowitem object that belonging to the result object
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<div *ngIf="item" class="item-page" @fadeInOut>
|
<div *ngIf="item" class="item-page" @fadeInOut>
|
||||||
<ng-container *ngIf="status">
|
<ds-themed-badges [object]="item" [context]="badgeContext"></ds-themed-badges>
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
|
||||||
</ng-container>
|
|
||||||
<div *ngIf="item">
|
<div *ngIf="item">
|
||||||
<ds-themed-item-page-title-field [item]="item">
|
<ds-themed-item-page-title-field [item]="item">
|
||||||
</ds-themed-item-page-title-field>
|
</ds-themed-item-page-title-field>
|
||||||
|
@@ -6,12 +6,12 @@ import { BitstreamDataService } from '../../../../core/data/bitstream-data.servi
|
|||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { fadeInOut } from '../../../animations/fade';
|
import { fadeInOut } from '../../../animations/fade';
|
||||||
import { Bitstream } from '../../../../core/shared/bitstream.model';
|
import { Bitstream } from '../../../../core/shared/bitstream.model';
|
||||||
import { FileService } from '../../../../core/shared/file.service';
|
import { FileService } from '../../../../core/shared/file.service';
|
||||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||||
import { SearchResult } from '../../../search/models/search-result.model';
|
import { SearchResult } from '../../../search/models/search-result.model';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component show metadata for the given item object in the detail view.
|
* This component show metadata for the given item object in the detail view.
|
||||||
@@ -23,7 +23,6 @@ import { SearchResult } from '../../../search/models/search-result.model';
|
|||||||
animations: [fadeInOut]
|
animations: [fadeInOut]
|
||||||
})
|
})
|
||||||
export class ItemDetailPreviewComponent {
|
export class ItemDetailPreviewComponent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The item to display
|
* The item to display
|
||||||
*/
|
*/
|
||||||
@@ -35,9 +34,9 @@ export class ItemDetailPreviewComponent {
|
|||||||
@Input() object: SearchResult<any>;
|
@Input() object: SearchResult<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
@Input() status: MyDspaceItemStatusType;
|
@Input() badgeContext: Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean representing if to show submitter information
|
* A boolean representing if to show submitter information
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<ds-item-detail-preview [item]="dso"
|
<ds-item-detail-preview [item]="dso"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status">
|
[badgeContext]="badgeContext">
|
||||||
</ds-item-detail-preview>
|
</ds-item-detail-preview>
|
||||||
|
|
||||||
<ds-item-actions [object]="dso"></ds-item-actions>
|
<ds-item-actions [object]="dso"></ds-item-actions>
|
||||||
|
@@ -6,8 +6,8 @@ import { of as observableOf } from 'rxjs';
|
|||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { ItemSearchResultDetailElementComponent } from './item-search-result-detail-element.component';
|
import { ItemSearchResultDetailElementComponent } from './item-search-result-detail-element.component';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
let component: ItemSearchResultDetailElementComponent;
|
let component: ItemSearchResultDetailElementComponent;
|
||||||
let fixture: ComponentFixture<ItemSearchResultDetailElementComponent>;
|
let fixture: ComponentFixture<ItemSearchResultDetailElementComponent>;
|
||||||
@@ -68,7 +68,7 @@ describe('ItemSearchResultDetailElementComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.ARCHIVED);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceArchived);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3,9 +3,6 @@ import { Component } from '@angular/core';
|
|||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
@@ -24,8 +21,8 @@ import { Context } from '../../../../core/shared/context.model';
|
|||||||
export class ItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<ItemSearchResult, Item> {
|
export class ItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<ItemSearchResult, Item> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.ARCHIVED;
|
public badgeContext = Context.MyDSpaceArchived;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<ds-item-detail-preview [item]="item$?.value"
|
<ds-item-detail-preview [item]="item$?.value"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[showSubmitter]="showSubmitter"
|
[showSubmitter]="showSubmitter"
|
||||||
[status]="status"></ds-item-detail-preview>
|
[badgeContext]="badgeContext"></ds-item-detail-preview>
|
||||||
|
|
||||||
<ds-pool-task-actions [item]="item$.value"
|
<ds-pool-task-actions [item]="item$.value"
|
||||||
[object]="dso"
|
[object]="dso"
|
||||||
|
@@ -6,9 +6,6 @@ import { of as observableOf } from 'rxjs';
|
|||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { PoolSearchResultDetailElementComponent } from './pool-search-result-detail-element.component';
|
import { PoolSearchResultDetailElementComponent } from './pool-search-result-detail-element.component';
|
||||||
@@ -18,6 +15,7 @@ import { LinkService } from '../../../../core/cache/builders/link.service';
|
|||||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
let component: PoolSearchResultDetailElementComponent;
|
let component: PoolSearchResultDetailElementComponent;
|
||||||
let fixture: ComponentFixture<PoolSearchResultDetailElementComponent>;
|
let fixture: ComponentFixture<PoolSearchResultDetailElementComponent>;
|
||||||
@@ -103,8 +101,8 @@ describe('PoolSearchResultDetailElementComponent', () => {
|
|||||||
expect(component.item$.value).toEqual(item);
|
expect(component.item$.value).toEqual(item);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.WAITING_CONTROLLER);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceWaitingController);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward pool-task-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
it('should forward pool-task-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -6,9 +6,6 @@ import { mergeMap, tap } from 'rxjs/operators';
|
|||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
@@ -19,6 +16,7 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty } from '../../../empty.util';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders pool task object for the search result in the detail view.
|
* This component renders pool task object for the search result in the detail view.
|
||||||
@@ -43,9 +41,9 @@ export class PoolSearchResultDetailElementComponent extends SearchResultDetailEl
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.WAITING_CONTROLLER;
|
public badgeContext = Context.MyDSpaceWaitingController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflowitem object that belonging to the result object
|
* The workflowitem object that belonging to the result object
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<ds-item-detail-preview [item]="item"
|
<ds-item-detail-preview [item]="item"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-item-detail-preview>
|
[badgeContext]="badgeContext"></ds-item-detail-preview>
|
||||||
|
|
||||||
<ds-workflowitem-actions [object]="dso"></ds-workflowitem-actions>
|
<ds-workflowitem-actions [object]="dso"></ds-workflowitem-actions>
|
||||||
|
|
||||||
|
@@ -7,13 +7,13 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { WorkflowItemSearchResultDetailElementComponent } from './workflow-item-search-result-detail-element.component';
|
import { WorkflowItemSearchResultDetailElementComponent } from './workflow-item-search-result-detail-element.component';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
||||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: WorkflowItemSearchResultDetailElementComponent;
|
let component: WorkflowItemSearchResultDetailElementComponent;
|
||||||
let fixture: ComponentFixture<WorkflowItemSearchResultDetailElementComponent>;
|
let fixture: ComponentFixture<WorkflowItemSearchResultDetailElementComponent>;
|
||||||
@@ -87,7 +87,7 @@ describe('WorkflowItemSearchResultDetailElementComponent', () => {
|
|||||||
expect(component.item).toEqual(item);
|
expect(component.item).toEqual(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.WORKFLOW);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceWorkflow);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -4,7 +4,6 @@ import { ViewMode } from '../../../../core/shared/view-mode.model';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { find } from 'rxjs/operators';
|
import { find } from 'rxjs/operators';
|
||||||
@@ -13,6 +12,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
|||||||
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders workflowitem object for the search result in the detail view.
|
* This component renders workflowitem object for the search result in the detail view.
|
||||||
@@ -32,9 +32,9 @@ export class WorkflowItemSearchResultDetailElementComponent extends SearchResult
|
|||||||
public item: Item;
|
public item: Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.WORKFLOW;
|
public badgeContext = Context.MyDSpaceWorkflow;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected linkService: LinkService
|
protected linkService: LinkService
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<ds-item-detail-preview [item]="item"
|
<ds-item-detail-preview [item]="item"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-item-detail-preview>
|
[badgeContext]="badgeContext"></ds-item-detail-preview>
|
||||||
|
|
||||||
<ds-workspaceitem-actions [object]="dso"></ds-workspaceitem-actions>
|
<ds-workspaceitem-actions [object]="dso"></ds-workspaceitem-actions>
|
||||||
|
@@ -7,13 +7,13 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { WorkspaceItemSearchResultDetailElementComponent } from './workspace-item-search-result-detail-element.component';
|
import { WorkspaceItemSearchResultDetailElementComponent } from './workspace-item-search-result-detail-element.component';
|
||||||
import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
||||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
let component: WorkspaceItemSearchResultDetailElementComponent;
|
let component: WorkspaceItemSearchResultDetailElementComponent;
|
||||||
let fixture: ComponentFixture<WorkspaceItemSearchResultDetailElementComponent>;
|
let fixture: ComponentFixture<WorkspaceItemSearchResultDetailElementComponent>;
|
||||||
@@ -87,7 +87,7 @@ describe('WorkspaceItemSearchResultDetailElementComponent', () => {
|
|||||||
expect(component.item).toEqual(item);
|
expect(component.item).toEqual(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.WORKSPACE);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceWorkspace);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -8,12 +8,12 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { isNotUndefined } from '../../../empty.util';
|
import { isNotUndefined } from '../../../empty.util';
|
||||||
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
import { SearchResultDetailElementComponent } from '../search-result-detail-element.component';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { WorkspaceItemSearchResult } from '../../../object-collection/shared/workspace-item-search-result.model';
|
import { WorkspaceItemSearchResult } from '../../../object-collection/shared/workspace-item-search-result.model';
|
||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders workspace item object for the search result in the detail view.
|
* This component renders workspace item object for the search result in the detail view.
|
||||||
@@ -33,9 +33,9 @@ export class WorkspaceItemSearchResultDetailElementComponent extends SearchResul
|
|||||||
public item: Item;
|
public item: Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
status = MyDspaceItemStatusType.WORKSPACE;
|
public badgeContext = Context.MyDSpaceWorkspace;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected linkService: LinkService
|
protected linkService: LinkService
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</ds-thumbnail>
|
</ds-thumbnail>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<h4 class="card-title">{{dso.name}}</h4>
|
<h4 class="card-title">{{dso.name}}</h4>
|
||||||
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
||||||
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</ds-thumbnail>
|
</ds-thumbnail>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
|
||||||
<h4 class="card-title">{{dso.name}}</h4>
|
<h4 class="card-title">{{dso.name}}</h4>
|
||||||
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
||||||
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
||||||
|
@@ -16,8 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context" [showAccessStatus]="true"></ds-themed-badges>
|
||||||
<ds-access-status-badge [item]="dso"></ds-access-status-badge>
|
|
||||||
<ds-truncatable [id]="dso.id">
|
<ds-truncatable [id]="dso.id">
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||||
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<ds-themed-item-list-preview *ngIf="workflowitem"
|
<ds-themed-item-list-preview *ngIf="workflowitem"
|
||||||
[item]="(workflowitem?.item | async)?.payload"
|
[item]="(workflowitem?.item | async)?.payload"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"
|
[badgeContext]="badgeContext"
|
||||||
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
|
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@@ -12,13 +12,13 @@ import { getMockLinkService } from '../../../../mocks/link-service.mock';
|
|||||||
import { VarDirective } from '../../../../utils/var.directive';
|
import { VarDirective } from '../../../../utils/var.directive';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
||||||
import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component';
|
import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
let component: ClaimedApprovedSearchResultListElementComponent;
|
let component: ClaimedApprovedSearchResultListElementComponent;
|
||||||
@@ -104,8 +104,8 @@ describe('ClaimedApprovedSearchResultListElementComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.APPROVED);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceApproved);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -4,7 +4,6 @@ import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/s
|
|||||||
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../../core/data/remote-data';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
@@ -14,6 +13,7 @@ import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/cl
|
|||||||
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task approved object for the search result in the list view.
|
* This component renders claimed task approved object for the search result in the list view.
|
||||||
@@ -32,9 +32,9 @@ export class ClaimedApprovedSearchResultListElementComponent extends SearchResul
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.APPROVED;
|
public badgeContext = Context.MyDSpaceApproved;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflowitem object that belonging to the result object
|
* The workflowitem object that belonging to the result object
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<ds-themed-item-list-preview *ngIf="workflowitem"
|
<ds-themed-item-list-preview *ngIf="workflowitem"
|
||||||
[item]="(workflowitem?.item | async)?.payload"
|
[item]="(workflowitem?.item | async)?.payload"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"
|
[badgeContext]="badgeContext"
|
||||||
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
|
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@@ -14,11 +14,11 @@ import { getMockLinkService } from '../../../../mocks/link-service.mock';
|
|||||||
import { VarDirective } from '../../../../utils/var.directive';
|
import { VarDirective } from '../../../../utils/var.directive';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
let component: ClaimedDeclinedSearchResultListElementComponent;
|
let component: ClaimedDeclinedSearchResultListElementComponent;
|
||||||
@@ -104,8 +104,8 @@ describe('ClaimedDeclinedSearchResultListElementComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.DECLINED);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceDeclined);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -5,7 +5,6 @@ import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/s
|
|||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../../core/data/remote-data';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
@@ -15,6 +14,7 @@ import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/cl
|
|||||||
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task declined object for the search result in the list view.
|
* This component renders claimed task declined object for the search result in the list view.
|
||||||
@@ -33,9 +33,9 @@ export class ClaimedDeclinedSearchResultListElementComponent extends SearchResul
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.DECLINED;
|
public badgeContext = Context.MyDSpaceDeclined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflowitem object that belonging to the result object
|
* The workflowitem object that belonging to the result object
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<ds-themed-item-list-preview *ngIf="workflowitem"
|
<ds-themed-item-list-preview *ngIf="workflowitem"
|
||||||
[item]="(workflowitem?.item | async)?.payload"
|
[item]="(workflowitem?.item | async)?.payload"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"
|
[badgeContext]="badgeContext"
|
||||||
[showSubmitter]="showSubmitter">
|
[showSubmitter]="showSubmitter">
|
||||||
</ds-themed-item-list-preview>
|
</ds-themed-item-list-preview>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -12,7 +12,6 @@ import { getMockLinkService } from '../../../../mocks/link-service.mock';
|
|||||||
import { VarDirective } from '../../../../utils/var.directive';
|
import { VarDirective } from '../../../../utils/var.directive';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
@@ -102,8 +101,4 @@ describe('ClaimedDeclinedTaskSearchResultListElementComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.DECLINED_TASk);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -4,7 +4,6 @@ import { ClaimedDeclinedTaskTaskSearchResult } from 'src/app/shared/object-colle
|
|||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../../core/data/remote-data';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
@@ -14,6 +13,7 @@ import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/cl
|
|||||||
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task declined task object for the search result in the list view.
|
* This component renders claimed task declined task object for the search result in the list view.
|
||||||
@@ -32,9 +32,9 @@ export class ClaimedDeclinedTaskSearchResultListElementComponent extends SearchR
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.DECLINED_TASk;
|
public badgeContext = Context.MyDSpaceDeclined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflowitem object that belonging to the result object
|
* The workflowitem object that belonging to the result object
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
<ds-themed-item-list-preview [item]="item$.value"
|
<ds-themed-item-list-preview [item]="item$.value"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[showSubmitter]="showSubmitter"
|
[showSubmitter]="showSubmitter"
|
||||||
[workflowItem]="workflowitem$.value"
|
[badgeContext]="badgeContext"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[workflowItem]="workflowitem$.value"></ds-themed-item-list-preview>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
flush,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
waitForAsync
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
@@ -7,9 +14,6 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { ClaimedSearchResultListElementComponent } from './claimed-search-result-list-element.component';
|
import { ClaimedSearchResultListElementComponent } from './claimed-search-result-list-element.component';
|
||||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
@@ -23,6 +27,7 @@ import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
|||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../environments/environment';
|
import { environment } from '../../../../../environments/environment';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: ClaimedSearchResultListElementComponent;
|
let component: ClaimedSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ClaimedSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ClaimedSearchResultListElementComponent>;
|
||||||
@@ -107,8 +112,8 @@ describe('ClaimedSearchResultListElementComponent', () => {
|
|||||||
expect(component.item$.value).toEqual(item);
|
expect(component.item$.value).toEqual(item);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.VALIDATION);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceValidation);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward claimed-task-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
it('should forward claimed-task-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -5,9 +5,6 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
|||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { BehaviorSubject, EMPTY, Observable } from 'rxjs';
|
import { BehaviorSubject, EMPTY, Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
@@ -23,6 +20,7 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { mergeMap, tap } from 'rxjs/operators';
|
import { mergeMap, tap } from 'rxjs/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty } from '../../../empty.util';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-claimed-search-result-list-element',
|
selector: 'ds-claimed-search-result-list-element',
|
||||||
@@ -38,9 +36,9 @@ export class ClaimedSearchResultListElementComponent extends SearchResultListEle
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.VALIDATION;
|
public badgeContext = Context.MyDSpaceValidation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The item object that belonging to the result object
|
* The item object that belonging to the result object
|
||||||
|
@@ -5,12 +5,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
<div [ngClass]="showThumbnails ? 'col-9' : 'col-md-12'">
|
||||||
<div *ngIf="item" @fadeInOut>
|
<div *ngIf="item" @fadeInOut>
|
||||||
<ng-container *ngIf="status">
|
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
|
||||||
</ng-container>
|
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<ds-type-badge [object]="item"></ds-type-badge>
|
<ds-themed-badges [object]="item" [context]="badgeContext" [showAccessStatus]="true"></ds-themed-badges>
|
||||||
<ds-access-status-badge [item]="item" class="pl-1"></ds-access-status-badge>
|
|
||||||
</div>
|
</div>
|
||||||
<ds-truncatable [id]="item.id">
|
<ds-truncatable [id]="item.id">
|
||||||
<h3 [innerHTML]="dsoTitle" [ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
<h3 [innerHTML]="dsoTitle" [ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
||||||
|
@@ -178,8 +178,8 @@ describe('ItemListPreviewComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show the entity type span', () => {
|
it('should show the badges', () => {
|
||||||
const entityField = fixture.debugElement.query(By.css('ds-type-badge'));
|
const entityField = fixture.debugElement.query(By.css('ds-themed-badges'));
|
||||||
expect(entityField).not.toBeNull();
|
expect(entityField).not.toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,12 +2,10 @@ import { Component, Inject, Input, OnInit } from '@angular/core';
|
|||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { fadeInOut } from '../../../animations/fade';
|
import { fadeInOut } from '../../../animations/fade';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { SearchResult } from '../../../search/models/search-result.model';
|
import { SearchResult } from '../../../search/models/search-result.model';
|
||||||
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model';
|
import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,9 +30,9 @@ export class ItemListPreviewComponent implements OnInit {
|
|||||||
@Input() object: SearchResult<any>;
|
@Input() object: SearchResult<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
@Input() status: MyDspaceItemStatusType;
|
@Input() badgeContext: Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean representing if to show submitter information
|
* A boolean representing if to show submitter information
|
||||||
|
@@ -2,8 +2,8 @@ import { Component, Input } from '@angular/core';
|
|||||||
import { ThemedComponent } from '../../../theme-support/themed.component';
|
import { ThemedComponent } from '../../../theme-support/themed.component';
|
||||||
import { ItemListPreviewComponent } from './item-list-preview.component';
|
import { ItemListPreviewComponent } from './item-list-preview.component';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { SearchResult } from '../../../search/models/search-result.model';
|
import { SearchResult } from '../../../search/models/search-result.model';
|
||||||
|
import { Context } from 'src/app/core/shared/context.model';
|
||||||
import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model';
|
import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,13 +15,13 @@ import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model'
|
|||||||
templateUrl: '../../../theme-support/themed.component.html'
|
templateUrl: '../../../theme-support/themed.component.html'
|
||||||
})
|
})
|
||||||
export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPreviewComponent> {
|
export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPreviewComponent> {
|
||||||
protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'status', 'showSubmitter', 'workflowItem'];
|
protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'badgeContext', 'showSubmitter', 'workflowItem'];
|
||||||
|
|
||||||
@Input() item: Item;
|
@Input() item: Item;
|
||||||
|
|
||||||
@Input() object: SearchResult<any>;
|
@Input() object: SearchResult<any>;
|
||||||
|
|
||||||
@Input() status: MyDspaceItemStatusType;
|
@Input() badgeContext: Context;
|
||||||
|
|
||||||
@Input() showSubmitter: boolean;
|
@Input() showSubmitter: boolean;
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<ds-themed-item-list-preview [item]="dso"
|
<ds-themed-item-list-preview [item]="dso"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[badgeContext]="badgeContext"></ds-themed-item-list-preview>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { waitForAsync, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||||
import { ItemSearchResultListElementSubmissionComponent } from './item-search-result-list-element-submission.component';
|
import { ItemSearchResultListElementSubmissionComponent } from './item-search-result-list-element-submission.component';
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||||
@@ -14,6 +13,7 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
|||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../environments/environment';
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: ItemSearchResultListElementSubmissionComponent;
|
let component: ItemSearchResultListElementSubmissionComponent;
|
||||||
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
||||||
@@ -77,8 +77,8 @@ describe('ItemMyDSpaceResultListElementComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.ARCHIVED);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceArchived);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward item-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
it('should forward item-actions processComplete event to reloadObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
@@ -21,9 +20,10 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
|||||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workflow)
|
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workflow)
|
||||||
export class ItemSearchResultListElementSubmissionComponent extends SearchResultListElementComponent<ItemSearchResult, Item> implements OnInit {
|
export class ItemSearchResultListElementSubmissionComponent extends SearchResultListElementComponent<ItemSearchResult, Item> implements OnInit {
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.ARCHIVED;
|
public badgeContext = Context.MyDSpaceArchived;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display thumbnails if required by configuration
|
* Display thumbnails if required by configuration
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
<ds-themed-item-list-preview [item]="item$.value"
|
<ds-themed-item-list-preview [item]="item$.value"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[showSubmitter]="showSubmitter"
|
[showSubmitter]="showSubmitter"
|
||||||
[workflowItem]="workflowitem$.value"
|
[badgeContext]="badgeContext"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[workflowItem]="workflowitem$.value"></ds-themed-item-list-preview>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
||||||
<ds-pool-task-actions id="actions"
|
<ds-pool-task-actions id="actions"
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
flush,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
waitForAsync
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
@@ -7,9 +14,6 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { PoolSearchResultListElementComponent } from './pool-search-result-list-element.component';
|
import { PoolSearchResultListElementComponent } from './pool-search-result-list-element.component';
|
||||||
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
||||||
@@ -22,6 +26,7 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
|||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: PoolSearchResultListElementComponent;
|
let component: PoolSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
||||||
@@ -113,8 +118,8 @@ describe('PoolSearchResultListElementComponent', () => {
|
|||||||
expect(component.item$.value).toEqual(item);
|
expect(component.item$.value).toEqual(item);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.WAITING_CONTROLLER);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceWaitingController);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward pool-task-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
it('should forward pool-task-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -7,9 +7,6 @@ import { ViewMode } from '../../../../core/shared/view-mode.model';
|
|||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
|
||||||
import {
|
|
||||||
MyDspaceItemStatusType
|
|
||||||
} from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
||||||
import {
|
import {
|
||||||
@@ -24,6 +21,7 @@ import { ObjectCacheService } from '../../../../core/cache/object-cache.service'
|
|||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty } from '../../../empty.util';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders pool task object for the search result in the list view.
|
* This component renders pool task object for the search result in the list view.
|
||||||
@@ -43,9 +41,9 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen
|
|||||||
public showSubmitter = true;
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge Context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.WAITING_CONTROLLER;
|
public badgeContext = Context.MyDSpaceWaitingController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The item object that belonging to the result object
|
* The item object that belonging to the result object
|
||||||
|
@@ -1,12 +1,8 @@
|
|||||||
<ng-container *ngIf="derivedSearchResult$ | async">
|
<ng-container *ngIf="derivedSearchResult$ | async">
|
||||||
<div class="row">
|
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ds-listable-object-component-loader
|
<ds-listable-object-component-loader
|
||||||
[viewMode]="ViewModes.ListElement"
|
[viewMode]="ViewModes.ListElement"
|
||||||
[object]="derivedSearchResult$ | async" [linkType]="LinkTypes.None"></ds-listable-object-component-loader>
|
[object]="derivedSearchResult$ | async" [linkType]="LinkTypes.None"
|
||||||
|
[context]="badgeContext"></ds-listable-object-component-loader>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
||||||
<ds-workflowitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workflowitem-actions>
|
<ds-workflowitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workflowitem-actions>
|
||||||
|
@@ -10,7 +10,6 @@ import { ItemDataService } from '../../../../core/data/item-data.service';
|
|||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||||
@@ -19,6 +18,7 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
let component: WorkflowItemSearchResultListElementComponent;
|
let component: WorkflowItemSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<WorkflowItemSearchResultListElementComponent>;
|
let fixture: ComponentFixture<WorkflowItemSearchResultListElementComponent>;
|
||||||
@@ -105,8 +105,8 @@ describe('WorkflowItemSearchResultListElementComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have properly status', () => {
|
it('should have the correct badge context', () => {
|
||||||
expect(component.status).toEqual(MyDspaceItemStatusType.WORKFLOW);
|
expect(component.badgeContext).toEqual(Context.MyDSpaceWorkflow);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should forward workflowitem-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
it('should forward workflowitem-actions processCompleted event to the reloadedObject event emitter', fakeAsync(() => {
|
||||||
|
@@ -8,7 +8,6 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model';
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
@@ -18,6 +17,7 @@ import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interfac
|
|||||||
import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators';
|
import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators';
|
||||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||||
import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type';
|
||||||
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders workflowitem object for the search result in the list view.
|
* This component renders workflowitem object for the search result in the list view.
|
||||||
@@ -40,9 +40,9 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi
|
|||||||
derivedSearchResult$: Observable<ItemSearchResult>;
|
derivedSearchResult$: Observable<ItemSearchResult>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represents the badge context
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.WORKFLOW;
|
public badgeContext = Context.MyDSpaceWorkflow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display thumbnails if required by configuration
|
* Display thumbnails if required by configuration
|
||||||
|
@@ -1,12 +1,8 @@
|
|||||||
<ng-container *ngIf="derivedSearchResult$ | async">
|
<ng-container *ngIf="derivedSearchResult$ | async">
|
||||||
<div class="row">
|
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ds-listable-object-component-loader
|
<ds-listable-object-component-loader
|
||||||
[viewMode]="ViewModes.ListElement"
|
[viewMode]="ViewModes.ListElement"
|
||||||
[object]="derivedSearchResult$ | async" [linkType]="LinkTypes.None"></ds-listable-object-component-loader>
|
[object]="derivedSearchResult$ | async" [linkType]="LinkTypes.None"
|
||||||
|
[context]="badgeContext"></ds-listable-object-component-loader>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">
|
||||||
<ds-workspaceitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workspaceitem-actions>
|
<ds-workspaceitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workspaceitem-actions>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user