IO-3515 Improved feedback layout.
This commit is contained in:
@@ -79,7 +79,7 @@ function BillAiFeedback({ billForm, rawAIData }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form form={form} onFinish={submitFeedback} requiredMark={false}>
|
<Form form={form} onFinish={submitFeedback} requiredMark={false}>
|
||||||
<Space align="top" size="large">
|
<Space wrap align="top" size="small">
|
||||||
<Form.Item name="rating" label={t("bills.labels.ai.feedback_prompt")} rules={[{ required: true }]}>
|
<Form.Item name="rating" label={t("bills.labels.ai.feedback_prompt")} rules={[{ required: true }]}>
|
||||||
<Radio.Group optionType="button" buttonStyle="solid">
|
<Radio.Group optionType="button" buttonStyle="solid">
|
||||||
<Radio.Button value="up">
|
<Radio.Button value="up">
|
||||||
@@ -91,12 +91,18 @@ function BillAiFeedback({ billForm, rawAIData }) {
|
|||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name="comments">
|
<Space wrap size="small" orientation="vertical">
|
||||||
<Input.TextArea rows={1} placeholder={t("bills.labels.ai.feedback_placeholder")} />
|
<Form.Item name="comments">
|
||||||
</Form.Item>
|
<Input.TextArea
|
||||||
<Button onClick={() => form.submit()} loading={submitting} disabled={submitting}>
|
rows={3}
|
||||||
{t("bills.labels.ai.submit_feedback")}
|
style={{ minWidth: "400px" }}
|
||||||
</Button>
|
placeholder={t("bills.labels.ai.feedback_placeholder")}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Button onClick={() => form.submit()} loading={submitting} disabled={submitting}>
|
||||||
|
{t("bills.labels.ai.submit_feedback")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
</Space>
|
</Space>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useApolloClient, useMutation } from "@apollo/client/react";
|
import { useApolloClient, useMutation } from "@apollo/client/react";
|
||||||
import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react";
|
import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Checkbox, Form, Modal, Space } from "antd";
|
import { Button, Checkbox, Divider, Form, Modal, Space } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useEffect, useMemo, useRef, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -477,27 +477,34 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
}}
|
}}
|
||||||
footer={
|
footer={
|
||||||
<Space align="top">
|
<Space orientation="vertical">
|
||||||
{isAiScan && <BillAiFeedback billForm={form} rawAIData={rawAIData} />}
|
{isAiScan && (
|
||||||
<Checkbox checked={generateLabel} onChange={(e) => setGenerateLabel(e.target.checked)}>
|
<>
|
||||||
{t("bills.labels.generatepartslabel")}
|
<BillAiFeedback billForm={form} rawAIData={rawAIData} />
|
||||||
</Checkbox>
|
<Divider orientation="horizontal" />
|
||||||
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
</>
|
||||||
<Button loading={loading} onClick={() => form.submit()} id="save-bill-enter-modal">
|
|
||||||
{t("general.actions.save")}
|
|
||||||
</Button>
|
|
||||||
{billEnterModal.context && billEnterModal.context.id ? null : (
|
|
||||||
<Button
|
|
||||||
type="primary"
|
|
||||||
loading={loading}
|
|
||||||
onClick={() => {
|
|
||||||
setEnterAgain(true);
|
|
||||||
}}
|
|
||||||
id="save-and-new-bill-enter-modal"
|
|
||||||
>
|
|
||||||
{t("general.actions.saveandnew")}
|
|
||||||
</Button>
|
|
||||||
)}
|
)}
|
||||||
|
<Space wrap align="top">
|
||||||
|
<Checkbox checked={generateLabel} onChange={(e) => setGenerateLabel(e.target.checked)}>
|
||||||
|
{t("bills.labels.generatepartslabel")}
|
||||||
|
</Checkbox>
|
||||||
|
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
||||||
|
<Button loading={loading} onClick={() => form.submit()} id="save-bill-enter-modal">
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
{billEnterModal.context && billEnterModal.context.id ? null : (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={loading}
|
||||||
|
onClick={() => {
|
||||||
|
setEnterAgain(true);
|
||||||
|
}}
|
||||||
|
id="save-and-new-bill-enter-modal"
|
||||||
|
>
|
||||||
|
{t("general.actions.saveandnew")}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
destroyOnHidden
|
destroyOnHidden
|
||||||
|
|||||||
Reference in New Issue
Block a user