X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=utils%2Ftest%2Ftestapi%2F3rd_party%2Fstatic%2Ftestapi-ui%2Fapp.js;h=5f5b86159a1d624f513e29d39ee9943cb382a2c4;hb=7e1a08a284e01c43708f42505cef86f0f853356e;hp=91e53f49a5ac48cf52db50653486666869a601e2;hpb=c6c1308bb44b66809f1362e47e0b58465adb2662;p=releng.git diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/app.js b/utils/test/testapi/3rd_party/static/testapi-ui/app.js index 91e53f49a..5f5b86159 100644 --- a/utils/test/testapi/3rd_party/static/testapi-ui/app.js +++ b/utils/test/testapi/3rd_party/static/testapi-ui/app.js @@ -26,6 +26,22 @@ .module('testapiApp') .config(configureRoutes); + angular + .module('testapiApp') + .directive('dynamicModel', ['$compile', '$parse', function ($compile, $parse) { + return { + restrict: 'A', + terminal: true, + priority: 100000, + link: function (scope, elem) { + var name = $parse(elem.attr('dynamic-model'))(scope); + elem.removeAttr('dynamic-model'); + elem.attr('ng-model', name); + $compile(elem)(scope); + } + }; + }]); + configureRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; /** @@ -37,56 +53,56 @@ $stateProvider. state('home', { url: '/', - templateUrl: '/swagger/testapi-ui/components/home/home.html' + templateUrl: 'testapi-ui/components/home/home.html' }). state('about', { url: '/about', - templateUrl: '/swagger/testapi-ui/components/about/about.html' + templateUrl: 'testapi-ui/components/about/about.html' }). - state('guidelines', { - url: '/guidelines', - templateUrl: '/swagger/testapi-ui/components/guidelines/guidelines.html', - controller: 'GuidelinesController as ctrl' + state('pods', { + url: '/pods', + templateUrl: 'testapi-ui/components/pods/pods.html', + controller: 'PodsController as ctrl' }). state('communityResults', { url: '/community_results', - templateUrl: '/swagger/testapi-ui/components/results/results.html', + templateUrl: 'testapi-ui/components/results/results.html', controller: 'ResultsController as ctrl' }). state('userResults', { url: '/user_results', - templateUrl: '/swagger/testapi-ui/components/results/results.html', + templateUrl: 'testapi-ui/components/results/results.html', controller: 'ResultsController as ctrl' }). state('resultsDetail', { url: '/results/:testID', - templateUrl: '/swagger/testapi-ui/components/results-report' + + templateUrl: 'testapi-ui/components/results-report' + '/resultsReport.html', controller: 'ResultsReportController as ctrl' }). state('profile', { url: '/profile', - templateUrl: '/swagger/testapi-ui/components/profile/profile.html', + templateUrl: 'testapi-ui/components/profile/profile.html', controller: 'ProfileController as ctrl' }). state('authFailure', { url: '/auth_failure', - templateUrl: '/swagger/testapi-ui/components/home/home.html', + templateUrl: 'testapi-ui/components/home/home.html', controller: 'AuthFailureController as ctrl' }). state('logout', { url: '/logout', - templateUrl: '/swagger/testapi-ui/components/logout/logout.html', + templateUrl: 'testapi-ui/components/logout/logout.html', controller: 'LogoutController as ctrl' }). state('userVendors', { url: '/user_vendors', - templateUrl: '/swagger/testapi-ui/components/vendors/vendors.html', + templateUrl: '/testapi-ui/components/vendors/vendors.html', controller: 'VendorsController as ctrl' }). state('publicVendors', { url: '/public_vendors', - templateUrl: '/swagger/testapi-ui/components/vendors/vendors.html', + templateUrl: '/testapi-ui/components/vendors/vendors.html', controller: 'VendorsController as ctrl' }). state('vendor', { @@ -96,22 +112,22 @@ }). state('userProducts', { url: '/user_products', - templateUrl: '/swagger/testapi-ui/components/products/products.html', + templateUrl: '/testapi-ui/components/products/products.html', controller: 'ProductsController as ctrl' }). state('publicProducts', { url: '/public_products', - templateUrl: '/swagger/testapi-ui/components/products/products.html', + templateUrl: '/testapi-ui/components/products/products.html', controller: 'ProductsController as ctrl' }). state('cloud', { url: '/cloud/:id', - templateUrl: '/swagger/testapi-ui/components/products/cloud.html', + templateUrl: '/testapi-ui/components/products/cloud.html', controller: 'ProductController as ctrl' }). state('distro', { url: '/distro/:id', - templateUrl: '/swagger/testapi-ui/components/products/distro.html', + templateUrl: '/testapi-ui/components/products/distro.html', controller: 'ProductController as ctrl' }); } @@ -211,7 +227,7 @@ angular.bootstrap(document, ['testapiApp']); } - $http.get('swagger/testapi-ui/config.json').success(function (data) { + $http.get('testapi-ui/config.json').success(function (data) { startApp(data); }).error(function () { startApp({});