Skip to content

Commit

Permalink
INTGW-602: added WUM changes to jaggery components
Browse files Browse the repository at this point in the history
  • Loading branch information
hamlakshan authored and jaadds committed Jul 1, 2019
1 parent b472e91 commit a12cd5c
Show file tree
Hide file tree
Showing 92 changed files with 2,329 additions and 636 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ var isScopeExist = function (scope, username, roleName) {
} catch (e) {
log.error(e.message);
return {
error:e
error:true
};
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%
var searchAPIs = function (username,apiName, start, end) {
var searchAPIs = function (username,query, start, end) {
var i,api,apis,length, result, log = new Log(),
provider = jagg.module("manager").getAPIProviderObj();
try {
result = provider.searchPaginatedAPIs(username, apiName, start, end);
result = provider.searchPaginatedAPIs(username, query, start, end);
if (log.isDebugEnabled()) {
log.debug("searchAPI : " + stringify(apis));
}
Expand Down Expand Up @@ -56,4 +56,4 @@ var searchAccessTokens = function (query) {
};
}
};
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,20 @@ var log = new Log();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
}

var APIUtil = Packages.org.wso2.carbon.apimgt.impl.utils.APIUtil;
var apiUtil = new APIUtil();
var swaggerPath = apiUtil.getOpenAPIDefinitionFilePath(apiNameVal, apiVersionVal, providerVal);
var registry = carbon.server.osgiService('org.wso2.carbon.registry.core.service.RegistryService').getGovernanceUserRegistry(jagg.getUser(), tenantID);
url = swaggerPath + "swagger.json";
data = registry.get(url);
var APIUtil = Packages.org.wso2.carbon.apimgt.impl.utils.APIUtil;
var apiUtil = new APIUtil();
var swaggerPath = apiUtil.getOpenAPIDefinitionFilePath(apiNameVal, apiVersionVal, providerVal);
var user = jagg.getUser();
if (user && user.username) {
var MultitenantUtils = Packages.org.wso2.carbon.utils.multitenancy.MultitenantUtils;
username = MultitenantUtils.getTenantAwareUsername(user.username);
} else {
username = "wso2.anonymous.user";
}
var registry = carbon.server.osgiService('org.wso2.carbon.registry.core.service.RegistryService')
.getGovernanceUserRegistry(username, tenantID);
url = swaggerPath + "swagger.json";
data = registry.get(url);
} finally {
if (isTenantFlowStarted) {
PrivilegedCarbonContext.endTenantFlow();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jagg.block("listing", {
var currentPage = page;
var start = itemsPerPage*(page-1);
if (query) {
if (query.indexOf(':') == -1) {
query = "content:" + query;
}
mod = jagg.module("search");
result = mod.searchAPIs(null,query,String(start),String(itemsPerPage));
apis = null;
Expand All @@ -51,7 +54,11 @@ jagg.block("listing", {
if (result.response != null) {
apis = result.response.apis;
length = result.response.totalLength;
error = result.error;
if (!result.error) {
error = result.error;
} else {
error = true;
}
message = result.message;
mode = "listing";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include("/jagg/jagg.jag");
result = mod.getAllTags();
if (result.error) {
obj = {
error:result.error,
error:true,
message:msg.error.backendError(action)
};
} else {
Expand All @@ -31,4 +31,4 @@ include("/jagg/jagg.jag");
});
}
}());
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(jagg.isCSRFTokenValid())
result = mod.updateTierPermissions(tierPermission);
if (result.error) {
obj = {
error:result.error,
error:true,
message:result.message
};
} else {
Expand All @@ -48,4 +48,4 @@ if(jagg.isCSRFTokenValid())
}
}());
%>
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include("/jagg/jagg.jag");
result = mod.getProviderAPIVersionUsage(provider, apiName);
if (result.error) {
obj = {
error:result.error,
error:true,
message:msg.error.backendError(action)
};
} else {
Expand Down Expand Up @@ -94,4 +94,4 @@ include("/jagg/jagg.jag");
}
}
}());
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(jagg.isCSRFTokenValid())
result = mod.updateSubscription(api, appId,newStatus);
if (result.error) {
obj = {
error:result.error,
error:true,
message:result.message
};
} else {
Expand All @@ -44,4 +44,4 @@ if(jagg.isCSRFTokenValid())
}
}
}());
%>
%>
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@
"Visible to my Domain": "Visible to my Domain",
"WADL": "WADL",
"WSDL": "WSDL",
"WSDL Archive/File": "WSDL Archive/File",
"WSDL Endpoint": "WSDL Endpoint",
"WSDL Url" : "WSDL Url",
"WSO2 API Manager uses HTTP Head to check the validity of the endpoint.": "WSO2 API Manager uses HTTP Head to check the validity of the endpoint.",
"WSO2 API Publisher Home": "WSO2 API Publisher Home",
"WSO2 copyright": "WSO2 copyright",
Expand Down Expand Up @@ -645,5 +647,7 @@
"Delete Task" : "Delete Task",
"Authorization Header": "Authorization Header",
"Here a custom authorization header can be defined as a replacement to the default <strong>Authorization</strong> header used to send a request. If a value is specified here, that will be used as the header field to send the access token in a request to consume the API": "A custom authorization header can be defined here as a replacement to the default <strong>Authorization</strong> header used to send a request. If a value is specified here, it will be used as the header field to send the access token in a request to consume the API",
"You have selected Microgateways for this API. The mediation policies selected here will not be applied in Microgateway environments.":"You have selected Microgateways for this API. The mediation policies selected here will not be applied in Microgateway environments."
"You have selected Microgateways for this API. The mediation policies selected here will not be applied in Microgateway environments.":"You have selected Microgateways for this API. The mediation policies selected here will not be applied in Microgateway environments.",
"Deprecate old versions after publish the API": "Deprecate old versions after publish the API",
"Requires re-subscription when publish the API": "Requires re-subscription when publish the API"
}
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@
"Visible to my Domain": "Visible to my Domain",
"WADL": "WADL",
"WSDL": "WSDL",
"WSDL Archive/File": "WSDL Archive/File",
"WSDL Endpoint": "WSDL Endpoint",
"WSDL Url" : "WSDL Url",
"WSO2 API Manager uses HTTP Head to check the validity of the endpoint.": "WSO2 API Manager uses HTTP Head to check the validity of the endpoint.",
"WSO2 API Publisher Home": "WSO2 API Publisher Home",
"WSO2 copyright": "WSO2 copyright",
Expand Down Expand Up @@ -616,5 +618,8 @@
"You must select a mediation policy to download": "You must select a mediation policy to download.",
"Error while retrieving the selected mediation policy": "Error while retrieving the selected mediation policy.",
"API swagger definition is invalid" : "API swagger definition is invalid",
"Error while updating API swagger definition" : "Error while updating API swagger definition"
"Error while updating API swagger definition" : "Error while updating API swagger definition",
"Download Document" : "Download Document",
"View Document" : "View Document",
"Document" : "Document"
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,53 @@ input.ep-field{
min-width:155px;
}

.document-match-icon {
position:center;
opacity:1;
}

.square-element .document-match-icon{
display:block;
background:rgba(0, 0, 0, 0.3);
width:100%;
height:100%;
position:absolute;
}

.square-element .document-match-icon i{
padding:2px;
font-size:6vw;
position:absolute;
top:30%;
left:30%;
width:40%;
height:40%;
}

.thumbnail .square-element{
background-color:white;
}

.app-data #document-match{
margin-bottom: 0px
}

.app-data #doc-name a{
color:#ce8c2f;
}

.app-data #document-type-label{
text-transform: capitalize;
}

.app-data #document-type-label{
text-transform: capitalize;
}






/* =============================================================================
* Wso2.telco styles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ $( document ).ready(function() {

$("#startFromExistingSOAPEndpoint").click(function(){
var wsdlURL = $('#wsdl-url').val();
if (wsdlURL.trim() == "" || wsdlURL.toLowerCase().indexOf("wsdl") < 0) {
var wsdlFile = $('#wsdl-file').val();
if ( wsdlFile.trim() == "" && (wsdlURL.trim() == "" || wsdlURL.toLowerCase().indexOf("wsdl") < 0)) {
$('#wsdl-url').addClass('error');
$('.wsdlError').show();
console.log("Wrong endpoint.");
Expand Down Expand Up @@ -231,6 +232,18 @@ $( document ).ready(function() {
});
});

$('input[type=radio][name=wsdl-options-select]').change(function() {
if(this.value === 'url') {
$('#wsdl-url-section').show();
$('#wsdl-file-section').hide();
$('input[name=soap-options-rest]').attr("disabled",false);
} else if(this.value === 'archive') {
$('#wsdl-url-section').hide();
$('#wsdl-file-section').show();
$('input[name=soap-options-rest]').attr("disabled",true);
}
});

$('.toggleContainers .controls').hide();
$('.toggleRadios input[type=radio]').prop('checked', false);
$('.toggleRadios input[type=radio]').click(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,36 @@
<div id="accordion1-collapse2" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<form class="form-horizontal" id="startFromExistingSOAPEndpoint-form" enctype="multipart/form-data" action="<%= jagg.url("/site/blocks/item-design/ajax/add.jag") %>">
<div class="form-group">
<div class="col-sm-12">
<label class="radio">
<input type="radio" checked="checked" name="wsdl-options-select" value="url">
<span class="helper"><%=i18n.localize("WSDL Url")%></span>
</label>
<label class="radio">
<input type="radio" name="wsdl-options-select" value="archive">
<span class="helper"><%=i18n.localize("WSDL Archive/File")%></span>
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<div id="wsdl-url-section" class="col-sm-12">
<input id="wsdl-url" name="wsdl-url" class="form-control input-small is_url_valid" type="text" placeholder="http://appserver/services/echo?wsdl"/>
<label for="wsdl-url" class="error wsdlError" style="display:none"><%=i18n.localize("Please use a valid WSDL endpoint")%></label>
</div>
<div id="wsdl-file-section" style="display:none" class="controls col-sm-12">
<div class="input-group input-wrap file-upload-control">
<input type="text" class="form-control" placeholder="Click Browse to add a wsdl archive(.zip) or file " readonly>
<input id="wsdl-file" name="wsdl-file" type="file" title="wsdl-file" class="form-control" multiple>
<label for="wsdl-file" class="error swaggerFileError" style="display:none"><%=i18n.localize("Please use a valid wsdl file")%></label>
<div class="input-group-btn">
<button class="btn btn-primary browse" type="button" title="Browse File">
<i class="fw fw-file-browse" aria-hidden="true"></i> <span
class="hidden-xs"><%=i18n.localize("Browse")%></span>
</button>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 toggleRadios">
Expand Down
Loading

0 comments on commit a12cd5c

Please sign in to comment.