Skip to content

Commit

Permalink
Merge pull request #333 from jembi/config-def-updates
Browse files Browse the repository at this point in the history
Config def updates
  • Loading branch information
rcrichton committed Oct 6, 2015
2 parents 104e6cd + c9e0ace commit c73f7b5
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 70 deletions.
14 changes: 14 additions & 0 deletions app/scripts/controllers/mediatorDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@ angular.module('openhimConsoleApp')
/** Initial page load functions **/
/***************************************************/

var createParamDefMap = function (mediator) {
var map = {};
if (mediator.config) {
Object.keys(mediator.config).map(function (param) {
map[param] = mediator.configDefs.filter(function (def) {
return def.param === param;
})[0];
});
}
return map;
};

var querySuccess = function(mediatorDetails){
MediatorDisplay.formatMediator(mediatorDetails);
$scope.mediatorDetails = mediatorDetails;
$scope.mediatorDefsMap = createParamDefMap(mediatorDetails);
};

var queryError = function(err){
// on error - add server error alert
Alerting.AlertAddServerMsg(err.status);
};


$scope.$on('mediatorConfigChanged', function () {
Api.Mediators.get({ urn: $routeParams.urn }, querySuccess, queryError);
});
Expand Down
81 changes: 40 additions & 41 deletions app/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ body {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6887c4), color-stop(100%,#4566a9));
background: -webkit-linear-gradient(top, #6887c4 0%,#4566a9 100%);
background: -o-linear-gradient(top, #6887c4 0%,#4566a9 100%);
background: -ms-linear-gradient(top, #6887c4 0%,#4566a9 100%);
background: linear-gradient(to bottom, #6887c4 0%,#4566a9 100%);
background: -ms-linear-gradient(top, #6887c4 0%,#4566a9 100%);
background: linear-gradient(to bottom, #6887c4 0%,#4566a9 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6887c4', endColorstr='#4566a9',GradientType=0 );
border: 1px solid #3B4868;
border-radius: 3px 3px 3px 3px;
Expand All @@ -522,8 +522,8 @@ body {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6887c4), color-stop(100%,#5773AC));
background: -webkit-linear-gradient(top, #6887c4 0%,#5773AC 100%);
background: -o-linear-gradient(top, #6887c4 0%,#5773AC 100%);
background: -ms-linear-gradient(top, #6887c4 0%,#5773AC 100%);
background: linear-gradient(to bottom, #6887c4 0%,#5773AC 100%);
background: -ms-linear-gradient(top, #6887c4 0%,#5773AC 100%);
background: linear-gradient(to bottom, #6887c4 0%,#5773AC 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6887c4', endColorstr='#5773AC',GradientType=0 );
}
.login-wrapper .box .social a.face_login span.face_icon{
Expand Down Expand Up @@ -653,9 +653,9 @@ body {
}

.transactionsCheckboxTD label{
margin: 0px;
line-height: 0px;
padding: 10px;
margin: 0px;
line-height: 0px;
padding: 10px;
float: left;
}

Expand All @@ -664,12 +664,12 @@ body {
}

.transactionsButtonsDiv{
display: inline-block;
width: 100%;
display: inline-block;
width: 100%;
}

.transactionsAlerts{
clear: both;
clear: both;
margin-bottom: 20px;
}

Expand All @@ -696,8 +696,8 @@ body {
.has-error-tab a { color: #a94442 !important; border-left-color: #a94442 !important; border-top-color: #a94442 !important; border-right-color: #a94442 !important; }
.has-error-tab i { display: block !important; position: absolute; top: 10px; left: 10px; }

.btn-group .btn-primary:hover { text-decoration: underline }
.btn-group .btn-primary.active { text-decoration: underline }
.btn-group .btn-primary:hover { text-decoration: underline }
.btn-group .btn-primary.active { text-decoration: underline }

.table-list:hover td{ cursor: pointer; color: #fff; background-color: #428BCA !important; }

Expand Down Expand Up @@ -735,8 +735,8 @@ body {
.channelAlertUserDropDown { float: left; width: auto; margin-right: 20px; margin-bottom: 20px; }
.groupUserDropDown { float: left; width: auto; margin-right: 20px; margin-bottom: 5px; }

.reload-metrics-btn { margin: 5px; }
.reload-metrics-btn:hover { cursor: pointer; }
.reload-metrics-btn { margin: 5px; }
.reload-metrics-btn:hover { cursor: pointer; }

.load-metrics-line-graph { width: 49%; float: left; }
.response-time-metrics-line-graph { width: 49%; float: right; }
Expand Down Expand Up @@ -833,10 +833,10 @@ body {
width: 70px;
}
.drop-box {
width: 100%;
height: auto;
padding: 30px;
margin: 0px;
width: 100%;
height: auto;
padding: 30px;
margin: 0px;
font-size: 18px;
background: #F8F8F8;
border: 5px dashed #DDD;
Expand Down Expand Up @@ -988,7 +988,7 @@ body {

.header{
height:auto;
}
}
.header .logo{
text-align:center;
}
Expand All @@ -1000,7 +1000,7 @@ body {
width:100%;
float:none;
position:relative;
}
}
.mainy{
margin-left: 0px;
}
Expand All @@ -1020,11 +1020,11 @@ body {
border-bottom:0px;
box-shadow:0px 0px 1px #0fa6bc;
border-radius:10px;
}
}

.login-wrapper {
width: 50%;
}
}
}

/* Tablets */
Expand Down Expand Up @@ -1063,47 +1063,47 @@ body {
.endpoints_div { width: 100% !important; float: left; margin: 0px; }

/* Force table to not be like tables anymore */
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
}
#counter {
display: none;
}
/* Hide table headers (but not display: none;, for accessibility) */
#no-more-tables thead tr {
#no-more-tables thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}

#no-more-tables tr { border: 1px solid #ccc; }

#no-more-tables td {
#no-more-tables td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
border-bottom: 1px solid #eee;
position: relative;
padding: 8px 8px 8px 50%;
padding: 8px 8px 8px 50%;
white-space: normal;
text-align:left;
width: 100%;
min-height: 26px;
line-height: 10px;
}

#no-more-tables td:before {
#no-more-tables td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 8px;
left: 8px;
width: 45%;
padding-right: 10px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
text-align:left;
font-weight: bold;
Expand All @@ -1124,7 +1124,7 @@ body {
#no-more-tables table tr th, #no-more-tables table tr td { max-width: none; line-height: 12px; }
#no-more-tables table tr th, #no-more-tables table tr td { max-width: none; line-height: 12px; }

.transactionsCheckboxTD { padding: 0px !important; }
.transactionsCheckboxTD { padding: 0px !important; }
.transactionsCheckboxTD label { padding: 0px; }
.responsiveTransactionIndexCheckbox span { display: none; }
.responsiveTransactionIndexCheckbox label { display: block; margin: 0; text-align: right; padding: 5px; }
Expand Down Expand Up @@ -1198,12 +1198,12 @@ footer a {
}

.btn-primary {
background-color: #036633;
background-color: #036633;
border-color: #028A3B;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary {
background-color: #028A3B;
background-color: #028A3B;
border-color: #036633;
}

Expand All @@ -1212,7 +1212,7 @@ footer a {
}

.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active {
background-color: #036633;
background-color: #036633;
border-color: #028A3B;
}

Expand Down Expand Up @@ -1269,7 +1269,6 @@ footer{ box-shadow: none; }

select:hover { cursor: pointer; }
label { position: relative; }
.glyphicon-question-sign{ color: #333333; font-size: 15px; position: absolute; right: -25px; top: 0px; }
.glyphicon-question-sign:hover{ cursor: pointer; }
.tooltip-inner{ min-width: 200px !important; }

Expand Down
4 changes: 3 additions & 1 deletion app/views/mediatorConfigModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ <h4 class="modal-title" id="addMediatorConfigLabel">

<div class="form-group-2columns" ng-repeat="def in mediator.configDefs">
<div class="form-group" style="float: left;">
<label>{{def.param}}</label>
<label ng-if="def.displayName">{{def.displayName}}</label>
<label ng-if="!def.displayName">{{def.param}}</label>
<i ng-if="def.description" tooltip="{{def.description}}" class="glyphicon glyphicon-question-sign tooltip-wide"></i>
</div>
<div class="form-group" style="float: right;">

Expand Down
19 changes: 12 additions & 7 deletions app/views/mediatorDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>
<tr>
<td><strong>Endpoints: </strong></td>
<td style="padding: 0px;">

<table class="table table-striped transactionTable" style="margin-bottom: 0px;">
<tr>
<th style="border-top: 0px">Name: </th>
Expand All @@ -68,28 +68,33 @@ <h2>

</td>
</tr>
<tr>
<tr>
<td>
<strong>Configuration </strong>
<button ng-hide="!mediatorDetails.configDefs || mediatorDetails.configDefs.length === 0" class="btn btn-info btn-xs" ng-click="editMediatorConfig()" tooltip="configure mediator"><i class="glyphicon glyphicon-cog"></i></button>
</td>
<td>

<table class="table table-striped transactionTable" style="margin-bottom: 0px;">
<tr>
<th style="border-top: 0px">Setting: </th>
<th style="border-top: 0px">Value: </th>
</tr>
<tr ng-repeat="(k, v) in mediatorDetails.config">
<td style="width: 25%"><strong>{{k}}</strong></td>
<td style="width: 25%">
<strong>
<span ng-if="mediatorDefsMap[k].displayName">{{mediatorDefsMap[k].displayName}}</span>
<span ng-if="!mediatorDefsMap[k].displayName">{{k}}</span>
</strong>
<i ng-if="mediatorDefsMap[k].description" tooltip="{{mediatorDefsMap[k].description}}" class="glyphicon glyphicon-question-sign"></i>
</td>
<td style="width: 75%">{{v}}</td>
</tr>
</table>

</td>
</tr>
</tr>
</table>


</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/partials/channels-tab-basic-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="addUrlRegexDelimiterDiv">
<label>
<input type="checkbox" ng-model="urlPattern.regex" style="margin-top: 0px; vertical-align: middle;" /> Auto-add<br />regex delimiters
<i ng-show="uiSettings.showTooltips" tooltip="This automatically adds start and ending anchors to the URL pattern regex. This is generally what you want." class="glyphicon glyphicon-question-sign"></i>
<i ng-show="uiSettings.showTooltips" tooltip="This automatically adds start and ending anchors to the URL pattern regex. This is generally what you want." class="glyphicon glyphicon-question-sign" style="font-size: 12px"></i>
</label>
</div>
<div class="has-error-msg" style="clear: both; margin-top: 5px;"><i class="glyphicon glyphicon-warning-sign"></i>{{validationRequiredMsg}}</div>
Expand Down Expand Up @@ -71,8 +71,8 @@
<div class="btn-group">
<label class="btn btn-primary" ng-model="channel.authType" btn-radio="'private'">Private</label>
<label class="btn btn-primary" ng-model="channel.authType" btn-radio="'public'">Public</label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label>
Expand Down
Loading

0 comments on commit c73f7b5

Please sign in to comment.