dataverse-client-javascript icon indicating copy to clipboard operation
dataverse-client-javascript copied to clipboard

Collection facets and Facetable field with parent metadata block info

Open g-saracca opened this issue 1 year ago • 0 comments

For the SPA, we need that both getCollectionFacets and the getAllFacetableMetadataFields use cases, include in their response objects a property with the information about the parent block name. This is because the Transfer List within the Create/Edit Collection page needs to have a selector to filter the available facetable fields by the metadata block they belong.

Something perhaps with this model:

interface ParentMetadataBlockInfo {
  id: number
  name: string
  displayName: string
}

For the getCollectionFacets use case response, the updated object could look like this:

export interface CollectionFacet {
  id: number
  name: string
  displayName: string
  👉 parentMetadataBlockInfo: ParentMetadataBlockInfo
}

And for the getAllFacetableMetadataFields use case, could look like this:

export interface MetadataFieldInfo {
  name: string
  displayName: string
  title: string
  type: MetadataFieldType
  typeClass: MetadataFieldTypeClass
  watermark: MetadataFieldWatermark
  description: string
  multiple: boolean
  isControlledVocabulary: boolean
  controlledVocabularyValues?: string[]
  displayFormat: string
  childMetadataFields?: Record<string, MetadataFieldInfo>
  isRequired: boolean
  displayOrder: number
  displayOnCreate: boolean
  👉 parentMetadataBlockInfo: ParentMetadataBlockInfo
}

g-saracca avatar Aug 05 '24 12:08 g-saracca