Reformat all project files to use the prettier config file.

This commit is contained in:
Patrick Fic
2024-03-27 15:35:07 -07:00
parent b161530381
commit e1df64d592
873 changed files with 111387 additions and 125473 deletions

View File

@@ -1,64 +1,59 @@
import {useMutation} from "@apollo/client";
import {Button, Form, notification} from "antd";
import React, {useEffect, useState} from "react";
import {useTranslation} from "react-i18next";
import {UPDATE_JOB} from "../../graphql/jobs.queries";
import { useMutation } from "@apollo/client";
import { Button, Form, notification } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import OwnerSearchSelect from "../owner-search-select/owner-search-select.component";
export default function JobAdminOwnerReassociate({job}) {
const {t} = useTranslation();
const [loading, setLoading] = useState(false);
const [form] = Form.useForm();
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
setLoading(true);
const result = await updateJob({
variables: {jobId: job.id, job: {ownerid: values.ownerid}},
});
export default function JobAdminOwnerReassociate({ job }) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [form] = Form.useForm();
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: { ownerid: values.ownerid } }
});
if (!!!result.errors) {
notification["success"]({message: t("jobs.successes.save")});
} else {
notification["error"]({
message: t("jobs.errors.saving", {
error: JSON.stringify(result.errors),
}),
});
}
setLoading(false);
//Get the owner details, populate it all back into the job.
};
if (!!!result.errors) {
notification["success"]({ message: t("jobs.successes.save") });
} else {
notification["error"]({
message: t("jobs.errors.saving", {
error: JSON.stringify(result.errors)
})
});
}
setLoading(false);
//Get the owner details, populate it all back into the job.
};
useEffect(() => {
//form.resetFields();
}, [form, job]);
useEffect(() => {
//form.resetFields();
}, [form, job]);
return (
<div>
<div>{t("jobs.labels.ownerassociation")}</div>
<Form
onFinish={handleFinish}
autoComplete={"off"}
form={form}
initialValues={{ownerid: job.ownerid}}
>
<Form.Item
name="ownerid"
label={t("jobs.fields.owner")}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<OwnerSearchSelect/>
</Form.Item>
</Form>
<div>{t("jobs.labels.associationwarning")}</div>
<Button loading={loading} onClick={() => form.submit()}>
{t("general.actions.save")}
</Button>
</div>
);
return (
<div>
<div>{t("jobs.labels.ownerassociation")}</div>
<Form onFinish={handleFinish} autoComplete={"off"} form={form} initialValues={{ ownerid: job.ownerid }}>
<Form.Item
name="ownerid"
label={t("jobs.fields.owner")}
rules={[
{
required: true
//message: t("general.validation.required"),
}
]}
>
<OwnerSearchSelect />
</Form.Item>
</Form>
<div>{t("jobs.labels.associationwarning")}</div>
<Button loading={loading} onClick={() => form.submit()}>
{t("general.actions.save")}
</Button>
</div>
);
}