Added alert for partner in app IO-406

This commit is contained in:
Patrick Fic
2021-02-22 17:05:12 -08:00
parent 6cdae6b0d5
commit 1a6e336e9a
7 changed files with 86 additions and 1 deletions

View File

@@ -11934,6 +11934,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>noacctfilepath</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>notfoundsub</name>
<definition_loaded>false</definition_loaded>
@@ -11976,6 +11997,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>partnernotrunning</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>rbacunauth</name>
<definition_loaded>false</definition_loaded>

View File

@@ -0,0 +1,34 @@
import React, { useState, useEffect } from "react";
import axios from "axios";
import { message, notification } from "antd";
import { useTranslation } from "react-i18next";
export default function PartnerPingComponent() {
const { t } = useTranslation();
useEffect(() => {
// Create an scoped async function in the hook
async function checkPartnerStatus() {
try {
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
const { appver, qbpath } = PartnerResponse.data;
if (!qbpath) {
notification["error"]({
title: "",
message: t("general.messages.noacctfilepath"),
});
}
} catch (error) {
notification["error"]({
title: "",
message: t("general.messages.partnernotrunning"),
});
}
}
// Execute the created function directly
checkPartnerStatus();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return <></>;
}

View File

@@ -7,7 +7,7 @@ import JobsAvailableTableContainer from "../../components/jobs-available-table/j
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
import {
setBreadcrumbs,
setSelectedHeader,
setSelectedHeader
} from "../../redux/application/application.actions";
const mapDispatchToProps = (dispatch) => ({
@@ -32,6 +32,7 @@ export function JobsAvailablePageContainer({
return (
<RbacWrapper action="jobs:available-list">
<div>
<Link to="/manage/jobs/new">
<Button>{t("jobs.actions.manualnew")}</Button>
</Link>

View File

@@ -16,6 +16,7 @@ import FcmNotification from "../../components/fcm-notification/fcm-notification.
import HeaderContainer from "../../components/header/header.container";
import JiraSupportComponent from "../../components/jira-support-widget/jira-support-widget.component";
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
import PartnerPingComponent from "../../components/partner-ping/partner-ping.component";
import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container";
import TestComponent from "../../components/_test/test.component";
import { QUERY_STRIPE_ID } from "../../graphql/bodyshop.queries";
@@ -177,6 +178,7 @@ export function Manage({ match, conflict }) {
</Header>
<Content className="content-container">
<FcmNotification />
<PartnerPingComponent />
<ErrorBoundary>
{conflict ? (
<ConflictComponent />

View File

@@ -770,8 +770,10 @@
"exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.",
"newversionmessage": "Click refresh below to update to the latest available version of ImEX Online.",
"newversiontitle": "New version of ImEX Online Available",
"noacctfilepath": "There is no accounting file path set. You will not be able to export any items.",
"notfoundsub": "Please make sure that you have access to the data or that the link is correct.",
"notfoundtitle": "We couldn't find what you're looking for...",
"partnernotrunning": "ImEX Online has detected that the partner is not running. Please ensure it is running to enable full functionality.",
"rbacunauth": "You are not authorized to view this content. Please reach out to your shop manager to change your access level.",
"unsavedchanges": "You have unsaved changes.",
"unsavedchangespopup": "You have unsaved changes. Are you sure you want to leave?"

View File

@@ -770,8 +770,10 @@
"exception": "",
"newversionmessage": "",
"newversiontitle": "",
"noacctfilepath": "",
"notfoundsub": "",
"notfoundtitle": "",
"partnernotrunning": "",
"rbacunauth": "",
"unsavedchanges": "Usted tiene cambios no guardados.",
"unsavedchangespopup": ""

View File

@@ -770,8 +770,10 @@
"exception": "",
"newversionmessage": "",
"newversiontitle": "",
"noacctfilepath": "",
"notfoundsub": "",
"notfoundtitle": "",
"partnernotrunning": "",
"rbacunauth": "",
"unsavedchanges": "Vous avez des changements non enregistrés.",
"unsavedchangespopup": ""