In pipelines store there is a function that start a loop of a component and requires a specific structure and it's the cause of many problems. This function needs to be moved inside the component.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
@filipa you're right, looks like there's some unused code. A couple comments:
tooltip not being set with title
Do the tooltips actually work or no? I'm thinking they should still work because data-original-title is the attribute bootstrap uses internally to track the title. The title attribute is just used to initialize the tooltip, IIRC.
So if you want to update a tooltip dynamically, you have to update the data-original-title attr. Probably wouldn't hurt to set the title attribute for clarity and readability, but it probably doesn't need to be set for tooltips to work.
@brycepj Thanks for the help! The method is called, but the this.currentTime prop doesn't do anything, it's used in an if and it's always true, isn't it?
Regarding tooltip, according to the documentation I think we need to set the title and not data-original-title.
In order to properly update the bootstrap tooltip, we need to destroy it and mount it again in order to update it properly, since we are updating a virtual DOM and bootstrap works on the actual DOM. Me and @fatihacet discussed this not that long ago I believe, what is the MR where we added this change, do you know @fatihacet ?
Regarding tooltip, according to the documentation I think we need to set the title and not data-original-title. In order to properly update the bootstrap tooltip
We're already using data-original-title in many other places. I like it as a solution because it:
allows us to keep $.tooltip out of our Vue components
it requires no extra code
keeps the data flow in our components unidirectional
One other important concern is that on pages with lots of timeagos, using data-original-title means you get to skip running all the initialization and destruction code for every update of every timeago element. That CPU required for large numbers of updates can really add up.
In order to properly update the bootstrap tooltip, we need to destroy it and mount it again in order to update it properly, since we are updating a virtual DOM and bootstrap works on the actual DOM.
I believe Bootstrap just listens for delegated events (registered on document). So as long as the virtual DOM has been applied, Bootstrap can use it.
@filipa Is the best option to re-write it? It seems like an overly complex way to just update some times & if we don't really understand what is happening, then we should really do it a better way.
@brycepj We shouldn't update data-original-title, we can't guarantee that Bootstrap will always use that. The best way is to update the title attribute & then call fixTitle on the element. Sure Bootstrap just changes the data-original-title but this is the correct way. We can even run that on a per element basis $(el).tooltip('fixTitle')