-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1505 from toshiba/releases/feature-improve_additi…
…onal_data_for_component_and_release fix(ui): Display url, email, text of Additional Data for Component/Release reviewed-by: abdul.kapti@siemens-healthineers.com tested-by: abdul.kapti@siemens-healthineers.com
- Loading branch information
Showing
5 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...-portlet/src/main/resources/META-INF/resources/js/components/includes/releases/regexjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright TOSHIBA CORPORATION, 2022. Part of the SW360 Portal Project. | ||
* Copyright Toshiba Software Development (Vietnam) Co., Ltd., 2022. Part of the SW360 Portal Project. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
define('components/includes/releases/regexjs', ['jquery'] , function($) { | ||
function regex(key,value) { | ||
let regexEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; | ||
let regexUrl = /^(https?|chrome):\/\/[^\s$.?#].[^\s]*$/g; | ||
let content = ''; | ||
if (value.match(regexEmail)) { | ||
content += | ||
'<li>' + | ||
'<span class="mapDisplayChildItemLeft">'+ key +': </span>'+ | ||
'<span class="mapDisplayChildItemRight"><a href="mailto:'+ value +'"> '+ value +'</a></span>'+ | ||
'</li>' | ||
} else if (value.match(regexUrl)) { | ||
content += | ||
'<li>' + | ||
'<span class="mapDisplayChildItemLeft">'+ key +': </span>'+ | ||
'<span class="mapDisplayChildItemRight"><a href="'+ value +'"> '+ value +'</a></span>'+ | ||
'</li>' | ||
} else { | ||
content += | ||
'<li>' + | ||
'<span class="mapDisplayChildItemLeft">' + key + ': </span>' + | ||
'<span class="mapDisplayChildItemRight"> ' + value + '</span>' + | ||
'</li>' | ||
} | ||
return content; | ||
} | ||
return { | ||
regex: regex, | ||
}; | ||
}); |