Add Contact info presenter (#1985)

* Add Contact info presenter

Signed-off-by: Anna No <anna.no@xored.com>

* Update error message

Signed-off-by: Anna No <anna.no@xored.com>

* Add Contact info presenter

Signed-off-by: Anna No <anna.no@xored.com>

* fix formatting

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2022-06-02 14:59:59 +07:00 committed by GitHub
parent 85220551aa
commit 27ef52a9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -201,6 +201,10 @@ export function createModel (builder: Builder): void {
editor: contact.component.PersonEditor
})
builder.mixin(contact.class.Channel, core.class.Class, view.mixin.AttributePresenter, {
presenter: contact.component.ChannelsPresenter
})
builder.mixin(contact.class.Channel, core.class.Class, view.mixin.CollectionPresenter, {
presenter: contact.component.ChannelsPresenter
})

View File

@ -61,7 +61,9 @@ export async function getObjectPresenter (
mixinClazz = hierarchy.getClass(mixinClazz.extends)
}
if (presenterMixin.presenter === undefined) {
throw new Error('object presenter not found for ' + JSON.stringify(preserveKey))
throw new Error(
`object presenter not found for class=${_class}, mixin=${mixin}, preserve key ${JSON.stringify(preserveKey)}`
)
}
const presenter = await getResource(presenterMixin.presenter)
const key = preserveKey.sortingKey ?? preserveKey.key