Add trial request functionality for audit.
This commit is contained in:
@@ -294,6 +294,11 @@ function openNoticeWindow() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcMain.on(ipcTypes.app.toMain.setReleaseChannel, (event, channel) => {
|
||||||
|
autoUpdater.channel = channel;
|
||||||
|
checkForUpdates();
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.on(ipcTypes.app.toMain.checkForUpdates, (event, args) => {
|
ipcMain.on(ipcTypes.app.toMain.checkForUpdates, (event, args) => {
|
||||||
checkForUpdates();
|
checkForUpdates();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ select_permissions:
|
|||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- accepted_ins_co
|
- accepted_ins_co
|
||||||
|
- channel
|
||||||
- created_at
|
- created_at
|
||||||
- features
|
- features
|
||||||
- groups
|
- groups
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."bodyshops" add column "channel" text
|
||||||
|
-- null default 'latest';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."bodyshops" add column "channel" text
|
||||||
|
null default 'latest';
|
||||||
@@ -92,6 +92,7 @@
|
|||||||
"vite-plugin-style-import": "^2.0.0"
|
"vite-plugin-style-import": "^2.0.0"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
|
"generateUpdatesFilesForAllChannels": true,
|
||||||
"extends": null,
|
"extends": null,
|
||||||
"appId": "com.imex.rps",
|
"appId": "com.imex.rps",
|
||||||
"copyright": "Copyright © ImEX Systems Inc.",
|
"copyright": "Copyright © ImEX Systems Inc.",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { PrinterFilled } from "@ant-design/icons";
|
import { PrinterFilled } from "@ant-design/icons";
|
||||||
import { Alert, Button, Card, Col, DatePicker, Form, Input, Row, Space } from "antd";
|
import { Alert, Button, Card, Col, DatePicker, Form, Input, Result, Row, Space } from "antd";
|
||||||
import React, { useRef } from "react";
|
import React, { useRef } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useReactToPrint } from "react-to-print";
|
import { useReactToPrint } from "react-to-print";
|
||||||
@@ -11,11 +11,13 @@ import dayjs from "../../../util/day";
|
|||||||
import AuditResultsOrganism from "../../organisms/audit-results/audit-results.organism";
|
import AuditResultsOrganism from "../../organisms/audit-results/audit-results.organism";
|
||||||
import FeatureWrapper from "../../templates/feature-wrapper";
|
import FeatureWrapper from "../../templates/feature-wrapper";
|
||||||
import "./audit.page.styles.scss";
|
import "./audit.page.styles.scss";
|
||||||
|
import { selectBodyshop } from "../../../redux/user/user.selectors";
|
||||||
|
|
||||||
const { ipcRenderer } = window;
|
const { ipcRenderer } = window;
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
auditError: selectAuditError
|
auditError: selectAuditError
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -23,7 +25,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(AuditPage);
|
export default connect(mapStateToProps, mapDispatchToProps)(AuditPage);
|
||||||
|
|
||||||
export function AuditPage({ auditError, queryReportingData }) {
|
export function AuditPage({ auditError, queryReportingData, bodyshop }) {
|
||||||
const handleBrowseForFile = async ({ sheetName, dateRange }) => {
|
const handleBrowseForFile = async ({ sheetName, dateRange }) => {
|
||||||
queryReportingData({
|
queryReportingData({
|
||||||
startDate: dateRange[0] || dayjs("2024-03-01"),
|
startDate: dateRange[0] || dayjs("2024-03-01"),
|
||||||
@@ -40,8 +42,14 @@ export function AuditPage({ auditError, queryReportingData }) {
|
|||||||
window.ref = componentRef.current;
|
window.ref = componentRef.current;
|
||||||
if (auditError) console.log("Error when opening audit file.", auditError);
|
if (auditError) console.log("Error when opening audit file.", auditError);
|
||||||
return (
|
return (
|
||||||
<FeatureWrapper featureName="audit">
|
<FeatureWrapper featureName="audit" noauth={<NoAuditAccess features={bodyshop.features} />}>
|
||||||
<div className="audit-container" id="audit-results-container">
|
<div className="audit-container" id="audit-results-container">
|
||||||
|
{bodyshop.features.audit_trial && (
|
||||||
|
<Alert
|
||||||
|
type="info"
|
||||||
|
message={`You are currently on a trial of the RPS audit functionality. It will expire on ${bodyshop.features.audit_trial}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Row gutter={[16, 16]} ref={componentRef}>
|
<Row gutter={[16, 16]} ref={componentRef}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Card>
|
<Card>
|
||||||
@@ -126,3 +134,42 @@ export function AuditPage({ auditError, queryReportingData }) {
|
|||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function NoAuditAccess({ features }) {
|
||||||
|
return (
|
||||||
|
<Result
|
||||||
|
status="warning"
|
||||||
|
title="You do not currently have access to the audit feature of RPS."
|
||||||
|
subTitle="Auditing allows you to instantly and automatically find discrepancies between the data you have recorded in RPS and the scorecard provided to your by your SRA."
|
||||||
|
extra={
|
||||||
|
features.audit_trial ? (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
window.$crisp.push(["do", "message:thread:start", ["Subscription Upgrade - RPS Audit"]]);
|
||||||
|
window.$crisp.push(["set", "message:send", ["I would like to subscribe to the RPS Audit feature."]]);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Subscribe
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
window.$crisp.push(["set", "session:event", [[["trial_request", { feature: "audit" }]]]]);
|
||||||
|
window.$crisp.push(["do", "message:thread:start", ["Trial Request - RPS Audit"]]);
|
||||||
|
window.$crisp.push([
|
||||||
|
"do",
|
||||||
|
"message:send",
|
||||||
|
["text", "Hello, I would like to request a trial of the RPS audit feature."]
|
||||||
|
]);
|
||||||
|
window.$crisp.push(["do", "chat:open"]);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Request Trial
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const QUERY_BODYSHOP = gql`
|
|||||||
groups
|
groups
|
||||||
ppd_diff_alert
|
ppd_diff_alert
|
||||||
features
|
features
|
||||||
|
channel
|
||||||
}
|
}
|
||||||
targets {
|
targets {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"getReleaseNotes": "app_getReleaseNotes",
|
"getReleaseNotes": "app_getReleaseNotes",
|
||||||
"getAppVersion": "app_getApVersion",
|
"getAppVersion": "app_getApVersion",
|
||||||
"importJob": "app_importJob",
|
"importJob": "app_importJob",
|
||||||
|
"setReleaseChannel": "app_setReleaseChannel",
|
||||||
"log": {
|
"log": {
|
||||||
"info": "app_logInfo",
|
"info": "app_logInfo",
|
||||||
"debug": "app_logDebug",
|
"debug": "app_logDebug",
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export function* signInSuccessSaga({ payload }) {
|
|||||||
// LogRocket.identify(payload.email, {
|
// LogRocket.identify(payload.email, {
|
||||||
// email: payload.email,
|
// email: payload.email,
|
||||||
// });
|
// });
|
||||||
ipcRenderer.send(ipcTypes.app.toMain.checkForUpdates);
|
//ipcRenderer.send(ipcTypes.app.toMain.checkForUpdates);
|
||||||
|
|
||||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||||
event: "SIGN_IN_SUCCESS",
|
event: "SIGN_IN_SUCCESS",
|
||||||
@@ -137,6 +137,7 @@ export function* signInSuccessSaga({ payload }) {
|
|||||||
if (shop.data.bodyshops.length > 0) {
|
if (shop.data.bodyshops.length > 0) {
|
||||||
yield put(setBodyshop(shop.data.bodyshops[0]));
|
yield put(setBodyshop(shop.data.bodyshops[0]));
|
||||||
ipcRenderer.send(ipcTypes.app.toMain.setAcceptableInsCoNm, shop.data.bodyshops[0].accepted_ins_co);
|
ipcRenderer.send(ipcTypes.app.toMain.setAcceptableInsCoNm, shop.data.bodyshops[0].accepted_ins_co);
|
||||||
|
ipcRenderer.send(ipcTypes.app.toMain.setReleaseChannel, shop.data.bodyshops[0].channel);
|
||||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.start, {
|
ipcRenderer.send(ipcTypes.fileWatcher.toMain.start, {
|
||||||
startup: true
|
startup: true
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user