This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -277,6 +278,17 @@ const ClearanceForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onEmployeeChange: handleEmployeeChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -328,6 +340,7 @@ const ClearanceForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -270,6 +271,17 @@ const ConcreteRequestForm: React.FC<IRequestFormProps> = ({
|
||||
onForemanChange: handleForemanChange
|
||||
};
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -316,6 +328,7 @@ const ConcreteRequestForm: React.FC<IRequestFormProps> = ({
|
||||
/>
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -293,6 +294,17 @@ const DismissalForm: React.FC<IRequestFormProps> = ({
|
||||
onRemoveOrganization: handleRemoveOrganization
|
||||
};
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -332,6 +344,7 @@ const DismissalForm: React.FC<IRequestFormProps> = ({
|
||||
<ApprovalMatrix editor={matrix} search={(q) => approval.searchUsers(q)} />
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -253,6 +254,17 @@ const EmployeeTransferForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onEmployeeChange: handleEmployeeChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -292,6 +304,7 @@ const EmployeeTransferForm: React.FC<IRequestFormProps> = ({
|
||||
<ApprovalMatrix editor={matrix} search={(q) => approval.searchUsers(q)} />
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -361,6 +362,17 @@ const RecruitingHireForm: React.FC<IRequestFormProps> = ({
|
||||
const resumeAttachments = attachmentsOfCategory(existingAttachments, ATT_CATEGORY_RESUME);
|
||||
const otherAttachments = uncategorizedAttachments(existingAttachments);
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -449,6 +461,7 @@ const RecruitingHireForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
submitValid={isSubmitValid}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -374,6 +375,17 @@ const RecruitingSelectionForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onResponsibleChange: handleResponsibleChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -446,6 +458,7 @@ const RecruitingSelectionForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
submitValid={isSubmitValid}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -390,6 +391,17 @@ const ReferralForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onReferrerChange: handleReferrerChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -467,6 +479,7 @@ const ReferralForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
formId={FORM_ID}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -327,6 +328,17 @@ const ServiceRequestForm: React.FC<IRequestFormProps> = ({
|
||||
onRemoveAnnexFile: handleRemoveAnnexFile
|
||||
};
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -376,6 +388,7 @@ const ServiceRequestForm: React.FC<IRequestFormProps> = ({
|
||||
/>
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -347,6 +348,17 @@ const Ticket1CForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -404,6 +416,7 @@ const Ticket1CForm: React.FC<IRequestFormProps> = ({
|
||||
/>
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
formId="ticket1c"
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -432,6 +433,17 @@ const TmcTransferForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onRequesterChange: handleRequesterChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -503,6 +515,7 @@ const TmcTransferForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -265,6 +266,17 @@ const UnpaidLeaveForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onEmployeeChange: handleEmployeeChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -304,6 +316,7 @@ const UnpaidLeaveForm: React.FC<IRequestFormProps> = ({
|
||||
<ApprovalMatrix editor={matrix} search={(q) => approval.searchUsers(q)} />
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -264,6 +265,17 @@ const VacationForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context, onEmployeeChange: handleEmployeeChange };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -303,6 +315,7 @@ const VacationForm: React.FC<IRequestFormProps> = ({
|
||||
<ApprovalMatrix editor={matrix} search={(q) => approval.searchUsers(q)} />
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
readOnly={readOnly}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Icon,
|
||||
RequestNumber,
|
||||
SubmitActions,
|
||||
getDraftDeleteHandler,
|
||||
useRequestSubmit
|
||||
} from '../../shared/ui';
|
||||
import {
|
||||
@@ -324,6 +325,17 @@ const WorkplaceSetupForm: React.FC<IRequestFormProps> = ({
|
||||
|
||||
const sectionProps = { data, set, context };
|
||||
|
||||
// «Удалить черновик» — только у сохранённой заявки в статусе «Черновик».
|
||||
const handleDelete = getDraftDeleteHandler({
|
||||
formKey: FORM_ID,
|
||||
requestId,
|
||||
requestStatus,
|
||||
listId: editListId,
|
||||
code: requestCode,
|
||||
submit,
|
||||
onDeleted: onCancel
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button type="button" className={styles.back} onClick={onCancel}>
|
||||
@@ -387,6 +399,7 @@ const WorkplaceSetupForm: React.FC<IRequestFormProps> = ({
|
||||
)}
|
||||
|
||||
<SubmitActions
|
||||
onDelete={handleDelete}
|
||||
submit={submit}
|
||||
isValid={isValid}
|
||||
formId={FORM_ID}
|
||||
|
||||
Reference in New Issue
Block a user