Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Fields in modal window are copied to the one in the back #1831

Closed
metas-lc opened this issue Jun 4, 2018 · 5 comments
Closed

Fields in modal window are copied to the one in the back #1831

metas-lc opened this issue Jun 4, 2018 · 5 comments

Comments

@metas-lc
Copy link

metas-lc commented Jun 4, 2018

Is this a bug or feature request?

bug

What is the current behavior?

if you have fields that are called the same in a process and in a normal window, and you set them in the process, then they are set in the normal window as well

Which are the steps to reproduce?

  1. create a new manufacturing order, like this one https://w101.metasfresh.com:8443/window/53009/1000044

  2. take a look on attributes field
    => there are only 3 you can set. Leave them for now
    image

  3. in the same tab, open "Business Partner Revenue" process

  4. set a product (a different one that you have in your order) and some attributes (like country)

  5. cancel the process

  6. see product and the attributes from your manufacturing order
    => product and attributes are from the process
    => instead of 3 attributes you see all
    image

What is the expected or desired behavior?

@metas-lc metas-lc added this to the Backlog milestone Jun 4, 2018
@siemiatj siemiatj self-assigned this Jun 4, 2018
@siemiatj
Copy link
Contributor

siemiatj commented Jun 5, 2018

The way it works now, is we're updating fields with the same name both in the modal and master view. I think it's for the cases, when user is for instance editing some products displayed in the table.

export function updatePropertyValue(property, value, tabid, rowid, isModal) {
  return dispatch => {
    if (tabid && rowid) {
      dispatch(
        updateRowFieldProperty(property, { value }, tabid, rowid, 'master')
      );
      if (isModal) {
        dispatch(updateDataFieldProperty(property, { value }, 'modal'));
      }
    } else {
      dispatch(updateDataFieldProperty(property, { value }, getScope(isModal)));
      if (isModal) {
        //update the master field too if exist
        dispatch(updateDataFieldProperty(property, { value }, 'master'));
      }
    }
  };
}

this Business Partner Revenue seems to be an edge-case, so I need to figure out how to handle that.

@siemiatj
Copy link
Contributor

@teosarca to be able to fix that we'd need a flag for windows that open in modals, but are not related to content beneath them (so for instance the aforementioned Business Partner Revenue is completely separate from whathever it's displayed over vs editing Address on Business Partner page). Or fields would need completely unique names.

@teosarca
Copy link
Member

teosarca commented Jul 2, 2018

@siemiatj i think we don't need a flag. we can just have some rules, e.g.

  • process parameters panel shall never influence the document behind
  • to check if we are talking about same document we just need to compare the windowId and documentId
    wdyt?

@siemiatj
Copy link
Contributor

I thought I've already checked the document and window id's but maybe I'm wrong. Just blocking background fields updates for process modals should be enough I think.

metas-mk added a commit to metasfresh/metasfresh that referenced this issue Jul 17, 2018
Adds new Issue
metasfresh/metasfresh-webui-frontend-legacy#1831
Fields in modal window are copied to the one in the back
@metas-lc metas-lc self-assigned this Jul 17, 2018
@metas-lc
Copy link
Author

IT
repeated the testcase above
=> product and attributes were not copied OK

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants