diff options
Diffstat (limited to 'vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user')
6 files changed, 281 insertions, 0 deletions
diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user-test.js b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user-test.js new file mode 100644 index 00000000..20693c1b --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user-test.js @@ -0,0 +1,48 @@ +/* + + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +(function () { + 'use strict'; + + /** + * @ngdoc function + * @name app.test:userTest + * @description + * # userTest + * Test of the app + */ + + describe('user test', function () { + var controller = null, $scope = null; + + beforeEach(function () { + module('vnfmarket'); + }); + + beforeEach(inject(function ($controller, $rootScope) { + $scope = $rootScope.$new(); + controller = $controller('UserCtrl', { + $scope: $scope + }); + })); + + it('Should controller must be defined', function () { + expect(controller).toBeDefined(); + }); + + }); +})(); diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user.html b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user.html new file mode 100644 index 00000000..2fe411b5 --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/user.html @@ -0,0 +1,74 @@ +<!-- + Copyright 2016-2017 Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<div class="md-padding" flex layout-sm="column"> + <md-card> + <md-card-content> + <h2 class="md-title">Content from: user page</h2> + </md-card-content> + </md-card> + <md-card> + <md-card-content> + <div class="row-fluid"> + <div class="col-md-12"> + <!-- Nav tabs --> + <ul class="nav nav-tabs" role="tablist"> + <li role="presentation" class="active"><a href="#download-hist-tab" aria-controls="download-hist-tab" role="tab" data-toggle="tab">Downloaded Services</a></li> + <li role="presentation"><a href="#upload-hist-tab" aria-controls="upload-hist-tab" role="tab" data-toggle="tab">Uploaded History</a></li> + </ul> + <!-- Tab panes --> + <div class="tab-content"> + <div role="tabpanel" class="tab-pane active" id="download-hist-tab"> + <table class="table table-striped"> + <thead> + <th>Service Name</th> + <th>Last Updated</th> + <th>Vendor</th> + <th>Type</th> + </thead> + <tbody> + <tr ng-repeat="service in services"> + <td>{{service.name}}</td> + <td>{{service.date}}</td> + <td>{{service.vendor}}</td> + <td>{{service.type}}</td> + </tr> + </tbody> + </table> + </div> + <div role="tabpanel" class="tab-pane" id="upload-hist-tab"> + <table class="table table-striped"> + <thead> + <th>Service Name</th> + <th>Last Updated</th> + <th>Vendor</th> + <th>Type</th> + </thead> + <tbody> + <tr ng-repeat="service in services | limitTo: 6"> + <td>{{service.name}}</td> + <td>{{service.date}}</td> + <td>{{service.vendor}}</td> + <td>{{service.type}}</td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + </div> + </md-card-content> + </md-card> +</div> diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userCtrl.js b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userCtrl.js new file mode 100644 index 00000000..81de3904 --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userCtrl.js @@ -0,0 +1,47 @@ +/* + + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +(function() { + 'use strict'; + + /** + * @ngdoc function + * @name app.controller:userCtrl + * @description + * # userCtrl + * Controller of the app + */ + + angular + .module('user') + .controller('UserCtrl', User); + + User.$inject = []; + + /* + * recommend + * Using function declarations + * and bindable members up top. + */ + + function User() { + /*jshint validthis: true */ + var vm = this; + + } + +})(); diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userModule.js b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userModule.js new file mode 100644 index 00000000..290c1758 --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userModule.js @@ -0,0 +1,31 @@ +/* + + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +(function () { + 'use strict'; + + /** + * @ngdoc function + * @name app.module:userModule + * @description + * # userModule + * Module of the app + */ + + angular.module('user', []); + +})(); diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userRoute.js b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userRoute.js new file mode 100644 index 00000000..3986c106 --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userRoute.js @@ -0,0 +1,40 @@ +/* + + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +'use strict'; + +/** + * @ngdoc function + * @name app.route:userRoute + * @description + * # userRoute + * Route of the app + */ + +angular.module('user') + .config(['$stateProvider', function ($stateProvider) { + + $stateProvider + .state('home.user', { + url:'/user', + templateUrl: 'app/modules/user/user.html', + controller: 'UserCtrl', + controllerAs: 'vm' + }); + + + }]); diff --git a/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userService.js b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userService.js new file mode 100644 index 00000000..a3a8f76c --- /dev/null +++ b/vnfmarket-be/portal-marketplace/src/main/webapp/marketplace/modules/user/userService.js @@ -0,0 +1,41 @@ +/* + + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +(function() { + 'use strict'; + + /** + * @ngdoc function + * @name app.service:userService + * @description + * # userService + * Service of the app + */ + + angular + .module('user') + .factory('UserService', User); + // Inject your dependencies as .$inject = ['$http', 'someSevide']; + // function Name ($http, someSevide) {...} + + User.$inject = ['$http']; + + function User ($http) { + + } + +})(); |