Merged in feature/IO-2553-Edit-CC-Unsaved-Changes (pull request #1388)

IO-2553 Unsaved Changes on Edit CC

Approved-by: Dave Richer
This commit is contained in:
Allan Carr
2024-04-02 19:02:28 +00:00
committed by Dave Richer
3 changed files with 13 additions and 5 deletions

View File

@@ -10,11 +10,15 @@ import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel
import CourtesyCarReadiness from "../courtesy-car-readiness-select/courtesy-car-readiness-select.component";
import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
//import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
export default function CourtesyCarCreateFormComponent({
form,
saveLoading,
newCC,
}) {
const { t } = useTranslation();
const client = useApolloClient();
@@ -33,7 +37,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
}
/>
{/* <FormFieldsChanged form={form} /> */}
{newCC ? null : <FormFieldsChanged form={form} />}
<LayoutFormRow header={t("courtesycars.labels.vehicle")}>
<Form.Item
label={t("courtesycars.fields.year")}

View File

@@ -46,7 +46,7 @@ export const QUERY_AVAILABLE_CC = gql`
`;
export const CHECK_CC_FLEET_NUMBER = gql`
query CHECK_VENDOR_NAME($name: String!) {
query CHECK_CC_FLEET_NUMBER($name: String!) {
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
aggregate {
count

View File

@@ -76,7 +76,11 @@ export function CourtesyCarCreateContainer({
onFinish={handleFinish}
layout="vertical"
>
<CourtesyCarFormComponent form={form} saveLoading={loading} />
<CourtesyCarFormComponent
form={form}
saveLoading={loading}
newCC={true}
/>
</Form>
</RbacWrapper>
);