Add ES banner for non ES customers.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { ipcMain, app: electronApp, app } = require("electron");
|
||||
const { ipcMain, app: electronApp, app, BrowserWindow } = require("electron");
|
||||
|
||||
const { default: ipcTypes } = require("../src/ipc.types.commonjs");
|
||||
const { store } = require("./electron-store");
|
||||
@@ -74,3 +74,22 @@ ipcMain.handle(ipcTypes.app.toMain.scrubEstimate, (event, { job }) => {
|
||||
return ScrubEstimate({ job })
|
||||
});
|
||||
|
||||
ipcMain.on(ipcTypes.app.toMain.openExternalWindow, (event, url) => {
|
||||
const externalWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 800,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true
|
||||
}
|
||||
});
|
||||
|
||||
externalWindow.loadURL(url);
|
||||
|
||||
// Optional: Open external links in default browser
|
||||
externalWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
require('electron').shell.openExternal(url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"productName": "ImEX RPS",
|
||||
"author": "ImEX Systems Inc. <support@thinkimex.com>",
|
||||
"description": "ImEX RPS",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"main": "electron/main.js",
|
||||
"homepage": "./",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { Badge, Card, Result } from "antd";
|
||||
import { Badge, Button, Card, Result } from "antd";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -13,6 +13,7 @@ import EstimateScrubberResultsMolecule from "../../molecules/estimate-scruber-re
|
||||
import JobsDetailDescriptionMolecule from "../../molecules/jobs-detail-description/jobs-detail-description.molecule";
|
||||
import JobsLinesTableMolecule from "../../molecules/jobs-lines-table/jobs-lines-table.molecule";
|
||||
import JobsTargetsStatsMolecule from "../../molecules/jobs-targets-stats/jobs-targets-stats.molecule";
|
||||
import ipcTypes from "../../../ipc.types";
|
||||
import "./jobs-detail.organism.styles.scss";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -85,12 +86,34 @@ export function JobsDetailOrganism({ bodyshop, selectedJobId, setSelectedJobTarg
|
||||
<Card title="Estimate Lines">
|
||||
<JobsLinesTableMolecule loading={loading} job={data ? data.jobs_by_pk : {}} />
|
||||
</Card>
|
||||
{bodyshop.es_api_key && (
|
||||
{bodyshop.es_api_key ? (
|
||||
<Badge.Ribbon text="BETA" color="red">
|
||||
<Card id="es-results-card" title="Estimate Scrubber Results" extra={[]}>
|
||||
<EstimateScrubberResultsMolecule loading={loading} job={data ? data.jobs_by_pk : {}} />
|
||||
</Card>
|
||||
</Badge.Ribbon>
|
||||
) : (
|
||||
<Card title="Estimate Scrubber">
|
||||
<Result
|
||||
status="info"
|
||||
title="Are you missing out on profit?"
|
||||
subTitle="Estimate Scrubber identifies additional billing opportunities and potential issues with your estimates to help maximize your revenue. Get started with a free 30 day trial today."
|
||||
extra={
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
const { ipcRenderer } = window;
|
||||
ipcRenderer.send(
|
||||
ipcTypes.app.toMain.openExternalWindow,
|
||||
"https://atamb.ca/estimate-scrubber-trial?utm_source=imex_rps&utm_medium=app&utm_campaign=es_trial_banner"
|
||||
);
|
||||
}}
|
||||
>
|
||||
Get Started
|
||||
</Button>
|
||||
}
|
||||
></Result>
|
||||
</Card>
|
||||
)}
|
||||
<Card title="Parts Breakdown">
|
||||
<div
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"importJob": "app_importJob",
|
||||
"setReleaseChannel": "app_setReleaseChannel",
|
||||
"scrubEstimate": "app_scrubEstimate",
|
||||
"openExternalWindow": "app_openExternalWindow",
|
||||
"log": {
|
||||
"info": "app_logInfo",
|
||||
"debug": "app_logDebug",
|
||||
|
||||
Reference in New Issue
Block a user