Skip to content

Commit

Permalink
OD-19321 Fixed dirty form check
Browse files Browse the repository at this point in the history
  • Loading branch information
yuryyas committed Sep 23, 2024
1 parent 10229ae commit a63f44f
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 25 deletions.
5 changes: 3 additions & 2 deletions client-html/src/js/common/components/list-view/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,9 @@ class ListView extends React.PureComponent<Props & OwnProps & State["list"] & St
};

checkDirty = (handler, args, reset?: boolean) => {
const { isDirty, selection, creatingNew } = this.props;
if (isDirty) {
const { isDirty, selection, creatingNew, fullScreenEditView, records } = this.props;

if (isDirty && (records.layout === 'Two column' ? fullScreenEditView : true)) {
this.showConfirm({
onConfirm: () => {
handler(...args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ class FullScreenEditViewBase extends React.PureComponent<EditViewContainerProps,
dispatch,
rootEntity,
isNested,
nestedIndex,
nameCondition,
showConfirm,
manualLink,
Expand Down Expand Up @@ -246,7 +245,6 @@ class FullScreenEditViewBase extends React.PureComponent<EditViewContainerProps,
manualLink={manualLink}
rootEntity={rootEntity}
isNested={isNested}
nestedIndex={nestedIndex}
form={form}
isNew={creatingNew}
values={values}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const ArticleProductEditView: React.FC<ArticleProductEditViewProps> = props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down Expand Up @@ -83,7 +82,6 @@ const ArticleProductEditView: React.FC<ArticleProductEditViewProps> = props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const ContactEditView = (props: EditViewProps<Contact> & Props) => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down Expand Up @@ -170,7 +169,6 @@ const ContactEditView = (props: EditViewProps<Contact> & Props) => {
dirty,
invalid,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const CorporatePassEditView = props => {
const {
isNew,
isNested,
nestedIndex,
values,
classes,
dispatch,
Expand All @@ -45,7 +44,6 @@ const CorporatePassEditView = props => {
isNew,
isNested,
syncErrors,
nestedIndex,
values,
classes,
dispatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ const BudgetAdornment: React.FC<BudgetAdornmentProps> = ({
const CourseClassEditView: React.FC<Props> = ({
isNew,
isNested,
nestedIndex,
values,
dispatch,
dirty,
Expand Down Expand Up @@ -554,7 +553,6 @@ const CourseClassEditView: React.FC<Props> = ({
itemProps={{
isNew,
isNested,
nestedIndex,
values,
dispatch,
dirty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const DiscountEditView = React.memo<any>(props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand All @@ -76,7 +75,6 @@ const DiscountEditView = React.memo<any>(props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const EnrolmentEditView = props => {
const {
isNew,
isNested,
nestedIndex,
values,
classes,
dispatch,
Expand Down Expand Up @@ -65,7 +64,6 @@ const EnrolmentEditView = props => {
dirty,
invalid,
form,
nestedIndex,
rootEntity,
twoColumn,
submitSucceeded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const MembershipProductEditView: React.FC<MembershipProductEditViewProps> = prop
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down Expand Up @@ -86,7 +85,6 @@ const MembershipProductEditView: React.FC<MembershipProductEditViewProps> = prop
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ interface MessageEditViewProps {
dispatch?: Dispatch<any>;
dirty?: boolean;
form?: string;
nestedIndex?: number;
rootEntity?: string;
twoColumn?: boolean;
showConfirm?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const RoomEditView = props => {
const {
isNew,
isNested,
nestedIndex,
values,
classes,
dispatch,
Expand All @@ -54,7 +53,6 @@ const RoomEditView = props => {
itemProps={{
isNew,
isNested,
nestedIndex,
values,
classes,
dispatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const VoucherProductEditView: React.FC<VoucherProductEditViewProps> = props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand All @@ -77,7 +76,6 @@ const VoucherProductEditView: React.FC<VoucherProductEditViewProps> = props => {
dispatch,
dirty,
form,
nestedIndex,
rootEntity,
twoColumn,
showConfirm,
Expand Down
2 changes: 0 additions & 2 deletions client-html/src/js/model/common/ListView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export interface EditViewContainerProps<E = any> extends Partial<InjectedFormPro
manualLink?: any;
isNested?: boolean;
match?: any;
nestedIndex?: number;
nameCondition?: AnyArgFunction;
updateCaption?: (arg: string) => React.Component;
threeColumn?: boolean;
Expand All @@ -119,7 +118,6 @@ export interface EditViewProps<V = any> extends Partial<InjectedFormProps<V>> {
onScroll?: AnyArgFunction;
twoColumn?: boolean;
isNested?: boolean;
nestedIndex?: number;
onCloseClick?: AnyArgFunction;
syncErrors?: FormErrors<V>;
tabIndex?: number;
Expand Down

0 comments on commit a63f44f

Please sign in to comment.