diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 06671e0809..78a2b1a408 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -65,7 +65,7 @@ "id": "ID", "expectedcompletion": "Expected Completion", "description": "Description", - "keywords": "Keywords" + "keyword": "Keywords" } }, "orgunit": { diff --git a/src/app/+item-page/item-page.module.ts b/src/app/+item-page/item-page.module.ts index d903baf8f7..fdf9d19674 100644 --- a/src/app/+item-page/item-page.module.ts +++ b/src/app/+item-page/item-page.module.ts @@ -19,11 +19,11 @@ import { FileSectionComponent } from './simple/field-components/file-section/fil import { CollectionsComponent } from './field-components/collections/collections.component'; import { FullItemPageComponent } from './full/full-item-page.component'; import { FullFileSectionComponent } from './full/field-components/file-section/full-file-section.component'; -import { ItemPageFieldsComponent } from './simple/relationship-types/item/item-page-fields.component'; -import { OrgUnitPageFieldsComponent } from './simple/relationship-types/orgunit/orgunit-page-fields.component'; -import { PersonPageFieldsComponent } from './simple/relationship-types/person/person-page-fields.component'; -import { ProjectPageFieldsComponent } from './simple/relationship-types/project/project-page-fields.component'; -import { RelationshipTypeSwitcherComponent } from './simple/relationship-types/switcher/relationship-type-switcher.component'; +import { ItemPageFieldsComponent } from './simple/entity-types/item/item-page-fields.component'; +import { OrgUnitPageFieldsComponent } from './simple/entity-types/orgunit/orgunit-page-fields.component'; +import { PersonPageFieldsComponent } from './simple/entity-types/person/person-page-fields.component'; +import { ProjectPageFieldsComponent } from './simple/entity-types/project/project-page-fields.component'; +import { EntityTypeSwitcherComponent } from './simple/entity-types/switcher/entity-type-switcher.component'; @NgModule({ imports: [ @@ -46,7 +46,7 @@ import { RelationshipTypeSwitcherComponent } from './simple/relationship-types/s FileSectionComponent, CollectionsComponent, FullFileSectionComponent, - RelationshipTypeSwitcherComponent, + EntityTypeSwitcherComponent, ItemPageFieldsComponent, ProjectPageFieldsComponent, OrgUnitPageFieldsComponent, diff --git a/src/app/+item-page/simple/relationship-types/item/item-page-fields.component.html b/src/app/+item-page/simple/entity-types/item/item-page-fields.component.html similarity index 100% rename from src/app/+item-page/simple/relationship-types/item/item-page-fields.component.html rename to src/app/+item-page/simple/entity-types/item/item-page-fields.component.html diff --git a/src/app/+item-page/simple/relationship-types/item/item-page-fields.component.scss b/src/app/+item-page/simple/entity-types/item/item-page-fields.component.scss similarity index 100% rename from src/app/+item-page/simple/relationship-types/item/item-page-fields.component.scss rename to src/app/+item-page/simple/entity-types/item/item-page-fields.component.scss diff --git a/src/app/+item-page/simple/relationship-types/item/item-page-fields.component.ts b/src/app/+item-page/simple/entity-types/item/item-page-fields.component.ts similarity index 61% rename from src/app/+item-page/simple/relationship-types/item/item-page-fields.component.ts rename to src/app/+item-page/simple/entity-types/item/item-page-fields.component.ts index 39333503cb..90504812d7 100644 --- a/src/app/+item-page/simple/relationship-types/item/item-page-fields.component.ts +++ b/src/app/+item-page/simple/entity-types/item/item-page-fields.component.ts @@ -1,14 +1,14 @@ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { - DEFAULT_RELATIONSHIP_TYPE, - rendersRelationshipType -} from '../../../../shared/entities/relationship-type-decorator'; + DEFAULT_ENTITY_TYPE, + rendersEntityType +} from '../../../../shared/entities/entity-type-decorator'; import { ElementViewMode } from '../../../../shared/view-mode'; -import { ITEM } from '../switcher/relationship-type-switcher.component'; +import { ITEM } from '../switcher/entity-type-switcher.component'; -@rendersRelationshipType('Item', ElementViewMode.Full) -@rendersRelationshipType(DEFAULT_RELATIONSHIP_TYPE, ElementViewMode.Full) +@rendersEntityType('Item', ElementViewMode.Full) +@rendersEntityType(DEFAULT_ENTITY_TYPE, ElementViewMode.Full) @Component({ selector: 'ds-item-page-fields', styleUrls: ['./item-page-fields.component.scss'], diff --git a/src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.html b/src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.html similarity index 100% rename from src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.html rename to src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.html diff --git a/src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.scss b/src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.scss similarity index 100% rename from src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.scss rename to src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.scss diff --git a/src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.ts b/src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.ts similarity index 65% rename from src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.ts rename to src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.ts index d65b51ad7e..97a0d4f477 100644 --- a/src/app/+item-page/simple/relationship-types/orgunit/orgunit-page-fields.component.ts +++ b/src/app/+item-page/simple/entity-types/orgunit/orgunit-page-fields.component.ts @@ -1,10 +1,10 @@ import { Component, Inject } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; -import { rendersRelationshipType } from '../../../../shared/entities/relationship-type-decorator'; +import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator'; import { ElementViewMode } from '../../../../shared/view-mode'; -import { ITEM } from '../switcher/relationship-type-switcher.component'; +import { ITEM } from '../switcher/entity-type-switcher.component'; -@rendersRelationshipType('OrgUnit', ElementViewMode.Full) +@rendersEntityType('OrgUnit', ElementViewMode.Full) @Component({ selector: 'ds-orgunit-page-fields', styleUrls: ['./orgunit-page-fields.component.scss'], diff --git a/src/app/+item-page/simple/relationship-types/person/person-page-fields.component.html b/src/app/+item-page/simple/entity-types/person/person-page-fields.component.html similarity index 100% rename from src/app/+item-page/simple/relationship-types/person/person-page-fields.component.html rename to src/app/+item-page/simple/entity-types/person/person-page-fields.component.html diff --git a/src/app/+item-page/simple/relationship-types/person/person-page-fields.component.scss b/src/app/+item-page/simple/entity-types/person/person-page-fields.component.scss similarity index 100% rename from src/app/+item-page/simple/relationship-types/person/person-page-fields.component.scss rename to src/app/+item-page/simple/entity-types/person/person-page-fields.component.scss diff --git a/src/app/+item-page/simple/relationship-types/person/person-page-fields.component.ts b/src/app/+item-page/simple/entity-types/person/person-page-fields.component.ts similarity index 65% rename from src/app/+item-page/simple/relationship-types/person/person-page-fields.component.ts rename to src/app/+item-page/simple/entity-types/person/person-page-fields.component.ts index fc89cd8644..ec0577426c 100644 --- a/src/app/+item-page/simple/relationship-types/person/person-page-fields.component.ts +++ b/src/app/+item-page/simple/entity-types/person/person-page-fields.component.ts @@ -1,10 +1,10 @@ import { Component, Inject } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; -import { rendersRelationshipType } from '../../../../shared/entities/relationship-type-decorator'; +import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator'; import { ElementViewMode } from '../../../../shared/view-mode'; -import { ITEM } from '../switcher/relationship-type-switcher.component'; +import { ITEM } from '../switcher/entity-type-switcher.component'; -@rendersRelationshipType('Person', ElementViewMode.Full) +@rendersEntityType('Person', ElementViewMode.Full) @Component({ selector: 'ds-person-page-fields', styleUrls: ['./person-page-fields.component.scss'], diff --git a/src/app/+item-page/simple/relationship-types/project/project-page-fields.component.html b/src/app/+item-page/simple/entity-types/project/project-page-fields.component.html similarity index 93% rename from src/app/+item-page/simple/relationship-types/project/project-page-fields.component.html rename to src/app/+item-page/simple/entity-types/project/project-page-fields.component.html index ccf342c867..65a7c7f270 100644 --- a/src/app/+item-page/simple/relationship-types/project/project-page-fields.component.html +++ b/src/app/+item-page/simple/entity-types/project/project-page-fields.component.html @@ -25,8 +25,8 @@ [label]="'project.page.description'"> + [fields]="['project.identifier.keyword']" + [label]="'project.page.keyword'"> diff --git a/src/app/+item-page/simple/relationship-types/project/project-page-fields.component.scss b/src/app/+item-page/simple/entity-types/project/project-page-fields.component.scss similarity index 100% rename from src/app/+item-page/simple/relationship-types/project/project-page-fields.component.scss rename to src/app/+item-page/simple/entity-types/project/project-page-fields.component.scss diff --git a/src/app/+item-page/simple/relationship-types/project/project-page-fields.component.ts b/src/app/+item-page/simple/entity-types/project/project-page-fields.component.ts similarity index 65% rename from src/app/+item-page/simple/relationship-types/project/project-page-fields.component.ts rename to src/app/+item-page/simple/entity-types/project/project-page-fields.component.ts index da9a4416b7..f6e93dcfa6 100644 --- a/src/app/+item-page/simple/relationship-types/project/project-page-fields.component.ts +++ b/src/app/+item-page/simple/entity-types/project/project-page-fields.component.ts @@ -1,10 +1,10 @@ import { Component, Inject } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; -import { rendersRelationshipType } from '../../../../shared/entities/relationship-type-decorator'; +import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator'; import { ElementViewMode } from '../../../../shared/view-mode'; -import { ITEM } from '../switcher/relationship-type-switcher.component'; +import { ITEM } from '../switcher/entity-type-switcher.component'; -@rendersRelationshipType('Project', ElementViewMode.Full) +@rendersEntityType('Project', ElementViewMode.Full) @Component({ selector: 'ds-project-page-fields', styleUrls: ['./project-page-fields.component.scss'], diff --git a/src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.html b/src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.html similarity index 100% rename from src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.html rename to src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.html diff --git a/src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.scss b/src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.scss similarity index 100% rename from src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.scss rename to src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.scss diff --git a/src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.ts b/src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.ts similarity index 71% rename from src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.ts rename to src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.ts index cb7293f514..d2e2374e8e 100644 --- a/src/app/+item-page/simple/relationship-types/switcher/relationship-type-switcher.component.ts +++ b/src/app/+item-page/simple/entity-types/switcher/entity-type-switcher.component.ts @@ -1,7 +1,7 @@ import { Component, InjectionToken, Injector, Input, OnInit } from '@angular/core'; import { GenericConstructor } from '../../../../core/shared/generic-constructor'; import { Item } from '../../../../core/shared/item.model'; -import { getComponentByRelationshipType } from '../../../../shared/entities/relationship-type-decorator'; +import { getComponentByEntityType } from '../../../../shared/entities/entity-type-decorator'; import { rendersDSOType } from '../../../../shared/object-collection/shared/dso-element-decorator'; import { ListableObject } from '../../../../shared/object-collection/shared/listable-object.model'; import { ElementViewMode, SetViewMode } from '../../../../shared/view-mode'; @@ -9,11 +9,11 @@ import { ElementViewMode, SetViewMode } from '../../../../shared/view-mode'; export const ITEM: InjectionToken = new InjectionToken('item'); @Component({ - selector: 'ds-relationship-type-switcher', - styleUrls: ['./relationship-type-switcher.component.scss'], - templateUrl: './relationship-type-switcher.component.html' + selector: 'ds-entity-type-switcher', + styleUrls: ['./entity-type-switcher.component.scss'], + templateUrl: './entity-type-switcher.component.html' }) -export class RelationshipTypeSwitcherComponent implements OnInit { +export class EntityTypeSwitcherComponent implements OnInit { @Input() item: Item; @Input() viewMode: ElementViewMode; objectInjector: Injector; @@ -31,6 +31,6 @@ export class RelationshipTypeSwitcherComponent implements OnInit { getComponent(): string { const type = this.item.findMetadata('relationship.type'); - return getComponentByRelationshipType(type, this.viewMode); + return getComponentByEntityType(type, this.viewMode); } } diff --git a/src/app/+item-page/simple/item-page.component.html b/src/app/+item-page/simple/item-page.component.html index a6dd4a47a1..7c75887f38 100644 --- a/src/app/+item-page/simple/item-page.component.html +++ b/src/app/+item-page/simple/item-page.component.html @@ -1,7 +1,7 @@
- +
diff --git a/src/app/shared/entities/relationship-type-decorator.ts b/src/app/shared/entities/entity-type-decorator.ts similarity index 67% rename from src/app/shared/entities/relationship-type-decorator.ts rename to src/app/shared/entities/entity-type-decorator.ts index ee91ad4970..60bdab7412 100644 --- a/src/app/shared/entities/relationship-type-decorator.ts +++ b/src/app/shared/entities/entity-type-decorator.ts @@ -1,10 +1,10 @@ import { hasNoValue, hasValue } from '../empty.util'; import { ElementViewMode } from '../view-mode'; -export const DEFAULT_RELATIONSHIP_TYPE = 'Default'; +export const DEFAULT_ENTITY_TYPE = 'Default'; const map = new Map(); -export function rendersRelationshipType(type: string, viewMode: ElementViewMode) { +export function rendersEntityType(type: string, viewMode: ElementViewMode) { return function decorator(component: any) { if (hasNoValue(map.get(viewMode))) { map.set(viewMode, new Map()); @@ -16,10 +16,10 @@ export function rendersRelationshipType(type: string, viewMode: ElementViewMode) }; } -export function getComponentByRelationshipType(type: string, viewMode: ElementViewMode) { +export function getComponentByEntityType(type: string, viewMode: ElementViewMode) { let component = map.get(viewMode).get(type); if (hasNoValue(component)) { - component = map.get(viewMode).get(DEFAULT_RELATIONSHIP_TYPE); + component = map.get(viewMode).get(DEFAULT_ENTITY_TYPE); } return component; }