Web: Added new LiveChat and BookTraining menu to Profile

This commit is contained in:
Alexey Safronov 2023-04-03 14:43:01 +04:00
parent 3f0cf16193
commit a9355c4ea6
4 changed files with 67 additions and 10 deletions

View File

@ -3,8 +3,10 @@ import HotkeysReactSvgUrl from "PUBLIC_DIR/images/hotkeys.react.svg?url";
import ProfileReactSvgUrl from "PUBLIC_DIR/images/profile.react.svg?url";
import PaymentsReactSvgUrl from "PUBLIC_DIR/images/payments.react.svg?url";
import HelpCenterReactSvgUrl from "PUBLIC_DIR/images/help.center.react.svg?url";
import SupportReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url";
import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url";
import EmailReactSvgUrl from "PUBLIC_DIR/images/email.react.svg?url";
import LiveChatReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url";
import BookTrainingReactSvgUrl from "PUBLIC_DIR/images/book.training.react.svg?url";
//import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url";
import InfoOutlineReactSvgUrl from "PUBLIC_DIR/images/info.outline.react.svg?url";
import LogoutReactSvgUrl from "PUBLIC_DIR/images/logout.react.svg?url";
import { makeAutoObservable } from "mobx";
@ -93,6 +95,10 @@ class ProfileActionsStore {
window.open(helpUrl, "_blank");
};
onLiveChatClick = () => {
//window.open(supportUrl, "_blank");
};
onSupportClick = () => {
const supportUrl = this.authStore.settingsStore.additionalResourcesData
?.feedbackAndSupportUrl;
@ -100,6 +106,13 @@ class ProfileActionsStore {
window.open(supportUrl, "_blank");
};
onBookTraining = () => {
const trainingEmail = this.authStore.settingsStore.additionalResourcesData
?.trainingEmail;
trainingEmail && window.open(`mailto:${trainingEmail}`, "_blank");
};
// onVideoGuidesClick = () => {
// window.open(VIDEO_GUIDES_URL, "_blank");
// };
@ -173,6 +186,29 @@ class ProfileActionsStore {
};
}
// }
let liveChat = null;
if (!isMobile) {
liveChat = {
key: "user-menu-live-chat",
icon: LiveChatReactSvgUrl,
label: t("Common:LiveChat"),
onClick: this.onLiveChatClick,
};
}
let bookTraining = null;
if (!isMobile) {
bookTraining = {
key: "user-menu-book-training",
icon: BookTrainingReactSvgUrl,
label: t("Common:BookTraining"),
onClick: this.onBookTraining,
};
}
const actions = [
{
key: "user-menu-profile",
@ -187,18 +223,16 @@ class ProfileActionsStore {
label: t("Common:PaymentsTitle"),
onClick: this.onPaymentsClick,
},
{
isSeparator: true,
key: "separator1",
},
{
key: "user-menu-help-center",
icon: HelpCenterReactSvgUrl,
label: t("Common:HelpCenter"),
onClick: this.onHelpCenterClick,
},
{
key: "user-menu-support",
icon: SupportReactSvgUrl,
label: t("Common:FeedbackAndSupport"),
onClick: this.onSupportClick,
},
// {
// key: "user-menu-video",
// icon: VideoGuidesReactSvgUrl,
@ -206,6 +240,18 @@ class ProfileActionsStore {
// onClick: this.onVideoGuidesClick,
// },
hotkeys,
{
isSeparator: true,
key: "separator2",
},
liveChat,
{
key: "user-menu-support",
icon: EmailReactSvgUrl,
label: t("Common:FeedbackAndSupport"),
onClick: this.onSupportClick,
},
bookTraining,
{
key: "user-menu-about",
icon: InfoOutlineReactSvgUrl,
@ -214,7 +260,7 @@ class ProfileActionsStore {
},
{
isSeparator: true,
key: "separator",
key: "separator3",
},
{
key: "user-menu-logout",
@ -226,7 +272,7 @@ class ProfileActionsStore {
];
if (debugInfo) {
actions.splice(3, 0, {
actions.splice(4, 0, {
key: "user-menu-debug",
icon: InfoOutlineReactSvgUrl,
label: "Debug Info",

View File

@ -389,6 +389,9 @@ class SettingsStore {
setAdditionalResourcesData = (data) => {
this.additionalResourcesData = data;
if (!this.additionalResourcesData?.trainingEmail) {
this.additionalResourcesData.trainingEmail = "training@onlyoffice.com";
}
};
setAdditionalResourcesIsDefault = (additionalResourcesIsDefault) => {

View File

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.25807 1.11309C7.53755 0.967522 7.86929 0.962209 8.1533 1.09875L15.4333 4.59875C15.7797 4.76529 16 5.11564 16 5.5C16 5.88436 15.7797 6.23471 15.4333 6.40125L8.1533 9.90125C7.86929 10.0378 7.53755 10.0325 7.25807 9.88691L2 7.14834V9C2 9.55228 1.55228 10 1 10C0.447715 10 0 9.55228 0 9V5.5C0 5.12717 0.207401 4.78531 0.538066 4.61309L7.25807 1.11309ZM7.73791 7.88182L12.6921 5.5L7.73791 3.11818L3.16481 5.5L7.73791 7.88182Z" fill="#333333"/>
<path d="M2 12C2 11.4477 1.55228 11 1 11C0.447715 11 0 11.4477 0 12C0 12.5523 0.447715 13 1 13C1.55228 13 2 12.5523 2 12Z" fill="#333333"/>
<path d="M13 9.01632L11 9.97786V12.4812C9.92129 13.198 8.93284 13.5144 7.99797 13.5156C7.06354 13.5167 6.07649 13.2032 5 12.4832V10.1471L3 9.10542V13C3 13.3154 3.14878 13.6123 3.40141 13.8011C4.88035 14.9062 6.40699 15.5176 8.0005 15.5156C9.59296 15.5135 11.1183 14.8991 12.5958 13.8032C12.8501 13.6145 13 13.3166 13 13V9.01632Z" fill="#333333"/>
<path d="M5 9H4.96241L5 9.01958V9Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -20,6 +20,7 @@
"Audio": "Audio",
"BarMaintenanceDescription": "We apologize for any short-term technical issues in service functioning that may appear on {{targetDate}} during the update of {{productName}}.",
"BarMaintenanceDisclaimer": "Please, make sure that all the changes are successfully saved during this day.",
"BookTraining": "Book a training",
"ByFirstNameSorting": "By first name",
"ByLastNameSorting": "By last name",
"Bytes": "bytes",
@ -124,6 +125,7 @@
"LastName": "Last name",
"LatePayment": "Late payment",
"LearnMore": "Learn more",
"LiveChat": "Live chat",
"Load": "Load",
"LoadingDescription": "Please wait...",
"LoadingProcessing": "Loading...",