Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@nethesis/nethesis-brands-svg-icons": "github:nethesis/Font-Awesome#ns-brands",
"@nethesis/nethesis-light-svg-icons": "github:nethesis/Font-Awesome#ns-light",
"@nethesis/nethesis-solid-svg-icons": "github:nethesis/Font-Awesome#ns-solid",
"@nethesis/phone-island": "^0.18.13",
"@nethesis/phone-island": "^1.0.0-dev.10",
"@tailwindcss/forms": "^0.5.7",
"@types/lodash": "^4.14.202",
"@types/node": "^18.19.9",
Expand Down
14 changes: 13 additions & 1 deletion public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"lost_call_body": "You received a call from {{number}} at {{datetime}}",
"physical_phone_error": "the phone {{phone}} is not reachable. Make sure it is connected",
"call_transferred_title": "Call transferred",
"call_transferred_body": "The call was succesfully transferred"
"call_transferred_body": "The call was succesfully transferred",
"call_summary_ready_title": "Call summary ready",
"call_summary_ready_body": "The summary is ready for review and editing",
"call_summary_ready_body_with_contact": "The summary of your call with {{contact}} is ready"
},
"Phonebook": {
"Phonebook": "Phonebook",
Expand Down Expand Up @@ -333,6 +336,7 @@
"Delete profile picture": "Delete profile picture",
"Devices": "Audio and Video",
"IncomingCalls": "Incoming Calls",
"Notifications": "Notifications",
"Ringtone": "Ringtone",
"Time preferences": "Time preferences",
"Login/logout preferences": "Login/logout preferences",
Expand All @@ -349,6 +353,14 @@
"Only nethlink": "Only Nethlink",
"ShortcutToCall": "Shortcut to Call",
"CommandBarShortcut": "Shortcut for Command Bar",
"NotificationsDescription": "Manage notifications for call features and AI-generated content.",
"NotificationsScopeDescription": "Settings apply to web phone and desktop app.",
"CallSummaryNotifications": "Call summary notifications",
"CallSummaryNotificationsDescription": "Receive an operating system notification when a call summary is ready.",
"CallSummaryNotificationsSaveError": "Unable to save notification preferences.",
"CallTranscriptionReady": "Call transcription ready",
"Enabled": "Enabled",
"Disabled": "Disabled",
"ShortcutHelp": "Enter a keyboard shortcut to start a call after selecting some text.",
"ShortcutHelpDesc": "Unsupported keys: \"Tab\", \"CapsLock\", \"NumLock\", \"Insert\", \"Escape\", \"Shift\".",
"Clear and remove shortcut": "Clear and remove shortcut"
Expand Down
14 changes: 13 additions & 1 deletion public/locales/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"lost_call_body": "Hai ricevuto una chiamata da {{number}} alle {{datetime}}",
"physical_phone_error": "Il telefono {{phone}} non è raggiungibile. Assicurarsi che sia collegato",
"call_transferred_title": "Traferimento di chiamata",
"call_transferred_body": "La chiamata è stata trasferita con successo"
"call_transferred_body": "La chiamata è stata trasferita con successo",
"call_summary_ready_title": "Riepilogo chiamata pronto",
"call_summary_ready_body": "Il riepilogo e' pronto per la revisione e la modifica",
"call_summary_ready_body_with_contact": "Il riepilogo della tua chiamata con {{contact}} e' pronto"
},
"Phonebook": {
"Phonebook": "Rubrica",
Expand Down Expand Up @@ -333,6 +336,7 @@
"Delete profile picture": "Elimina immagine profilo",
"Devices": "Audio e Video",
"IncomingCalls": "Chiamate in Arrivo",
"Notifications": "Notifiche",
"Ringtone": "Suoneria",
"Time preferences": "Preferenze di tempo",
"Login/logout preferences": "Preferenze di entrata/uscita",
Expand All @@ -349,6 +353,14 @@
"Only nethlink": "Solo Nethlink",
"ShortcutToCall": "Scorciatoia per Chiamare",
"CommandBarShortcut": "Scorciatoia per Command Bar",
"NotificationsDescription": "Gestisci le notifiche per le funzioni di chiamata e i contenuti generati dall'AI.",
"NotificationsScopeDescription": "Le impostazioni si applicano al web phone e all'app desktop.",
"CallSummaryNotifications": "Notifica riassunto chiamata",
"CallSummaryNotificationsDescription": "Ricevi una notifica di sistema operativo quando il riassunto della chiamata e' pronto.",
"CallSummaryNotificationsSaveError": "Impossibile salvare le preferenze di notifica.",
"CallTranscriptionReady": "Trascrizione chiamata pronta",
"Enabled": "Attivato",
"Disabled": "Disattivato",
"ShortcutHelp": "Inserisci una scorciatoia da tastiera per far partire una chiamata dopo aver selezionato un testo.",
"ShortcutHelpDesc": "Caratteri non consentiti: \"Tab\", \"CapsLock\", \"NumLock\", \"Insert\", \"Escape\", \"Shift\".",
"Clear and remove shortcut": "Ripristina e rimuovi scorciatoia"
Expand Down
25 changes: 22 additions & 3 deletions src/main/lib/ipcEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { PhoneIslandController } from '@/classes/controllers/PhoneIslandControll
import { CommandBarController } from '@/classes/controllers/CommandBarController'
import { IPC_EVENTS } from '@shared/constants'
import { Account, OnDraggingWindow, PAGES } from '@shared/types'
import { BrowserWindow, app, ipcMain, screen, shell, desktopCapturer, globalShortcut, clipboard } from 'electron'
import { join } from 'path'
import { BrowserWindow, app, ipcMain, screen, shell, desktopCapturer, globalShortcut, clipboard, Notification } from 'electron'
import { Log } from '@shared/utils/logger'
import { NethLinkController } from '@/classes/controllers/NethLinkController'
import { AppController } from '@/classes/controllers/AppController'
Expand Down Expand Up @@ -69,6 +68,10 @@ function isUserLoggedIn(): boolean {
return !!store.store.account
}

function buildHostUrl(host: string, path: string): string {
return new URL(path, `https://${host}`).toString()
}

// Keep exactly one Command Bar shortcut active at a time.
let activeCommandBarAccelerator: string | undefined
let activeCommandBarLastTrigger = 0
Expand Down Expand Up @@ -255,13 +258,29 @@ export function registerIpcEvents() {

ipcMain.on(IPC_EVENTS.OPEN_HOST_PAGE, async (_, path) => {
const account = store.store.account
shell.openExternal(join('https://' + account!.host, path))
shell.openExternal(buildHostUrl(account!.host, path))
})

ipcMain.on(IPC_EVENTS.OPEN_EXTERNAL_PAGE, async (event, path) => {
shell.openExternal(path)
})

ipcMain.on(IPC_EVENTS.SEND_NOTIFICATION, async (_, title, options, openPath) => {
const notification = new Notification({
title,
...options,
})

notification.on('click', () => {
const account = store.store.account
if (openPath && account?.host) {
shell.openExternal(buildHostUrl(account.host, openPath))
}
})

notification.show()
})

ipcMain.on(IPC_EVENTS.COPY_TO_CLIPBOARD, async (_, text) => {
clipboard.writeText(text)
})
Expand Down
7 changes: 6 additions & 1 deletion src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export interface IElectronAPI {

//EMITTER - only emit, no response
openDevTool(hash: string): unknown
sendNotification(notificationoption: NotificationConstructorOptions, openUrl: string | undefined): void
sendNotification(
title: string,
notificationoption: NotificationConstructorOptions,
openUrl?: string,
): void
logout: () => void
startCall(phoneNumber: string): void
hideLoginWindow(): void
Expand Down Expand Up @@ -102,6 +106,7 @@ const api: IElectronAPI = {
hidePhoneIsland: setEmitter(IPC_EVENTS.HIDE_PHONE_ISLAND),
showPhoneIsland: setEmitter(IPC_EVENTS.SHOW_PHONE_ISLAND),
copyToClipboard: setEmitter(IPC_EVENTS.COPY_TO_CLIPBOARD),
sendNotification: setEmitter(IPC_EVENTS.SEND_NOTIFICATION),

//LISTENERS - receive data async
onUpdateAppNotification: addListener(IPC_EVENTS.UPDATE_APP_NOTIFICATION),
Expand Down
14 changes: 13 additions & 1 deletion src/renderer/public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"lost_call_body": "You received a call from {{number}} at {{datetime}}",
"physical_phone_error": "the phone {{phone}} is not reachable. Make sure it is connected",
"call_transferred_title": "Call transferred",
"call_transferred_body": "The call was succesfully transferred"
"call_transferred_body": "The call was succesfully transferred",
"call_summary_ready_title": "Call summary ready",
"call_summary_ready_body": "The summary is ready for review and editing",
"call_summary_ready_body_with_contact": "The summary of your call with {{contact}} is ready"
},
"Phonebook": {
"Phonebook": "Phonebook",
Expand Down Expand Up @@ -333,6 +336,7 @@
"Delete profile picture": "Delete profile picture",
"Devices": "Audio and Video",
"IncomingCalls": "Incoming Calls",
"Notifications": "Notifications",
"Ringtone": "Ringtone",
"Time preferences": "Time preferences",
"Login/logout preferences": "Login/logout preferences",
Expand All @@ -349,6 +353,14 @@
"Only nethlink": "Only Nethlink",
"ShortcutToCall": "Shortcut to Call",
"CommandBarShortcut": "Shortcut for Command Bar",
"NotificationsDescription": "Manage notifications for call features and AI-generated content.",
"NotificationsScopeDescription": "Settings apply to web phone and desktop app.",
"CallSummaryNotifications": "Call summary notifications",
"CallSummaryNotificationsDescription": "Receive an operating system notification when a call summary is ready.",
"CallSummaryNotificationsSaveError": "Unable to save notification preferences.",
"CallTranscriptionReady": "Call transcription ready",
"Enabled": "Enabled",
"Disabled": "Disabled",
"ShortcutHelp": "Enter a keyboard shortcut to start a call after selecting some text.",
"ShortcutHelpDesc": "Unsupported keys: \"Tab\", \"CapsLock\", \"NumLock\", \"Insert\", \"Escape\", \"Shift\".",
"Clear and remove shortcut": "Clear and remove shortcut"
Expand Down
14 changes: 13 additions & 1 deletion src/renderer/public/locales/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"lost_call_body": "Hai ricevuto una chiamata da {{number}} alle {{datetime}}",
"physical_phone_error": "Il telefono {{phone}} non è raggiungibile. Assicurarsi che sia collegato",
"call_transferred_title": "Traferimento di chiamata",
"call_transferred_body": "La chiamata è stata trasferita con successo"
"call_transferred_body": "La chiamata è stata trasferita con successo",
"call_summary_ready_title": "Riepilogo chiamata pronto",
"call_summary_ready_body": "Il riepilogo e' pronto per la revisione e la modifica",
"call_summary_ready_body_with_contact": "Il riepilogo della tua chiamata con {{contact}} e' pronto"
},
"Phonebook": {
"Phonebook": "Rubrica",
Expand Down Expand Up @@ -333,6 +336,7 @@
"Delete profile picture": "Elimina immagine profilo",
"Devices": "Audio e Video",
"IncomingCalls": "Chiamate in Arrivo",
"Notifications": "Notifiche",
"Ringtone": "Suoneria",
"Time preferences": "Preferenze di tempo",
"Login/logout preferences": "Preferenze di entrata/uscita",
Expand All @@ -349,6 +353,14 @@
"Only nethlink": "Solo Nethlink",
"ShortcutToCall": "Scorciatoia per Chiamare",
"CommandBarShortcut": "Scorciatoia per Command Bar",
"NotificationsDescription": "Gestisci le notifiche per le funzioni di chiamata e i contenuti generati dall'AI.",
"NotificationsScopeDescription": "Le impostazioni si applicano al web phone e all'app desktop.",
"CallSummaryNotifications": "Notifica riassunto chiamata",
"CallSummaryNotificationsDescription": "Ricevi una notifica di sistema operativo quando il riassunto della chiamata e' pronto.",
"CallSummaryNotificationsSaveError": "Impossibile salvare le preferenze di notifica.",
"CallTranscriptionReady": "Trascrizione chiamata pronta",
"Enabled": "Attivato",
"Disabled": "Disattivato",
"ShortcutHelp": "Inserisci una scorciatoia da tastiera per far partire una chiamata dopo aver selezionato un testo.",
"ShortcutHelpDesc": "Caratteri non consentiti: \"Tab\", \"CapsLock\", \"NumLock\", \"Insert\", \"Escape\", \"Shift\".",
"Clear and remove shortcut": "Ripristina e rimuovi scorciatoia"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SettingsShortcutDialog } from './ProfileDialog/SettingsSettings/Setting
import { SettingsCommandBarShortcutDialog } from './ProfileDialog/SettingsSettings/SettingsCommandBarShortcutDialog'
import { SettingsDeviceDialog } from './ProfileDialog/SettingsSettings/SettingsDevicesDialog'
import { SettingsIncomingCallsDialog } from './ProfileDialog/SettingsSettings/SettingsIncomingCallsDialog'
import { SettingsNotificationsDialog } from './ProfileDialog/SettingsSettings/SettingsNotificationsDialog'

export interface NavbarProps {
onClickAccount: () => void
Expand All @@ -29,6 +30,8 @@ export function Navbar({ onClickAccount }: NavbarProps): JSX.Element {
)
const [isDeviceDialogOpen] = useNethlinkData('isDeviceDialogOpen')
const [isIncomingCallsDialogOpen] = useNethlinkData('isIncomingCallsDialogOpen')
const [isNotificationsDialogOpen] = useNethlinkData('isNotificationsDialogOpen')
const isCallSummaryEnabled = account?.data?.call_summary_enabled === true

const [isProfileDialogOpen, setIsProfileDialogOpen] = useState(false)

Expand Down Expand Up @@ -64,6 +67,7 @@ export function Navbar({ onClickAccount }: NavbarProps): JSX.Element {
{isCommandBarShortcutDialogOpen && <SettingsCommandBarShortcutDialog />}
{isDeviceDialogOpen && <SettingsDeviceDialog />}
{isIncomingCallsDialogOpen && <SettingsIncomingCallsDialog />}
{isCallSummaryEnabled && isNotificationsDialogOpen && <SettingsNotificationsDialog />}
<ProfileDialog
isOpen={isProfileDialogOpen}
onClose={() => setIsProfileDialogOpen(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import {
faKeyboard as KeyboardIcon,
faHeadphones as DevicesIcon,
faPhoneVolume as IncomingCallsIcon,
faBell as NotificationsIcon,
} from '@fortawesome/free-solid-svg-icons'
import { useNethlinkData } from '@renderer/store'
import { useNethlinkData, useSharedState } from '@renderer/store'
import { OptionElement } from '../OptionElement'

export function SettingsBox({ onClose }: { onClose?: () => void }) {
const [account] = useSharedState('account')
const [, setIsShortcutDialogOpen] = useNethlinkData('isShortcutDialogOpen')
const [, setIsCommandBarShortcutDialogOpen] = useNethlinkData(
'isCommandBarShortcutDialogOpen',
)
const [, setIsDeviceDialogOpen] = useNethlinkData('isDeviceDialogOpen')
const [, setIsIncomingCallsDialogOpen] = useNethlinkData('isIncomingCallsDialogOpen')
const [, setIsNotificationsDialogOpen] = useNethlinkData('isNotificationsDialogOpen')
const isCallSummaryEnabled = account?.data?.call_summary_enabled === true

return (
<div className="py-2">
Expand Down Expand Up @@ -54,6 +58,17 @@ export function SettingsBox({ onClose }: { onClose?: () => void }) {
if (onClose) onClose()
}}
/>
{isCallSummaryEnabled && (
<OptionElement
isSelected={false}
icon={NotificationsIcon}
label={t('Settings.Notifications')}
onClick={() => {
setIsNotificationsDialogOpen(true)
if (onClose) onClose()
}}
/>
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useEffect, useState } from 'react'
import { useForm } from 'react-hook-form'
import { z } from 'zod'
import { Backdrop } from '../../Backdrop'
import { CustomThemedTooltip } from '@renderer/components/Nethesis/CurstomThemedTooltip'
import { CustomThemedTooltip } from '@renderer/components/Nethesis/CustomThemedTooltip'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faXmark } from '@fortawesome/free-solid-svg-icons'
import { InlineNotification } from '@renderer/components/Nethesis/InlineNotification'
Expand Down
Loading
Loading