Support facebook channel (#915)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-02-02 20:25:16 +07:00 committed by GitHub
parent d8219734aa
commit 06756881fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -208,6 +208,17 @@ export function createModel (builder: Builder): void {
contact.channelProvider.GitHub
)
builder.createDoc(
contact.class.ChannelProvider,
core.space.Model,
{
label: 'Facebook' as IntlString,
icon: contact.icon.Facebook,
placeholder: '' as IntlString
},
contact.channelProvider.Facebook
)
builder.createDoc(
core.class.Space,
core.space.Model,

View File

@ -19,13 +19,13 @@
export interface ReconiDocument {
firstName: string
lastName: string
title?: string
avatar?: string
email?: string
phone?: string
city?: string
skype?: string
linkedin?: string
gmail?: string
github?: string
facebook?: string
telegram?: string

View File

@ -139,7 +139,8 @@ export default plugin(contactId, {
LinkedIn: '' as Ref<ChannelProvider>,
Twitter: '' as Ref<ChannelProvider>,
Telegram: '' as Ref<ChannelProvider>,
GitHub: '' as Ref<ChannelProvider>
GitHub: '' as Ref<ChannelProvider>,
Facebook: '' as Ref<ChannelProvider>
},
icon: {
Phone: '' as Asset,

View File

@ -139,6 +139,10 @@
try {
const doc = await recognizeDocument(token, fileUrl)
if (isUndef(object.title) && doc.title !== undefined) {
object.title = doc.title
}
if (isUndef(firstName) && doc.firstName !== undefined) {
firstName = doc.firstName
}
@ -169,6 +173,7 @@
addChannel(newChannels, contact.channelProvider.Phone, doc.phone)
addChannel(newChannels, contact.channelProvider.Telegram, doc.telegram)
addChannel(newChannels, contact.channelProvider.Twitter, doc.twitter)
addChannel(newChannels, contact.channelProvider.Facebook, doc.facebook)
channels = newChannels
console.log(doc, channels)