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

processes: provide current selected tab and rows #1295

Closed
teosarca opened this issue Oct 24, 2017 · 7 comments
Closed

processes: provide current selected tab and rows #1295

teosarca opened this issue Oct 24, 2017 · 7 comments

Comments

@teosarca
Copy link
Member

teosarca commented Oct 24, 2017

Is this a bug or feature request?

FR

What is the current behavior?

Consider a single document window (e.g. one sales order - https://w101.metasfresh.com:8443/window/143/1000111).
When pressing on Actions menu, the actions for current document are queried (see http://w101.metasfresh.com:8081/swagger-ui.html#!/window-rest-controller/getDocumentActionsUsingGET_1 ).
Also, the actions for current selected included row from current selected tab where queried, but at the moment of writing this, that feature is broken and shall be fixed by #1279. But that's not in the scope of this task.

image

What is the expected or desired behavior?

Provide selectedTabId and selectedRowIds when querying for document actions

When calling the /rest/api/window/{windowId}/{documentId}/actions also provide following query (URL) params:

  • selectedTabId - which is the currently selected tab Id. e.g. in the case of a Sales order if the Order Line is the selected tab then selectedTabId=1
  • selectedRowIds - which are the currently selected row Ids in the "selectedTabId".

Provide "selectedTab" info when creating a new process instance

When creating a new process instrance, i.e. calling POST /rest/api/process/{processId}, please also provide currently selected tab and rows informations if available.

i.e. the request body shall also contain:

  "selectedTab": {
    "tabId": "currently selected tab ID",
    "rowIds": [ "currently selected rowIds from currently selected tabId" ]

References

The backend was implemented by metasfresh/metasfresh-webui-api-legacy#645
Required for metasfresh/metasfresh#2564.

@pablosichert
Copy link
Contributor

tabId and rowId are sent to POST /rest/api/process/{processId}, but only when viewId is not set. Is this wrong?
https://github.com/metasfresh/metasfresh-webui-frontend/blob/01284ed9992c323b7592ba4a6fc96dc4ee2bc87e/src/actions/WindowActions.js#L833-L843

@pablosichert
Copy link
Contributor

Ok, I see from your swagger link that selectedTab is a dedicated entry with its own tabId and rowIds.

@pablosichert
Copy link
Contributor

Currently selectedIds is passed as query parameter, but it's not documented in the swagger API.

https://github.com/metasfresh/metasfresh-webui-frontend/blob/01284ed9992c323b7592ba4a6fc96dc4ee2bc87e/src/actions/GenericActions.js#L229

Can you confirm that there currently is a mismatch between selectedIds and selectedRowIds and selectedIds should be discontinued?

@teosarca
Copy link
Member Author

@pablosichert

tabId and rowId are sent to POST /rest/api/process/{processId}, but only when viewId is not set. Is this wrong?

I would say that it's not wrong, in case the process is called from single document window.
e.g. one particular sales order - https://w101.metasfresh.com:8443/window/143/1000139
In that case you don't know which is the view id.

For the case when the process is called from a view the viewId shall be set.

@teosarca
Copy link
Member Author

Currently selectedIds is passed as query parameter, but it's not documented in the swagger API.

Yes, they are in swagger, see http://w101.metasfresh.com:8081/swagger-ui.html#!/view-rest-controller/getDocumentActionsUsingGET

Can you confirm that there currently is a mismatch between selectedIds and selectedRowIds and selectedIds should be discontinued?

Nop. They are different things.
First of all, "selectedIds" is used only in /actions endpoint.

About creating a new process instance (i.e. http://w101.metasfresh.com:8081/swagger-ui.html#!/process-rest-controller/createInstanceFromRequestUsingPOST ),
there we have:

  • viewId, viewDocumentIds - (only when the process/action is executed from a view) contains which were the selected rows in that view
  • selectedTab (with tabId and rowIds) - (only when the process/action is executed from a single document, e.g. a precise sales order) contains current document's currently selected tab and currently selected rows from that tab.

If u need to clarifications, pls ping me.

@teosarca
Copy link
Member Author

i think the "Provide "selectedTab" info when creating a new process instance" part is not implemented.
Moving it to development.

@metas-lc
Copy link

metas-lc commented Nov 1, 2017

IT

  1. open a window e.g. sales order
  2. while in gridview, select actions
    => actions?disabled=true OK
  3. select an action, check headers:
    => there is no selectedTabId OK
  4. open a document, select actions
    => actions?disabled=true OK
  5. select an action, check headers:
    => selectedTab:{tabId: "1", rowIds: []} OK
  6. select at least 2 rows in the subtab, select actions
    => actions?disabled=true&selectedTabId=1&selectedRowIds=1000031,1000032 OK
  7. select an action, check headers:
    => selectedTab:{tabId: "1", rowIds: ["1000031", "1000032"]} OK

@metas-lc metas-lc closed this as completed Nov 1, 2017
metas-ts added a commit to metasfresh/metasfresh that referenced this issue Nov 5, 2017
[#2881](#2881) Add a
process that removes pauses and can be ran from Contract window
[#633](metasfresh/metasfresh-webui-api-legacy#633)
Materialdispo Target Warehouse checks Warehouse Routing
[#2895](#2895)
AD_Ref_Table needs lower-case WHERE and FROM
[#2273](#2273) Payment
Selection as real Document
[#2862](#2862) Set
MasterStartDate for a contract when creating from order
[#2880](#2880) Add
greeting to partner quick creation from order
[#656](metasfresh/metasfresh-webui-api-legacy#656)
Address editor fields are not translated
[#654](metasfresh/metasfresh-webui-api-legacy#654)
Address country lookup not working correctly
[#1295](metasfresh/metasfresh-webui-frontend-legacy#1295)
processes: provide current selected tab and rows
[#1295](metasfresh/metasfresh-webui-api-legacy#653)
metasfresh.webui.debug.showColumnNamesForCaption shall be false by
default
[#651](metasfresh/metasfresh-webui-api-legacy#651)
Document references endpoints are not respecting role permissions
[#2878](#2878) Support
for 6 digits AccountNo length in ReferenceNumber
[#1312](metasfresh/metasfresh-webui-frontend-legacy#1312)
Wrong process call
[#2876](#2876) Fix
Recreate printing queue for webui
[#2874](#2874) Create
special filters in printing queue
[metasfresh-dist-orgs#82](metasfresh/metasfresh-dist-orgs#82)
Invoice Medium Address Layout Changes
[#2866](#2866) Make sure
that 'Print All' is working in webui
[#2803](#2803) Set
hostkey for printing module when login in webui
[#2113](#2113) Move
verify BOM process to BOM window

me-45
metas-ts added a commit to metasfresh/metasfresh that referenced this issue Nov 5, 2017
[#2881](#2881) Add a
process that removes pauses and can be ran from Contract window
[#633](metasfresh/metasfresh-webui-api-legacy#633)
Materialdispo Target Warehouse checks Warehouse Routing
[#2895](#2895)
AD_Ref_Table needs lower-case WHERE and FROM
[#2273](#2273) Payment
Selection as real Document
[#2862](#2862) Set
MasterStartDate for a contract when creating from order
[#2880](#2880) Add
greeting to partner quick creation from order
[#656](metasfresh/metasfresh-webui-api-legacy#656)
Address editor fields are not translated
[#654](metasfresh/metasfresh-webui-api-legacy#654)
Address country lookup not working correctly
[#1295](metasfresh/metasfresh-webui-frontend-legacy#1295)
processes: provide current selected tab and rows
[#1295](metasfresh/metasfresh-webui-api-legacy#653)
metasfresh.webui.debug.showColumnNamesForCaption shall be false by
default
[#651](metasfresh/metasfresh-webui-api-legacy#651)
Document references endpoints are not respecting role permissions
[#2878](#2878) Support
for 6 digits AccountNo length in ReferenceNumber
[#1312](metasfresh/metasfresh-webui-frontend-legacy#1312)
Wrong process call
[#2876](#2876) Fix
Recreate printing queue for webui
[#2874](#2874) Create
special filters in printing queue
[metasfresh-dist-orgs#82](metasfresh/metasfresh-dist-orgs#82)
Invoice Medium Address Layout Changes
[#2866](#2866) Make sure
that 'Print All' is working in webui
[#2803](#2803) Set
hostkey for printing module when login in webui
[#2113](#2113) Move
verify BOM process to BOM window

me-45

(cherry picked from commit b4208ff)
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