Comments (7)
@chirimoya @danrot Do we see this as a requirement for the 2.0 release?
from suluautomationbundle.
Required for me.
from suluautomationbundle.
@danrot any concept about how we could implement this. I could think that it would make sense to refresh the value in a specific interval and that this kind of notification counter does also make sense for the main navigation not only for the tabs as they are not rerender so some kind of polling would be needed.
What we need todo is provide the endpoint where the information does come from and which data need to added to it e.g.:
->setNotificationEndpoint('endpoint')
->addRouterAttributesToNotificationRequest(['id' => 'id']) // data from the router attributes
->addAttributesNotificationRequest(['type' => 'page']); // static data
->setNotificationRefreshRate(60) // optional refresh rate in seconds
from suluautomationbundle.
Questions about this that come to my mind:
- Does this really need to refresh? Adds a lot of complexity, and is probably not that often used. I think @chirimoya has already questioned that at some point in the past.
- How would the response from the endpoint look like? We don't have a simple count request just returning a number yet, and loading all the automation tasks just to display a number seems like a huge overkill. Just tested if calling the List API with a limit of 0 works, which it does (at least for contacts). that would mean that we would not have to load any entities, but could still load the returned
total
attribute. This would then result in a configuration like this:
->setNotificationEndpoint('endpoint') // not sure if I would call this notification, would like a more generic name better
->addRouterAttributesToNotificationRequest(['id' => 'id'])
->addNotificationRequestAttribute(['type' => 'page', 'filter' => ['status' => 'pending'])
The limit of 0 could then be added by the component doing the request to find out about the number.
from suluautomationbundle.
Just had a quick look about this topic.
- I also don't think automatic refreshing is necessary. I would rather say, that a new request should be made everytime the user switches tabs.
- I would not force a specific structure for the response data. We could introduce an
badgeDataCondition
option (not sure about that name tho) which is a jexl condition mapping the response data to a displayable string. So if someone implements a custom endpoint for the badge, he can just return e.g.{"badge": "foo"}
withbadgeDataCondition = "badge"
(or maybe this should be set as default), but if someone uses thecget
endpoint withlimit = 0
,badgeDataCondition
would betotal
.
/cc @sulu/core-team WDYT about that?
from suluautomationbundle.
-
is okay for me at current state to avoid polling and just do it when the tabs are loaded or switched.
-
I think
condition
is here a little bit missleading I think abadgePath
would be a better match as I think you want to use ajsonPointer here.
my_data/total`. Still I think its valid to have it we should make in the automationBundle an endpoint for it and not reuse the exist list endpoint total count to avoid any overfetching.
Maybe we need to keep in mind that a Tab
could have multiple
badges. So maybe need a $view->addBadge();
function and create a ViewBadge object or something with the available options.
from suluautomationbundle.
- 👍
- I would still prefer a jexl expression, because this is way more flexible than just a json pointer. One of the biggest benefits would be the possibility to use jexl transforms. An example could be a
|translate
transform. About the name, what aboutdataPathExpression
? - Yes, sounds reasonable
from suluautomationbundle.
Related Issues (16)
- No permissions throw an error on the page HOT 1
- CMS doesn't take into account GMT timezone correctly when saving task time HOT 2
- Overview and bulk functionality HOT 1
- Missing disabled state for past tasks in ListView HOT 1
- Add link to sulu-documentation
- Missing Save-Button Task Information HOT 3
- Add translations to crowdin HOT 2
- Truncating ta_tasks and ta_task_executions leads to an error in the admin area HOT 4
- SuluAutomationBundle 2.0 Roadmap
- Server error when navigating from page to contacts HOT 2
- Documentation for implementing automation for a custom bundle
- Save button still active after page has been published by automation HOT 3
- Attempted to load class "AutomationViewBuilder" from namespace "Sulu\Bundle\AutomationBundle\Admin\View". Did you forget a "use" statement for another namespace? HOT 1
- Clearing cache when {host} is used in webspace.xml
- SuluAutomationBundle's main.js is not loaded due to wrong path HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suluautomationbundle.