Skip to content

Commit 5351a23

Browse files
author
Javier Isoldi
committed
Condition moved to the js. #308.
1 parent 3f5a25d commit 5351a23

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

dist/scripts/api-console.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,15 @@
771771
return newType;
772772
};
773773

774+
var isPattern = function (propertyName) {
775+
return propertyName.match(PATTERN_PATTERN);
776+
};
777+
778+
$scope.isPropertyVisible = function(property) {
779+
return ($scope.showSecuritySchemaProperties || !property[0].isFromSecurityScheme)
780+
&& !isPattern(property[0].displayName);
781+
};
782+
774783
$scope.mergeType = function (type) {
775784
var newType = angular.copy(type);
776785

@@ -782,10 +791,6 @@
782791

783792
$scope.isNativeType = RAML.Inspector.Types.isNativeType;
784793

785-
$scope.isPattern = function (propertyName) {
786-
return propertyName.match(PATTERN_PATTERN);
787-
};
788-
789794
$scope.isSchema = RAML.Inspector.Types.isSchema;
790795

791796
$scope.isCollapsible = function isCollapsible(property) {
@@ -6514,7 +6519,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
65146519
" <li class=\"raml-console-documentation-scheme\" ng-class=\"{'raml-console-is-active':isSchemeSelected(value)}\" ng-click=\"selectDocumentationScheme(value)\" ng-repeat=\"(key, value) in securitySchemes\">{{value.name}}</li>\n" +
65156520
" </ol>\n" +
65166521
"\n" +
6517-
" <p ng-if\"documentationSchemeSelected.description\" markdown=\"documentationSchemeSelected.description\" class=\"raml-console-marked-content\"></p>\n" +
6522+
" <p ng-if=\"documentationSchemeSelected.description\" markdown=\"documentationSchemeSelected.description\" class=\"raml-console-marked-content\"></p>\n" +
65186523
"\n" +
65196524
" <section class=\"raml-console-resource-section raml-console-scheme-headers\" ng-if=\"documentationSchemeSelected.describedBy.headers\">\n" +
65206525
" <h4 class=\"raml-console-resource-heading-a\">Headers</h4>\n" +
@@ -6724,7 +6729,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
67246729
$templateCache.put('directives/properties.tpl.html',
67256730
"<div>\n" +
67266731
" <div class=\"raml-console-resource-param\" ng-repeat=\"property in listArray\"\n" +
6727-
" ng-if=\"(showSecuritySchemaProperties || !property[0].isFromSecurityScheme) && !isPattern(property[0].displayName)\"\n" +
6732+
" ng-if=\"isPropertyVisible(property)\"\n" +
67286733
" ng-init=\"vm.isCollapsed = !!collapsible\">\n" +
67296734
" <div ng-init=\"type = getType(property[0])\">\n" +
67306735
" <h4 class=\"raml-console-resource-param-heading\" style=\"position: relative\">\n" +

src/app/directives/documentation.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h3 class="raml-console-resource-heading-a">Security Schemes</h3>
3636
<li class="raml-console-documentation-scheme" ng-class="{'raml-console-is-active':isSchemeSelected(value)}" ng-click="selectDocumentationScheme(value)" ng-repeat="(key, value) in securitySchemes">{{value.name}}</li>
3737
</ol>
3838

39-
<p ng-if"documentationSchemeSelected.description" markdown="documentationSchemeSelected.description" class="raml-console-marked-content"></p>
39+
<p ng-if="documentationSchemeSelected.description" markdown="documentationSchemeSelected.description" class="raml-console-marked-content"></p>
4040

4141
<section class="raml-console-resource-section raml-console-scheme-headers" ng-if="documentationSchemeSelected.describedBy.headers">
4242
<h4 class="raml-console-resource-heading-a">Headers</h4>

src/app/directives/properties.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
return newType;
4343
};
4444

45+
var isPattern = function (propertyName) {
46+
return propertyName.match(PATTERN_PATTERN);
47+
};
48+
49+
$scope.isPropertyVisible = function(property) {
50+
return ($scope.showSecuritySchemaProperties || !property[0].isFromSecurityScheme)
51+
&& !isPattern(property[0].displayName);
52+
};
53+
4554
$scope.mergeType = function (type) {
4655
var newType = angular.copy(type);
4756

@@ -53,10 +62,6 @@
5362

5463
$scope.isNativeType = RAML.Inspector.Types.isNativeType;
5564

56-
$scope.isPattern = function (propertyName) {
57-
return propertyName.match(PATTERN_PATTERN);
58-
};
59-
6065
$scope.isSchema = RAML.Inspector.Types.isSchema;
6166

6267
$scope.isCollapsible = function isCollapsible(property) {

src/app/directives/properties.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div>
22
<div class="raml-console-resource-param" ng-repeat="property in listArray"
3-
ng-if="(showSecuritySchemaProperties || !property[0].isFromSecurityScheme) && !isPattern(property[0].displayName)"
3+
ng-if="isPropertyVisible(property)"
44
ng-init="vm.isCollapsed = !!collapsible">
55
<div ng-init="type = getType(property[0])">
66
<h4 class="raml-console-resource-param-heading" style="position: relative">

0 commit comments

Comments
 (0)