diff --git a/src/api/types.ts b/src/api/types.ts index dc424cf..8555a09 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -106,7 +106,9 @@ export interface User { is_active: boolean; force_change: boolean; account_sid: string | null; + account_name?: string | null; service_provider_sid: string | null; + service_provider_name?: string | null; initial_password?: string; permissions?: UserPermissions[]; } @@ -142,6 +144,7 @@ export interface UserJWT { account_sid?: string | null; service_provider_sid?: string | null; permissions: UserPermissions[]; + name: string; } export interface ServiceProvider { diff --git a/src/components/icons.ts b/src/components/icons.ts index ab387d6..7f3e2f9 100644 --- a/src/components/icons.ts +++ b/src/components/icons.ts @@ -5,6 +5,7 @@ import { Menu, List, Edit, + User, Plus, Grid, Phone, @@ -53,6 +54,7 @@ export const Icons: IconMap = { Menu, List, Edit, + User, Plus, Grid, Phone, diff --git a/src/containers/internal/layout.tsx b/src/containers/internal/layout.tsx index e43dab3..46c8143 100644 --- a/src/containers/internal/layout.tsx +++ b/src/containers/internal/layout.tsx @@ -1,17 +1,22 @@ import React, { useState } from "react"; -import { Outlet } from "react-router-dom"; +import { Link, Outlet } from "react-router-dom"; import { Button, Icon, classNames } from "jambonz-ui"; import { Navi } from "./navi"; import { Icons } from "src/components"; -import { toastSuccess } from "src/store"; +import { toastSuccess, useSelectState } from "src/store"; import { useAuth } from "src/router/auth"; import { useMobileMedia } from "src/utils"; import { MSG_LOGGED_OUT } from "src/constants"; import "./styles.scss"; +import { ROUTE_INTERNAL_USERS } from "src/router/routes"; +import { useApiData } from "src/api"; +import { User } from "src/api/types"; export const Layout = () => { + const user = useSelectState("user"); + const [userData] = useApiData("Users/me"); const [active, setActive] = useState(false); const { signout } = useAuth(); const mobile = useMobileMedia(); @@ -43,6 +48,22 @@ export const Layout = () => { +
+ +
+
+ + {userData?.name} + +
+
+ Scope: {user?.scope} +
+
+
+ + ))} - - - + + + + + @@ -1085,27 +1104,32 @@ export const CarrierForm = ({
- - { - setSmppSystemId(e.target.value); - }} - /> - - { - setSmppPass(e.target.value); - }} - /> + + + { + setSmppSystemId(e.target.value); + }} + /> + + { + setSmppPass(e.target.value); + }} + /> + - + + ) : null; })} - - - + + + + +
- - { - setSmppInboundSystemId(e.target.value); - }} - /> - - - - Password is required if whitelisting carrier IP address(es) - below. - - - { - setSmppInboundPass(e.target.value); - }} - /> + + + { + setSmppInboundSystemId(e.target.value); + }} + /> + + + + Password is required if whitelisting carrier IP address(es) + below. + + + { + setSmppInboundPass(e.target.value); + }} + /> + @@ -1304,39 +1345,51 @@ export const CarrierForm = ({ /> - + + ) : null; })} - - - + + + + +
diff --git a/src/containers/internal/views/recent-calls/index.tsx b/src/containers/internal/views/recent-calls/index.tsx index 6493e47..726913e 100644 --- a/src/containers/internal/views/recent-calls/index.tsx +++ b/src/containers/internal/views/recent-calls/index.tsx @@ -125,7 +125,7 @@ export const RecentCalls = () => { ) : hasLength(calls) ? ( calls.map((call) => ) ) : ( - No data + No data. )} diff --git a/src/containers/internal/views/settings/index.tsx b/src/containers/internal/views/settings/index.tsx index 91cbc13..c5df647 100644 --- a/src/containers/internal/views/settings/index.tsx +++ b/src/containers/internal/views/settings/index.tsx @@ -5,12 +5,14 @@ import { withSelectState } from "src/utils"; import { ApiKeys } from "src/containers/internal/api-keys"; import ServiceProviderSettings from "./service-provider-settings"; import AdminSettings from "./admin-settings"; +import { ScopedAccess } from "src/components/scoped-access"; import type { ServiceProvider } from "src/api/types"; import { Section } from "src/components"; + +import { USER_ADMIN } from "src/api/constants"; import { MSG_REQUIRED_FIELDS } from "src/constants"; -import { ScopedAccess } from "src/components/scoped-access"; -import { Scope } from "src/store/types"; import { useSelectState } from "src/store"; +import { Scope } from "src/store/types"; type SettingsProps = { currentServiceProvider: ServiceProvider; @@ -38,9 +40,11 @@ export const Settings = ({ currentServiceProvider }: SettingsProps) => { - - - + {user?.scope !== USER_ADMIN && ( + + + + )} diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index 68be222..1a1b8dc 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -575,7 +575,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { }} checked={useCustomTts} /> -
Use for custom text-to-speech
+
Use for custom voice