#25254 closed defect (fixed)

Replace the getPosition function in metrics-web's bootstrap JS from bootstrap 3.3.5

Reported by: irl Owned by: irl
Priority: Medium Milestone:
Component: Metrics/Website Version:
Severity: Normal Keywords:
Cc: metrics-team Actual Points:
Parent ID: #23518 Points:
Reviewer: Sponsor:

Description

metrics-web uses bootstrap 3.3.7 which has a broken getPosition function. It worked in 3.3.5 and a fix would be to just include the 3.3.5 version in place of the 3.3.7 version. This is needed as without it, the tooltips in Relay Search would not display at the correct place on the page.

Child Tickets

Change History (5)

comment:1 Changed 14 months ago by irl

Owner: changed from metrics-team to irl
Status: newaccepted

Looking at this.

comment:2 Changed 14 months ago by irl

Cc: metrics-team added
Status: acceptedneeds_review

Please review my branch task/25254.

Where the getPosition function is defined, the innards of that function are replaced with the minimised innards of the getPosition function from the 3.3.5 release. There are no references to minimised variables that were not defined in the function (at least as far as I could follow it).

I've tested this out with Relay Search and it works as expected.

comment:3 Changed 14 months ago by karsten

Hmmm. Can we first evaluate possible alternatives before editing libraries ourselves? For example:

  • Is there a way to redefine this function in our own JavaScript and have it override the one in Bootstrap? Sorry, if this is too naive.
  • Should we downgrade to 3.3.5? What possible downsides does that have?
  • Should we upgrade to 4.x? What can possibly go wrong?

And if neither of these makes sense and we decide we need to make this change to the minimized JavaScript file, is there anything that we link where others have done the same thing before?

comment:4 in reply to:  3 Changed 14 months ago by irl

Replying to karsten:

  • Is there a way to redefine this function in our own JavaScript and have it override the one in Bootstrap? Sorry, if this is too naive.

Not easily, as this is a function that is called by the tooltip library, so we would have to modify the tooltip library or do this for every view where we might use tooltips.

  • Should we downgrade to 3.3.5? What possible downsides does that have?

Looking at the changelogs there are quite a few bug fixes but I've not checked whether or not they would affect us.

  • Should we upgrade to 4.x? What can possibly go wrong?

There's likely to be a lot of API issues. I've already updated Relay Search from Bootstrap 2.0.0 to 3.3.7, it's going to be the same amount of work again to go to 4.x so I'd really rather not do that unless we have someone do a new 4.x design.

And if neither of these makes sense and we decide we need to make this change to the minimized JavaScript file, is there anything that we link where others have done the same thing before?

https://stackoverflow.com/questions/42315216/bootstrap-tooltip-wrong-position-on-svg-element-when-page-is-scrolled-down#44802960

comment:5 Changed 14 months ago by karsten

Resolution: fixed
Status: needs_reviewclosed

Alright, as discussed at today's team meeting, merged and deployed. Saving the 4.x upgrade for later. Closing. Thanks!

Note: See TracTickets for help on using tickets.