Resolve list arrow movement IO-604

This commit is contained in:
Patrick Fic
2021-02-23 11:13:14 -08:00
parent 059b328354
commit a27390e2d3
4 changed files with 27 additions and 33 deletions

View File

@@ -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 (

View File

@@ -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: "",

View File

@@ -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];

View File

@@ -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) {