SomeFire commented on a change in pull request #90: IGNITE-10203 Fix TC Bot visa on Jira
URL:
https://github.com/apache/ignite-teamcity-bot/pull/90#discussion_r239362340
##########
File path: ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
##########
@@ -5,17 +5,32 @@ function isDefinedAndFilled(val) {
return typeof val !== 'undefined' && val != null
}
-function findGetParameter(parameterName) {
- var result = null,
- tmp = [];
- location.search
- .substr(1)
- .split("&")
- .forEach(function(item) {
- tmp = item.split("=");
- if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
- });
- return result;
+/**
+ * Function return URL parameter from webUrl (if is defined and filled) or from current location of the document.
+ *
+ * @returns {string | null} Search parameter or null.
+ * @param {String} parameterName - Search parameter name.
+ * @param {String | null} webUrl - URL.
+ */
+function findGetParameter(parameterName, webUrl) {
+ if (isDefinedAndFilled(webUrl)) {
+ let url = new URL(webUrl);
+
+ return url.searchParams.get(parameterName);
+ } else {
Review comment:
Redundant `else` statement.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services