From 02311af9e1e6de00433d05ee1f42133bd0bac126 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 17 Feb 2023 12:38:53 +0700 Subject: [PATCH] TSK-679: Add Whatsapp (#2651) TSK-679: Add Whatsapp Signed-off-by: Andrey Sobolev --- models/contact/src/index.ts | 12 ++++++++++++ models/contact/src/plugin.ts | 4 +++- plugins/contact-assets/lang/en.json | 4 +++- plugins/contact-assets/lang/ru.json | 4 +++- plugins/contact-assets/src/index.ts | 3 ++- plugins/contact/src/index.ts | 6 ++++-- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index c42ee0a578..14f8d58aa2 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -393,6 +393,18 @@ export function createModel (builder: Builder): void { contact.channelProvider.Homepage ) + builder.createDoc( + contact.class.ChannelProvider, + core.space.Model, + { + label: contact.string.Whatsapp, + icon: contact.icon.Whatsapp, + placeholder: contact.string.WhatsappPlaceholder, + action: contact.actionImpl.OpenChannel + }, + contact.channelProvider.Whatsapp + ) + builder.createDoc( contact.class.AvatarProvider, core.space.Model, diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index bd8cbafdc7..1a701419fc 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -72,7 +72,9 @@ export default mergeIds(contactId, contact, { TypeLabel: '' as IntlString, Homepage: '' as IntlString, Birthday: '' as IntlString, - CreatedOn: '' as IntlString + CreatedOn: '' as IntlString, + Whatsapp: '' as IntlString, + WhatsappPlaceholder: '' as IntlString }, completion: { PersonQuery: '' as Resource, diff --git a/plugins/contact-assets/lang/en.json b/plugins/contact-assets/lang/en.json index e446ddc0ff..21e074e6b1 100644 --- a/plugins/contact-assets/lang/en.json +++ b/plugins/contact-assets/lang/en.json @@ -74,6 +74,8 @@ "UseGravatar": "Use Gravatar", "UseColor": "Use color", "NotSpecified": "Not specified", - "CreatedOn": "Created" + "CreatedOn": "Created", + "Whatsapp": "Whatsapp", + "WhatsappPlaceholder": "Whatsapp" } } \ No newline at end of file diff --git a/plugins/contact-assets/lang/ru.json b/plugins/contact-assets/lang/ru.json index 62c78b4eed..cf8c4f9caf 100644 --- a/plugins/contact-assets/lang/ru.json +++ b/plugins/contact-assets/lang/ru.json @@ -74,6 +74,8 @@ "UseGravatar": "Использовать Gravatar", "UseColor": "Использовать цвет", "NotSpecified": "Не указан", - "CreatedOn": "Создан" + "CreatedOn": "Создан", + "Whatsapp": "Whatsapp", + "WhatsappPlaceholder": "Whatsapp" } } \ No newline at end of file diff --git a/plugins/contact-assets/src/index.ts b/plugins/contact-assets/src/index.ts index 38a9b0a17e..c509f78d1c 100644 --- a/plugins/contact-assets/src/index.ts +++ b/plugins/contact-assets/src/index.ts @@ -35,6 +35,7 @@ loadMetadata(contact.icon, { Person: `${icons}#person`, Company: `${icons}#company`, SocialEdit: `${icons}#social-edit`, - Homepage: `${icons}#homepage` + Homepage: `${icons}#homepage`, + Whatsapp: `${icons}#whatsapp` }) addStringsLoader(contactId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts index c9563767c8..305b74ec51 100644 --- a/plugins/contact/src/index.ts +++ b/plugins/contact/src/index.ts @@ -230,7 +230,8 @@ const contactPlugin = plugin(contactId, { Telegram: '' as Ref, GitHub: '' as Ref, Facebook: '' as Ref, - Homepage: '' as Ref + Homepage: '' as Ref, + Whatsapp: '' as Ref }, avatarProvider: { Color: '' as Ref, @@ -260,7 +261,8 @@ const contactPlugin = plugin(contactId, { Person: '' as Asset, Company: '' as Asset, SocialEdit: '' as Asset, - Homepage: '' as Asset + Homepage: '' as Asset, + Whatsapp: '' as Asset }, space: { Employee: '' as Ref,