Skip to content

Commit

Permalink
Merge pull request #9076 from CitizenLabDotCo/TAN-2664-custom-portal-…
Browse files Browse the repository at this point in the history
…link

TAN-2664 - Added customer portal link
  • Loading branch information
jamesspeake authored Oct 15, 2024
2 parents 48a4170 + 221857e commit d8a98e6
Show file tree
Hide file tree
Showing 35 changed files with 40 additions and 140 deletions.
6 changes: 6 additions & 0 deletions back/config/schemas/settings.schema.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@
"title": "Additional number of manager seats",
"description": "Number of project and folder manager seats bought additionally over the contract limit.",
"type": ["integer", "null"]
},
"customer_portal_url": {
"title": "Customer portal URL",
"description": "Link to the customer portal in Planhat.",
"type": "string",
"format": "uri"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions front/app/api/app_configuration/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export type IAppConfigurationSettingsCore = {
additional_admins_number: TSeatNumber;
additional_moderators_number: TSeatNumber;
onboarding?: boolean;
customer_portal_url?: string | null;
};

export type TSeatNumber = number | null | undefined;
Expand Down
34 changes: 22 additions & 12 deletions front/app/containers/Admin/sideBar/SupportMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ import { useIntl } from 'utils/cl-intl';

import messages from './messages';
import { ItemMenu, StyledBox } from './styles';
import useAppConfiguration from 'api/app_configuration/useAppConfiguration';
import { isAdmin } from 'utils/permissions/roles';
import useAuthUser from 'api/me/useAuthUser';

export const SupportMenu = () => {
const { formatMessage } = useIntl();
const isSmallerThanPhone = useBreakpoint('tablet');
const iconDivRef = useRef<HTMLDivElement | null>(null);
const { data: authUser } = useAuthUser();
const { data: tenant } = useAppConfiguration();

const customerPortalUrl =
tenant?.data.attributes.settings.core.customer_portal_url;

return (
<Popup
Expand Down Expand Up @@ -86,18 +94,6 @@ export const SupportMenu = () => {
<Icon name="book" fill={colors.grey600} />
</Box>
</ItemMenu>
<ItemMenu
linkTo={formatMessage(messages.linkToAcademy) as RouteType}
buttonStyle="text"
openLinkInNewTab
>
<Box display="flex" justifyContent="space-between" w="100%">
<Text my="0px" color="coolGrey600">
{formatMessage({ ...messages.academy })}
</Text>
<Icon name="academy" fill={colors.grey600} />
</Box>
</ItemMenu>
<ItemMenu
linkTo={formatMessage(messages.linkToCommunityPlatform) as RouteType}
buttonStyle="text"
Expand All @@ -110,6 +106,20 @@ export const SupportMenu = () => {
<Icon name="community" fill={colors.grey600} />
</Box>
</ItemMenu>
{customerPortalUrl && isAdmin(authUser) && (
<ItemMenu
linkTo={customerPortalUrl}
buttonStyle="text"
openLinkInNewTab
>
<Box display="flex" justifyContent="space-between" w="100%">
<Text my="0px" color="coolGrey600">
{formatMessage({ ...messages.customerPortal })}
</Text>
<Icon name="users" fill={colors.grey600} />
</Box>
</ItemMenu>
)}
</Box>
</Popup>
);
Expand Down
20 changes: 8 additions & 12 deletions front/app/containers/Admin/sideBar/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,13 @@ export default defineMessages({
id: 'app.containers.AdminPage.SideBar.tools',
defaultMessage: 'Tools',
},
academy: {
id: 'app.containers.AdminPage.SideBar.academy',
defaultMessage: 'Academy',
},
linkToAcademy: {
id: 'app.containers.AdminPage.SideBar.linkToAcademy',
defaultMessage: 'https://academy.citizenlab.co/',
},
guide: {
id: 'app.containers.AdminPage.SideBar.guide',
defaultMessage: 'Guide',
},
linkToSupport: {
id: 'app.containers.AdminPage.SideBar.linkToSupport',
defaultMessage: 'https://support.citizenlab.co',
id: 'app.containers.AdminPage.SideBar.linkToSupport2',
defaultMessage: 'https://support.govocal.com',
},
toPlatform: {
id: 'app.containers.AdminPage.SideBar.toPlatform',
Expand All @@ -93,9 +85,13 @@ export default defineMessages({
id: 'app.containers.AdminPage.SideBar.communityPlatform',
defaultMessage: 'Community platform',
},
customerPortal: {
id: 'app.containers.AdminPage.SideBar.customerPortal',
defaultMessage: 'Customer portal',
},
linkToCommunityPlatform: {
id: 'app.containers.AdminPage.SideBar.linkToCommunityPlatform',
defaultMessage: 'https://community.citizenlab.co',
id: 'app.containers.AdminPage.SideBar.linkToCommunityPlatform2',
defaultMessage: 'https://community.govocal.com',
},
notifications: {
id: 'app.containers.AdminPage.SideBar.notifications',
Expand Down
2 changes: 0 additions & 2 deletions front/app/translations/admin/ar-MA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1106,15 +1106,13 @@
"app.containers.AdminPage.SettingsPage.urlError": "عنوان الـ URL غير صالح.",
"app.containers.AdminPage.SettingsPage.urlTitle": "الموقع الإلكتروني",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "يمكنك إضافة رابط إلى موقعك الإلكتروني. سيتم استخدام هذا الرابط في الجزء السفلي من الصفحة الرئيسية.",
"app.containers.AdminPage.SideBar.academy": "الأكاديمية",
"app.containers.AdminPage.SideBar.dashboard": "اللوحة الرئيسية",
"app.containers.AdminPage.SideBar.emails": "الرسائل الإلكترونية",
"app.containers.AdminPage.SideBar.groups": "المجموعات",
"app.containers.AdminPage.SideBar.guide": "الدليل",
"app.containers.AdminPage.SideBar.initiatives": "المُقترحات",
"app.containers.AdminPage.SideBar.inputManager": "مدير الفكرة",
"app.containers.AdminPage.SideBar.insights": "تقديم بلاغات",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.menu": "صفحات وقائمة",
"app.containers.AdminPage.SideBar.messaging": "رسائل",
"app.containers.AdminPage.SideBar.moderation": "النشاط",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "أدخل عنوان URL صالحًا.",
"app.containers.AdminPage.SettingsPage.urlTitle": "الموقع الإلكتروني",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "يمكنك إضافة رابط إلى موقعك الإلكتروني. سيتم استخدام هذا الرابط في الجزء السفلي من الصفحة الرئيسية.",
"app.containers.AdminPage.SideBar.academy": "الأكاديمية",
"app.containers.AdminPage.SideBar.administrator": "مدير",
"app.containers.AdminPage.SideBar.communityPlatform": "منصة المجتمع",
"app.containers.AdminPage.SideBar.dashboard": "اللوحة الرئيسية",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "تقديم بلاغات",
"app.containers.AdminPage.SideBar.knowledgeBase": "قاعدة المعرفة",
"app.containers.AdminPage.SideBar.language": "لغة",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "صفحات وقائمة",
"app.containers.AdminPage.SideBar.messaging": "رسائل",
"app.containers.AdminPage.SideBar.moderation": "النشاط",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/ca-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Lloc web",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "Podeu afegir un enllaç al vostre propi lloc web. Aquest enllaç s'utilitzarà a la part inferior de la pàgina d'inici.",
"app.containers.AdminPage.SideBar.academy": "Acadèmia",
"app.containers.AdminPage.SideBar.administrator": "Administrador",
"app.containers.AdminPage.SideBar.communityPlatform": "Plataforma comunitària",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -1441,9 +1440,6 @@
"app.containers.AdminPage.SideBar.insights": "Informes",
"app.containers.AdminPage.SideBar.knowledgeBase": "Base de coneixements",
"app.containers.AdminPage.SideBar.language": "Llenguatge",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/cy-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Rhowch URL dilys.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Gwefan",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "Gallwch ychwanegu dolen at eich gwefan eich hun. Bydd y ddolen hon yn cael ei defnyddio ar waelod yr hafan.",
"app.containers.AdminPage.SideBar.academy": "Academi",
"app.containers.AdminPage.SideBar.administrator": "Gweinyddwr",
"app.containers.AdminPage.SideBar.communityPlatform": "Llwyfan cymunedol",
"app.containers.AdminPage.SideBar.dashboard": "Dangosfwrdd",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Adrodd",
"app.containers.AdminPage.SideBar.knowledgeBase": "Sylfaen wybodaeth",
"app.containers.AdminPage.SideBar.language": "Iaith",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Tudalennau a bwydlen",
"app.containers.AdminPage.SideBar.messaging": "Negeseuon",
"app.containers.AdminPage.SideBar.moderation": "Gweithgaredd",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/da-DK.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Indtast en gyldig URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Websted",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "Du kan tilføje et link til din eget websted. Dette link vil blive brugt nederst på hjemmesiden.",
"app.containers.AdminPage.SideBar.academy": "Akademi",
"app.containers.AdminPage.SideBar.administrator": "Administrator",
"app.containers.AdminPage.SideBar.communityPlatform": "Fællesskabsplatform",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Indsigt",
"app.containers.AdminPage.SideBar.knowledgeBase": "Vidensbase",
"app.containers.AdminPage.SideBar.language": "Sprog",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Sider og menu",
"app.containers.AdminPage.SideBar.messaging": "Meddelelser",
"app.containers.AdminPage.SideBar.moderation": "Aktivitet",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Geben Sie eine gültige URL ein.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Webseite",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "Sie können einen Link zu Ihrer eigenen Webseite hinzufügen. Dieser Link wird am unteren Rand der Homepage gezeigt.",
"app.containers.AdminPage.SideBar.academy": "Academy",
"app.containers.AdminPage.SideBar.administrator": "Admin",
"app.containers.AdminPage.SideBar.communityPlatform": "Community-Plattform",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Berichterstattung",
"app.containers.AdminPage.SideBar.knowledgeBase": "Wissensdatenbank",
"app.containers.AdminPage.SideBar.language": "Sprache",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co/de-DE/",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co/de/",
"app.containers.AdminPage.SideBar.menu": "Seiten & Menü",
"app.containers.AdminPage.SideBar.messaging": "E-Mails",
"app.containers.AdminPage.SideBar.moderation": "Teilnahme-Feed",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/el-GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Ιστότοπος",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "Μπορείτε να προσθέσετε έναν σύνδεσμο προς τον δικό σας ιστότοπο. Αυτός ο σύνδεσμος θα χρησιμοποιείται στο κάτω μέρος της αρχικής σελίδας.",
"app.containers.AdminPage.SideBar.academy": "Ακαδημία",
"app.containers.AdminPage.SideBar.administrator": "Διαχειριστής",
"app.containers.AdminPage.SideBar.communityPlatform": "Κοινοτική πλατφόρμα",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -1441,9 +1440,6 @@
"app.containers.AdminPage.SideBar.insights": "Αναφορά",
"app.containers.AdminPage.SideBar.knowledgeBase": "Βάση γνώσεων",
"app.containers.AdminPage.SideBar.language": "Γλώσσα",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/en-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Website",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "You can add a link to your own website. This link will be used on the bottom of the homepage.",
"app.containers.AdminPage.SideBar.academy": "Academy",
"app.containers.AdminPage.SideBar.administrator": "Administrator",
"app.containers.AdminPage.SideBar.communityPlatform": "Community platform",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Reporting",
"app.containers.AdminPage.SideBar.knowledgeBase": "Knowledge base",
"app.containers.AdminPage.SideBar.language": "Language",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Website",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "You can add a link to your own website. This link will be used on the bottom of the homepage.",
"app.containers.AdminPage.SideBar.academy": "Academy",
"app.containers.AdminPage.SideBar.administrator": "Administrator",
"app.containers.AdminPage.SideBar.communityPlatform": "Community platform",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Reporting",
"app.containers.AdminPage.SideBar.knowledgeBase": "Knowledge base",
"app.containers.AdminPage.SideBar.language": "Language",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
4 changes: 0 additions & 4 deletions front/app/translations/admin/en-IE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Website",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "You can add a link to your own website. This link will be used on the bottom of the homepage.",
"app.containers.AdminPage.SideBar.academy": "Academy",
"app.containers.AdminPage.SideBar.administrator": "Administrator",
"app.containers.AdminPage.SideBar.communityPlatform": "Community platform",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
Expand All @@ -2129,9 +2128,6 @@
"app.containers.AdminPage.SideBar.insights": "Reporting",
"app.containers.AdminPage.SideBar.knowledgeBase": "Knowledge base",
"app.containers.AdminPage.SideBar.language": "Language",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
7 changes: 3 additions & 4 deletions front/app/translations/admin/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,9 +2116,9 @@
"app.containers.AdminPage.SettingsPage.urlPatternError": "Enter a valid URL.",
"app.containers.AdminPage.SettingsPage.urlTitle": "Website",
"app.containers.AdminPage.SettingsPage.urlTitleTooltip": "You can add a link to your own website. This link will be used on the bottom of the homepage.",
"app.containers.AdminPage.SideBar.academy": "Academy",
"app.containers.AdminPage.SideBar.administrator": "Administrator",
"app.containers.AdminPage.SideBar.communityPlatform": "Community platform",
"app.containers.AdminPage.SideBar.customerPortal": "Customer portal",
"app.containers.AdminPage.SideBar.dashboard": "Dashboard",
"app.containers.AdminPage.SideBar.emails": "Emails",
"app.containers.AdminPage.SideBar.folderManager": "Folder manager",
Expand All @@ -2129,9 +2129,8 @@
"app.containers.AdminPage.SideBar.insights": "Reporting",
"app.containers.AdminPage.SideBar.knowledgeBase": "Knowledge base",
"app.containers.AdminPage.SideBar.language": "Language",
"app.containers.AdminPage.SideBar.linkToAcademy": "https://academy.citizenlab.co/",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform": "https://community.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToSupport": "https://support.citizenlab.co",
"app.containers.AdminPage.SideBar.linkToCommunityPlatform2": "https://community.govocal.com",
"app.containers.AdminPage.SideBar.linkToSupport2": "https://support.govocal.com",
"app.containers.AdminPage.SideBar.menu": "Pages & menu",
"app.containers.AdminPage.SideBar.messaging": "Messaging",
"app.containers.AdminPage.SideBar.moderation": "Activity",
Expand Down
Loading

0 comments on commit d8a98e6

Please sign in to comment.