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

Show view sticky/readonly filters #864

Closed
teosarca opened this issue Jun 10, 2017 · 10 comments
Closed

Show view sticky/readonly filters #864

teosarca opened this issue Jun 10, 2017 · 10 comments

Comments

@teosarca
Copy link
Member

Type of issue

Feature request

Current behavior

Take following example:

Now, in this view, there is no way for the user to know from where she/he came from, why are just a few customer shipments, what she/he is seeing.

Expected behavior

Abstract

Internally, along with the regular filters (which user sees and which user can change) we also have "sticky filters".
The sticky filters are readonly filters (user cannot change them) which are attached to that view on view creation. That's done by the API automatically.
In the example above, the API attached a sticky filter to "Shipments" view which is filtering only those shipments which are referencing that Sales Order.

Approach suggestion

Backend:

Frontend:

  • shall render those stickFilters after the other regular filters, but on the same line.
  • the stickyFilters buttons shall look like the other filter buttons but grayed out (not pressable).
  • nice to have: the sticky filter button shall have an "X" icon. If user presses on it, the filter shall be taken out => TODO: we need an API for that.

It shall look something like in the picture below.
NOTE: the "order # 12345"it's actually the sticky filter's caption
image

wdyt?

@damianprzygodzki
Copy link
Contributor

Low entry point. I've checked and the property that we differentiate filters on is frequent. In my opinion it will be okay to change it to type | filterType to tell frontend that filters is:
-frequent
-regular
-sticky (isnt better name static?)

@teosarca
Copy link
Member Author

Shall be available on next rollout, e.g.
image

@teosarca
Copy link
Member Author

Quick tested, using https://w101.metasfresh.com:8443/window/169?refId=1003908&refType=143
but it's not working...

image

@damianprzygodzki
Copy link
Contributor

damianprzygodzki commented Jun 22, 2017

But, now i see, that you are sending only filters in data. But rendering is based on layout.

Try to send that in layout and it will be working - we can render empty filter without data, but not just data for active filter.

If you can't provide the static filter because you have no viewId, lets say that if for static filters is no data delivered, we will hide it.

@teosarca
Copy link
Member Author

teosarca commented Jun 22, 2017

But we talked and agreed that it will be like this.
I cannot send you that in layout because the static/sticky filters are data related and not layout related.

Take a look here, #864 (comment)
API did not change after that.


Abstract: the use case where we want to use this is when we open referenced documents.
The layout is the same (and also there is no viewId when acquiring the layout),
but just the data is different. There we have that sticky/static filter which makes sure that only the referenced documents fetched.

@teosarca
Copy link
Member Author

NOTE: also you are free to propose alternative solutions (even though it's a bit late in case of this task),
if those solutions are solving the core requirement.

@damianprzygodzki
Copy link
Contributor

damianprzygodzki commented Jun 22, 2017

I think that ive proposed one already. Without layout, there can't be filters rendered.

If you can't provide the static filter because you have no viewId, lets say that if for static filters is no data delivered, we will hide it.

@teosarca
Copy link
Member Author

teosarca commented Jun 22, 2017

If you can't provide the static filter because you have no viewId, lets say that if for static filters is no data delivered, we will hide it.

hmm, not sure if I understood it correctly... but if I got it right, i would say it's not possible because we really don't know that when we are generating the layout.
We even don't know the filterId or the filter's caption or how many sticky/static filters there are.
We know about those sticky filters only when we are really creating the view.

e.g. I am trying to open the Billing candidates (document references) from a given Sales Order.
The windowId and the layout of billing candidates is exactly the same when i am opening the "Billing candidates" from menu or when I am opening it from referenced documents.
And they shall be like that. The whole look and feel and functionalities shall be the same.

The difference between those 2 cases, "opening from menu)"and "opening from document references" is how we are creating the view data.
In "opening from menu" case we are allowing all sales orders.
In "opening from document references" we are enforcing a filter which says "allow only those which are referencing the sales order 1234567". That's a sticky filter. It's a filter which is always present and you cannot change it.

That sticky filter cannot be in layout simply because it's not about layouting. It's about data.
If it would be in the layout then the layout would be about filtering by "sales order 1234567" which is not correct.

More, we even cannot provide a list of available sticky filters in layout because it's not known. Those connections are auto-magically discovered by some core API which enables us to quickly introduce more documents even from different modules and let the API discover the connections between them.

To conclude, basically those are the reasons why the filter cannot be in the layout, from my point of view.

You might think to change the code in a way that accepts filters layout (as it is now) and also accept those sticky/static filters from data. Those sticky/static filters are pretty basic (e.g. no parameters, no need to send queries from them etc) and will stay like that. They are more like some labels which in future might have the option to delete it.

If you find it unacceptable, please propose a realistic solution which can be implemented on backend side too.

metas-ts added a commit to metasfresh/metasfresh that referenced this issue Jun 25, 2017
[#474](metasfresh/metasfresh-webui-api-legacy#474) Dashboard API: specify position when adding a new KPI/target indicator
[metasfresh/metasfresh/issues#1814](#1814) Hide Processed flag from all M_InOut/Returns windows (webui)
[#926](metasfresh/metasfresh-webui-frontend-legacy#926) Board window does not open via Sitemap menu
[#470](metasfresh/metasfresh-webui-api-legacy#470) Cache image endpoint
[#464](metasfresh/metasfresh-webui-api-legacy#464) Dashboard API: unify get available kpis/targetIndicators endpoints
[#465](metasfresh/metasfresh-webui-api-legacy#465) Provide Endpoint w/ entry selections for given Breadcrumb
[#864](metasfresh/metasfresh-webui-frontend-legacy#864) Show view sticky/readonly filters
[#833](metasfresh/metasfresh-webui-frontend-legacy#833) Dashboard Window w/ Swimlane type functionalities
[#1861](#1861) Performance degradation in HUKey.isReadonly()
[#1873](#1873) Fix control amount and qty in payment data imported from camt.54
[#467](metasfresh/metasfresh-webui-api-legacy#467) board API: GET board/{boardId}/card?cardIds
[#913](metasfresh/metasfresh-webui-frontend-legacy#913) Incompatible Sock.js versions

me-45
damianprzygodzki added a commit that referenced this issue Jun 27, 2017
damianprzygodzki added a commit that referenced this issue Jun 27, 2017
@damianprzygodzki
Copy link
Contributor

Hardcoded solution integrated.

Warning! It corrupts filters model so it has to be refactored in future.

@metas-mk
Copy link
Member

Tested.

Testcase window/143/1005665 (Order 2271)
a) Referenced Documents: Shipment Disposition. Jumps to Window window/500221?refId=1005665&refType=143 and sticky Filter "Order 2271" is set. OK

b) Press on Sticky Filter. Is deleted. All unfiltered data is shown. OK

Testcase /window/143/1005620
c) Referenced Documents: Shipment Disposition. Jumps to Window window /window/500221?refId=1005620&refType=143 and sticky Filter "Order 2271" is set. OK

Filter conflict issues appear but will be solved in other tasks as mentioned above.

Closing this Issue.

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

4 participants