From d31ca9960da4024d731ce49b72920df7a24a4431 Mon Sep 17 00:00:00 2001 From: "Leon.Schmidt" Date: Sat, 15 Aug 2026 15:35:28 +0200 Subject: [PATCH] FIX - map company contacts from config Use each company definition's validated HTTPS LogoUrl for automatic Phone contacts and populate Company or Group with the configured company name. Keep uploaded company logos as profile overrides, update browser mocks and tests, and document the required LogoUrl config field. --- frontend/src/stores/calls.test.ts | 29 +++++++++++++++++++++++++++ frontend/src/types/phone.ts | 1 - frontend/src/views/apps/PhoneApp.vue | 18 ++++++++--------- frontend/testserver/index.cjs | 9 ++++++--- sky_phone/config/companies.lua | 5 +++++ sky_phone/source/server/companies.lua | 8 ++++++-- 6 files changed, 55 insertions(+), 15 deletions(-) diff --git a/frontend/src/stores/calls.test.ts b/frontend/src/stores/calls.test.ts index e8df8f4..8fc9c80 100644 --- a/frontend/src/stores/calls.test.ts +++ b/frontend/src/stores/calls.test.ts @@ -166,4 +166,33 @@ describe('calls store', () => { expect(nuiCall).toHaveBeenNthCalledWith(2, 'contacts:list') expect(calls.contacts[0]?.favorite).toBe(true) }) + + it('keeps configured company branding on system contacts', async () => { + vi.mocked(nuiCall).mockResolvedValueOnce({ + success: true, + data: [ + { + avatar_url: + 'https://picsum.photos/seed/companies-police-logo/180/180', + companyId: 'police', + id: 'company:police', + name: 'Los Santos Police Department', + organization: 'Los Santos Police Department', + phone_number: '911', + readonly: true, + source: 'company', + }, + ], + }) + const calls = useCallsStore() + + await calls.loadContacts() + + expect(calls.contacts[0]).toMatchObject({ + avatar_url: + 'https://picsum.photos/seed/companies-police-logo/180/180', + organization: 'Los Santos Police Department', + source: 'company', + }) + }) }) diff --git a/frontend/src/types/phone.ts b/frontend/src/types/phone.ts index bf9016a..3c88d55 100644 --- a/frontend/src/types/phone.ts +++ b/frontend/src/types/phone.ts @@ -17,7 +17,6 @@ export type PhoneContact = { created_at?: string favorite?: boolean | number id: string - icon?: string name: string notes?: string | null organization?: string | null diff --git a/frontend/src/views/apps/PhoneApp.vue b/frontend/src/views/apps/PhoneApp.vue index a3a4fc8..9d74b98 100644 --- a/frontend/src/views/apps/PhoneApp.vue +++ b/frontend/src/views/apps/PhoneApp.vue @@ -280,7 +280,7 @@ function openContact(contact?: PhoneContact, number = ''): void { contactNotes.value = contact?.notes ?? '' contactNumber.value = contact?.phone_number ?? number contactAvatarMediaId.value = contact?.avatar_media_id ?? null - contactAvatarUrl.value = contact?.avatar_url ?? contact?.icon ?? '' + contactAvatarUrl.value = contact?.avatar_url ?? '' error.value = '' editorOpened.value = true } @@ -971,8 +971,8 @@ onBeforeUnmount(() => {
{{ @@ -1297,8 +1297,8 @@ onBeforeUnmount(() => { >