Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #464 from mulesoft/qa
Browse files Browse the repository at this point in the history
Render console if there are only warnings
  • Loading branch information
agustinlg authored Nov 24, 2016
2 parents da6efaf + fd23904 commit 6a284ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## API Designer online

There is an online preview version of the API Designer, open the last stable version [here](http://mulesoft.github.io/api-designer/dists/master/latest/) or check out a [different branch](http://mulesoft.github.io/api-designer/).
There is an online preview version of the API Designer, check it out a [different branch](http://mulesoft.github.io/api-designer/).

## Running Locally

Expand Down
26 changes: 21 additions & 5 deletions dist/scripts/api-designer-vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82376,10 +82376,18 @@ exports.javascript = require('./javascript');
} else {
return ramlParser.loadPath($window.resolveUrl(url), null, $scope.options)
.then(function (api) {
if (api.errors.length <= 0) {
var success = true;
var issues = api.errors; // errors and warnings
if (issues && issues.length > 0) {
success = issues.filter(function (issue) {
return !issue.isWarning;
}).length === 0;
}

if (success) {
$scope.vm.raml = api.specification;
} else {
$scope.vm.error = { message: 'Api contains errors.', errors : api.errors};
$scope.vm.error = { message: 'Api contains errors.', errors : issues};
}
})
.finally(function () {
Expand Down Expand Up @@ -82875,11 +82883,19 @@ exports.javascript = require('./javascript');

return promise
.then(function (api) {
if (api.errors.length <= 0) {
var success = true;
var issues = api.errors; // errors and warnings
if (issues && issues.length > 0) {
success = issues.filter(function (issue) {
return !issue.isWarning;
}).length === 0;
}

if (success) {
$scope.vm.raml = api.specification;
} else {
$scope.vm.error = { message: 'Api contains errors.'};
$scope.vm.codeMirror.lint = lintFromError(api.errors);
$scope.vm.codeMirror.lint = lintFromError(issues);
}
})
.finally(function () {
Expand Down Expand Up @@ -88310,7 +88326,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
" <span>{{ vm.error.message }}</span>\n" +
" </div>\n" +
" <div class=\"raml-console-error-pre\" ng-repeat=\"err in vm.error.errors\">\n" +
" {{err.message}}\n" +
" [{{err.isWarning && 'warning' || 'error'}}] {{err.message}}\n" +
" </div>\n" +
" </div>\n" +
" </section>\n" +
Expand Down
Loading

0 comments on commit 6a284ef

Please sign in to comment.