Conversation
… != operator is used for non-strict inequality comparison. Here are a few reasons why you might prefer to use !== instead of !=: The !== operator checks both the value and the type of the operands, whereas the != operator performs type coercion, which can lead to unexpected results. By using !==, you ensure that the values being compared are of the same type, making your code more robust and less prone to errors.
… declared do not change
we did not need to separate the URL variable into a separate "separated" variable so i changed it to one variable to get and split the variable. also replaced some of the vars with const
bahriddin
left a comment
There was a problem hiding this comment.
Thanks for bringing up this PR 👏🏽
I didn't get what exactly this chunk is doing but I am providing general feedback.
|
|
||
| // Check if filter needs to be applied | ||
| if ((window._search != undefined) && (window._search.length > 0 )) { | ||
| if ((window._search !== undefined) && (window._search.length > 0 )) { |
There was a problem hiding this comment.
Have you tested edge cases? AFAIK there is a difference between != and !==. For example,
null != undefined // false
null !== undefined // true| function openRequestedPopup() { | ||
| windowObjectReference = window.open(_scorecard_path, 'Scorecard', strWindowFeatures); | ||
| } | ||
| const openRequestedPopup = () => windowObjectReference = window.open(_scorecard_path, 'Scorecard', strWindowFeatures); |
There was a problem hiding this comment.
Is windowObjectReference used somewhere?
| function refreshParent() { | ||
| window.opener.location.reload(); | ||
| } | ||
| const refreshParent = () => window.opener.location.reload(); |
There was a problem hiding this comment.
I couldn't find its call. Could you please check if there is?
| function openRequestedPopup(team_scorecards_path) { | ||
| windowObjectReference = window.open(team_scorecards_path, 'Team Scorecards', strWindowFeatures); | ||
| } | ||
| const openRequestedPopup = (team_scorecards_path) => windowObjectReference = window.open(team_scorecards_path, 'Team Scorecards', strWindowFeatures); |
There was a problem hiding this comment.
Is windowObjectReference used somewhere?
| window.opener.location.reload(); | ||
| } | ||
|
|
||
| const refreshParent = () => window.opener.location.reload(); |
There was a problem hiding this comment.
I couldn't find its call. Could you please check if there is?
| const url = window.location.href; | ||
| const tail = url.substring(url.lastIndexOf('/') + 1); | ||
|
|
||
| // Remove any query parameters from the segment | ||
| const clean_tail = tail.substring(0, tail.lastIndexOf('?')); |
There was a problem hiding this comment.
It looks like the whole purpose of these lines are to clean up the url. In this case we should wrap it into one function. Please, take this code as an example only:
| const url = window.location.href; | |
| const tail = url.substring(url.lastIndexOf('/') + 1); | |
| // Remove any query parameters from the segment | |
| const clean_tail = tail.substring(0, tail.lastIndexOf('?')); | |
| ... | |
| const url_tail_without_parameters = url => { | |
| const tail = url.substring(url.lastIndexOf('/') + 1); | |
| // Remove any query parameters from the segment | |
| return tail.substring(0, tail.lastIndexOf('?')); | |
| } | |
| ... | |
| const clean_tail = url_tail_without_parameters(window.location.href); |
| $("#team_data_set_description").css("height", $("#hiddendescription").outerHeight()); | ||
| } catch (e) { | ||
|
|
||
| console.error('An error occured.', e) |
There was a problem hiding this comment.
Dp we use some error monitoring service like BugSnag?
Pull Request Checklist
mainbranch