mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
62849: updated view mode tyypes
This commit is contained in:
@@ -31,7 +31,7 @@ export class EditRelationshipComponent implements OnChanges {
|
||||
/**
|
||||
* The view-mode we're currently on
|
||||
*/
|
||||
viewMode = ItemViewMode.Element;
|
||||
viewMode = ItemViewMode.Summary;
|
||||
|
||||
constructor(private objectUpdatesService: ObjectUpdatesService) {
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ export class ItemPageComponent implements OnInit {
|
||||
/**
|
||||
* The view-mode we're currently on
|
||||
*/
|
||||
viewMode = ItemViewMode.Full;
|
||||
viewMode = ItemViewMode.Detail;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
|
@@ -9,8 +9,8 @@ import { ItemComponent } from '../shared/item.component';
|
||||
import { MetadataRepresentation } from '../../../../core/shared/metadata-representation/metadata-representation.model';
|
||||
import { getRelatedItemsByTypeLabel } from '../shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('Publication', ItemViewMode.Full)
|
||||
@rendersItemType(DEFAULT_ITEM_TYPE, ItemViewMode.Full)
|
||||
@rendersItemType('Publication', ItemViewMode.Detail)
|
||||
@rendersItemType(DEFAULT_ITEM_TYPE, ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-publication',
|
||||
styleUrls: ['./publication.component.scss'],
|
||||
|
@@ -26,5 +26,5 @@ export class RelatedItemsComponent {
|
||||
* The view-mode we're currently on
|
||||
* @type {ElementViewMode}
|
||||
*/
|
||||
viewMode = ItemViewMode.Element;
|
||||
viewMode = ItemViewMode.Summary;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('JournalIssue', ItemViewMode.Element)
|
||||
@rendersItemType('JournalIssue', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-journal-issue-list-element',
|
||||
styleUrls: ['./journal-issue-list-element.component.scss'],
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('JournalVolume', ItemViewMode.Element)
|
||||
@rendersItemType('JournalVolume', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-journal-volume-list-element',
|
||||
styleUrls: ['./journal-volume-list-element.component.scss'],
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('Journal', ItemViewMode.Element)
|
||||
@rendersItemType('Journal', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-journal-list-element',
|
||||
styleUrls: ['./journal-list-element.component.scss'],
|
||||
|
@@ -6,7 +6,7 @@ import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('JournalIssue', ItemViewMode.Full)
|
||||
@rendersItemType('JournalIssue', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-journal-issue',
|
||||
styleUrls: ['./journal-issue.component.scss'],
|
||||
|
@@ -6,7 +6,7 @@ import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('JournalVolume', ItemViewMode.Full)
|
||||
@rendersItemType('JournalVolume', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-journal-volume',
|
||||
styleUrls: ['./journal-volume.component.scss'],
|
||||
|
@@ -6,7 +6,7 @@ import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('Journal', ItemViewMode.Full)
|
||||
@rendersItemType('Journal', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-journal',
|
||||
styleUrls: ['./journal.component.scss'],
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Element)
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-orgunit-list-element',
|
||||
styleUrls: ['./orgunit-list-element.component.scss'],
|
||||
|
@@ -3,7 +3,7 @@ import { MetadataRepresentationType } from '../../../../core/shared/metadata-rep
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Element, MetadataRepresentationType.Item)
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Summary, MetadataRepresentationType.Item)
|
||||
@Component({
|
||||
selector: 'ds-orgunit-metadata-list-element',
|
||||
templateUrl: './orgunit-metadata-list-element.component.html'
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('Person', ItemViewMode.Element)
|
||||
@rendersItemType('Person', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-person-list-element',
|
||||
styleUrls: ['./person-list-element.component.scss'],
|
||||
|
@@ -3,7 +3,7 @@ import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-typ
|
||||
import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('Person', ItemViewMode.Element, MetadataRepresentationType.Item)
|
||||
@rendersItemType('Person', ItemViewMode.Summary, MetadataRepresentationType.Item)
|
||||
@Component({
|
||||
selector: 'ds-person-metadata-list-element',
|
||||
templateUrl: './person-metadata-list-element.component.html'
|
||||
|
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
||||
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('Project', ItemViewMode.Element)
|
||||
@rendersItemType('Project', ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-project-list-element',
|
||||
styleUrls: ['./project-list-element.component.scss'],
|
||||
|
@@ -6,7 +6,7 @@ import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Full)
|
||||
@rendersItemType('OrgUnit', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-orgunit',
|
||||
styleUrls: ['./orgunit.component.scss'],
|
||||
|
@@ -8,7 +8,7 @@ import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/i
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
import { getQueryByRelations } from '../../../../shared/utils/relation-query.utils';
|
||||
|
||||
@rendersItemType('Person', ItemViewMode.Full)
|
||||
@rendersItemType('Person', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-person',
|
||||
styleUrls: ['./person.component.scss'],
|
||||
|
@@ -7,7 +7,7 @@ import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
|
||||
import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
|
||||
@rendersItemType('Project', ItemViewMode.Full)
|
||||
@rendersItemType('Project', ItemViewMode.Detail)
|
||||
@Component({
|
||||
selector: 'ds-project',
|
||||
styleUrls: ['./project.component.scss'],
|
||||
|
@@ -59,8 +59,7 @@
|
||||
(click)="removeSelection(result)">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<span class="d-inline-block align-middle ml-1">{{v | dsObjectKeys}}</span>
|
||||
<span class="d-inline-block align-middle ml-1"><ds-item-type-switcher [object]="result" [viewMode]="ItemViewMode.Metadata"></ds-item-type-switcher></span>
|
||||
<span class="d-inline-block align-middle ml-1"><ds-item-type-switcher [object]="result" [viewMode]="itemViewMode.Summary"></ds-item-type-switcher></span>
|
||||
</ng-container>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -80,6 +80,7 @@ import { SelectableListService } from '../../../object-list/selectable-list/sele
|
||||
import { DsDynamicDisabledComponent } from './models/disabled/dynamic-disabled.component';
|
||||
import { DYNAMIC_FORM_CONTROL_TYPE_DISABLED } from './models/disabled/dynamic-disabled.model';
|
||||
import { DsDynamicLookupRelationModalComponent } from './lookup-modal/dynamic-lookup-relation-modal.component';
|
||||
import { ItemViewMode } from '../../../items/item-type-decorator';
|
||||
|
||||
export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type<DynamicFormControl> | null {
|
||||
switch (model.type) {
|
||||
@@ -151,7 +152,7 @@ export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type<
|
||||
changeDetection: ChangeDetectionStrategy.Default
|
||||
})
|
||||
export class DsDynamicFormControlContainerComponent extends DynamicFormControlContainerComponent implements OnInit, OnChanges {
|
||||
ItemViewMode;
|
||||
itemViewMode = ItemViewMode;
|
||||
@ContentChildren(DynamicTemplateDirective) contentTemplateList: QueryList<DynamicTemplateDirective>;
|
||||
// tslint:disable-next-line:no-input-rename
|
||||
@Input('templates') inputTemplateList: QueryList<DynamicTemplateDirective>;
|
||||
|
@@ -2,13 +2,13 @@ import { hasNoValue, hasValue } from '../empty.util';
|
||||
import { MetadataRepresentationType } from '../../core/shared/metadata-representation/metadata-representation.model';
|
||||
|
||||
export enum ItemViewMode {
|
||||
Element = 'element',
|
||||
Full = 'full',
|
||||
Summary = 'summary',
|
||||
Detail = 'detail',
|
||||
Metadata = 'metadata'
|
||||
}
|
||||
|
||||
export const DEFAULT_ITEM_TYPE = 'Default';
|
||||
export const DEFAULT_VIEW_MODE = ItemViewMode.Element;
|
||||
export const DEFAULT_VIEW_MODE = ItemViewMode.Summary;
|
||||
export const NO_REPRESENTATION_TYPE = MetadataRepresentationType.None;
|
||||
export const DEFAULT_REPRESENTATION_TYPE = MetadataRepresentationType.PlainText;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
const mockItemMetadataRepresentation = Object.assign(new ItemMetadataRepresentation(), mockItem);
|
||||
let viewMode = ItemViewMode.Full;
|
||||
let viewMode = ItemViewMode.Detail;
|
||||
|
||||
describe('ItemTypeSwitcherComponent', () => {
|
||||
let comp: ItemTypeSwitcherComponent;
|
||||
@@ -53,7 +53,7 @@ describe('ItemTypeSwitcherComponent', () => {
|
||||
|
||||
describe('when the injected object is of type Item', () => {
|
||||
beforeEach(() => {
|
||||
viewMode = ItemViewMode.Full;
|
||||
viewMode = ItemViewMode.Detail;
|
||||
comp.object = mockItem;
|
||||
comp.viewMode = viewMode;
|
||||
});
|
||||
|
@@ -18,5 +18,5 @@ import { ItemViewMode } from '../../items/item-type-decorator';
|
||||
*/
|
||||
@renderElementsFor(Item, SetViewMode.List)
|
||||
export class ItemListElementComponent extends AbstractListableElementComponent<Item> {
|
||||
viewMode = ItemViewMode.Element;
|
||||
viewMode = ItemViewMode.Summary;
|
||||
}
|
||||
|
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
|
||||
import { DEFAULT_ITEM_TYPE, ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator';
|
||||
import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component';
|
||||
|
||||
@rendersItemType('Publication', ItemViewMode.Element)
|
||||
@rendersItemType(DEFAULT_ITEM_TYPE, ItemViewMode.Element)
|
||||
@rendersItemType('Publication', ItemViewMode.Summary)
|
||||
@rendersItemType(DEFAULT_ITEM_TYPE, ItemViewMode.Summary)
|
||||
@Component({
|
||||
selector: 'ds-publication-list-element',
|
||||
styleUrls: ['./publication-list-element.component.scss'],
|
||||
|
@@ -18,5 +18,5 @@ export class ItemMetadataListElementComponent extends MetadataRepresentationList
|
||||
* The view-mode we're currently on
|
||||
* @type {ElementViewMode}
|
||||
*/
|
||||
viewMode = ItemViewMode.Element;
|
||||
viewMode = ItemViewMode.Summary;
|
||||
}
|
||||
|
@@ -20,6 +20,6 @@ import { ItemViewMode } from '../../../items/item-type-decorator';
|
||||
|
||||
@renderElementsFor(ItemSearchResult, SetViewMode.List)
|
||||
export class ItemSearchResultListElementComponent extends SearchResultListElementComponent<ItemSearchResult, Item> {
|
||||
viewMode = ItemViewMode.Element;
|
||||
viewMode = ItemViewMode.Summary;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user