From a27390e2d34e1ca0484f8b2890537e687a835d79 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 23 Feb 2021 11:13:14 -0800 Subject: [PATCH] Resolve list arrow movement IO-604 --- .../form-list-move-arrows.component.jsx | 3 +- .../partner-ping/partner-ping.component.jsx | 5 +-- .../report-center-modal.component.jsx | 19 +++++------ .../shop-template-test-render.component.jsx | 33 ++++++++----------- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx b/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx index 49a40814e..0f0ac579b 100644 --- a/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx +++ b/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx @@ -4,12 +4,13 @@ export default function FormListMoveArrows({ move, index, total }) { const upDisabled = index === 0; const downDisabled = index === total - 1; + console.log(index); const handleUp = () => { move(index, index - 1); }; const handleDown = () => { - move(index, index - 1); + move(index, index + 1); }; return ( diff --git a/client/src/components/partner-ping/partner-ping.component.jsx b/client/src/components/partner-ping/partner-ping.component.jsx index cdb9b2874..5e292d524 100644 --- a/client/src/components/partner-ping/partner-ping.component.jsx +++ b/client/src/components/partner-ping/partner-ping.component.jsx @@ -1,6 +1,6 @@ -import React, { useState, useEffect } from "react"; +import { notification } from "antd"; import axios from "axios"; -import { message, notification } from "antd"; +import React, { useEffect } from "react"; import { useTranslation } from "react-i18next"; export default function PartnerPingComponent() { @@ -12,6 +12,7 @@ export default function PartnerPingComponent() { try { const PartnerResponse = await axios.post("http://localhost:1337/ping/"); const { appver, qbpath } = PartnerResponse.data; + console.log({ appver, qbpath }); if (!qbpath) { notification["error"]({ title: "", diff --git a/client/src/components/report-center-modal/report-center-modal.component.jsx b/client/src/components/report-center-modal/report-center-modal.component.jsx index d7b97dd06..294fcc9db 100644 --- a/client/src/components/report-center-modal/report-center-modal.component.jsx +++ b/client/src/components/report-center-modal/report-center-modal.component.jsx @@ -1,5 +1,5 @@ import { useLazyQuery } from "@apollo/react-hooks"; -import { Button, DatePicker, Form, Input, Select, Switch } from "antd"; +import { Button, DatePicker, Form, Select, Switch } from "antd"; import moment from "moment"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -28,16 +28,13 @@ export function ReportCenterModalComponent({ reportCenterModal }) { const Templates = TemplateList("report_center"); const { visible } = reportCenterModal; - const [callVendorQuery, { loading, error, data, called }] = useLazyQuery( - QUERY_ALL_VENDORS, - { - skip: !( - visible && - Templates[form.getFieldValue("key")] && - Templates[form.getFieldValue("key")].idtype - ), - } - ); + const [callVendorQuery, { data, called }] = useLazyQuery(QUERY_ALL_VENDORS, { + skip: !( + visible && + Templates[form.getFieldValue("key")] && + Templates[form.getFieldValue("key")].idtype + ), + }); const handleFinish = (values) => { const start = values.dates[0]; diff --git a/client/src/components/shop-template-test-render/shop-template-test-render.component.jsx b/client/src/components/shop-template-test-render/shop-template-test-render.component.jsx index d2b83c865..50c3aeae5 100644 --- a/client/src/components/shop-template-test-render/shop-template-test-render.component.jsx +++ b/client/src/components/shop-template-test-render/shop-template-test-render.component.jsx @@ -1,16 +1,11 @@ import { Button } from "antd"; -import axios from "axios"; -import gql from "graphql-tag"; - import { JsonEditor as Editor } from "jsoneditor-react"; import "jsoneditor-react/es/editor.min.css"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; -import client from "../../utils/GraphQLClient"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import { displayTemplateInWindowNoprint } from "../../utils/RenderTemplate"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -35,22 +30,22 @@ export function ShopTemplateTestRender({ emailEditorRef.current.exportHtml(async (data) => { try { - const inlineHtml = await axios.post("/render/inlinecss", { - html: data.html, - url: `${window.location.protocol}://${window.location.host}/`, - }); + // const inlineHtml = await axios.post("/render/inlinecss", { + // html: data.html, + // url: `${window.location.protocol}://${window.location.host}/`, + // }); - const { data: contextData } = await client.query({ - query: gql(query), - variables: variables, - fetchPolicy: "network-only", - }); + // const { data: contextData } = await client.query({ + // query: gql(query), + // variables: variables, + // fetchPolicy: "network-only", + // }); - const renderResponse = await axios.post("/render", { - view: inlineHtml.data, - context: { ...contextData, bodyshop: bodyshop }, - }); - // displayTemplateInWindowNoprint(renderResponse.data); + // const renderResponse = await axios.post("/render", { + // view: inlineHtml.data, + // context: { ...contextData, bodyshop: bodyshop }, + // }); + // displayTemplateInWindowNoprint(renderResponse.data); setLoading(false); } catch (error) {