diff options
Diffstat (limited to 'd2ice.att.io/app/main/activation/inviteMembers')
4 files changed, 322 insertions, 0 deletions
diff --git a/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.controller.js b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.controller.js new file mode 100755 index 00000000..72ff43c0 --- /dev/null +++ b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.controller.js @@ -0,0 +1,97 @@ +// +// ============LICENSE_START========================================== +// org.onap.vvp/portal +// =================================================================== +// Copyright © 2017 AT&T Intellectual Property. All rights reserved. +// =================================================================== +// +// Unless otherwise specified, all software contained herein is licensed +// under the Apache License, Version 2.0 (the “License”); +// you may not use this software 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. +// +// +// +// Unless otherwise specified, all documentation contained herein is licensed +// under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +// you may not use this documentation except in compliance with the License. +// You may obtain a copy of the License at +// +// https:creativecommons.org/licenses/by/4.0/ +// +// Unless required by applicable law or agreed to in writing, documentation +// 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. +// +// ============LICENSE_END============================================ +// +// ECOMP is a trademark and service mark of AT&T Intellectual Property. +(function () { + 'use strict'; + angular + .module('ice.activation.inviteMembers') + .controller('InviteMembersController', ["$state", "vfService", "$rootScope", "$log", InviteMembersController]); + + function InviteMembersController($state, vfService, $rootScope, $log) { + var vm = this; + vm.data = []; + + var init = function() { + $rootScope.headerTitle = "Invite Team Members"; + $rootScope.headerSubTitle = "You can invite as many team members to collaborate around your virtual" + + " function as you would like. Please do remember that anyone invited to collaborate with you around" + + " the virtual function will have equal access."; + vm.choices = [{ Email: '' }]; + }; + + vm.submitForm = function () { + var jsonInviteMembers=[]; + angular.forEach(vm.choices, function(value, key) { + vm.item=[]; + var jsonItem = new Object(); + jsonItem.email = value.email; + jsonInviteMembers.push(jsonItem); + }); + + $rootScope.ice.loader.show = true; + vfService.inviteMembers(JSON.stringify(jsonInviteMembers)) + .then(function (response) { + $rootScope.ice.loader.show = false; + if (response.status === 200) { + if (response.data.is_active) { + $state.go('app.dashboard.overview'); + } else { + $state.go('app.resend_activation'); + } + } + }) + .catch(function (error) { + $rootScope.ice.loader.show = false; + $log.error(error); + }); + }; + + vm.addNewChoice = function () { + var newItemNo = vm.choices.length + 1; + vm.choices.push({ 'id': newItemNo }); + }; + + vm.removeChoice = function () { + var lastItem = vm.choices.length - 1; + vm.choices.splice(lastItem); + }; + + init(); + } +})(); + diff --git a/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.html b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.html new file mode 100755 index 00000000..60fa01d5 --- /dev/null +++ b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.html @@ -0,0 +1,72 @@ +<!-- +============LICENSE_START========================================== +org.onap.vvp/portal +=================================================================== +Copyright © 2017 AT&T Intellectual Property. All rights reserved. +=================================================================== + +Unless otherwise specified, all software contained herein is licensed +under the Apache License, Version 2.0 (the “License”); +you may not use this software 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. + + + +Unless otherwise specified, all documentation contained herein is licensed +under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +you may not use this documentation except in compliance with the License. +You may obtain a copy of the License at + + https:creativecommons.org/licenses/by/4.0/ + +Unless required by applicable law or agreed to in writing, documentation +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. + +============LICENSE_END============================================ + +ECOMP is a trademark and service mark of AT&T Intellectual Property.--> +<ice-loader selector=".inviteMembers-form"></ice-loader> + +<div class="container"> + + <div class="row"> + + <div class="col-md-2"></div> + + <form name="inviteMembersForm" ng-submit="vm.submitForm()" novalidate class="inviteMembers-form col-md-8"> + <div> + <div style="clear:both;"></div> + <fieldset data-ng-repeat="choice in choices|limitTo:10"> + <div id="containera"> + <div style="width:400px;height:50px;line-height:20px;;float:left"> + <input type="email" name="email" class="form-control" ng-model="choice.Email" maxlength="50" ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/' class="form-control" required> + <div class="ice-form-error" data-ng-show="inviteMembersForm.email.$error"> + <span ng-show="inviteMembersForm.email.$error.required && !inviteMembersForm.email.$pristine">Email is a required field.</span> + <span ng-show="inviteMembersForm.email.$invalid && !inviteMembersForm.email.$pristine" class="help-block">Enter a valid email.</span> + </div> + </div> + </div> + <div style="width:200px;height:50px;line-height:20px; vertical-align:middle;padding-left:10px;float:left"> + <a ng-click='removeChoice()' ng-show="$last">Remove</a> + </div> + </fieldset> + </div> + + <a ng-if="choices.length < 10" class="add-button" ng-click='vm.addNewChoice()'>Invite another team member</a> + + <button type="submit" class="btn btn-primary" data-ng-disabled="!inviteMembersForm.$valid">Send invitations</button> + + </form> + </div> +</div> diff --git a/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.less b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.less new file mode 100755 index 00000000..9eb02dc3 --- /dev/null +++ b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.less @@ -0,0 +1,86 @@ +// +// ============LICENSE_START========================================== +// org.onap.vvp/portal +// =================================================================== +// Copyright © 2017 AT&T Intellectual Property. All rights reserved. +// =================================================================== +// +// Unless otherwise specified, all software contained herein is licensed +// under the Apache License, Version 2.0 (the “License”); +// you may not use this software 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. +// +// +// +// Unless otherwise specified, all documentation contained herein is licensed +// under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +// you may not use this documentation except in compliance with the License. +// You may obtain a copy of the License at +// +// https:creativecommons.org/licenses/by/4.0/ +// +// Unless required by applicable law or agreed to in writing, documentation +// 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. +// +// ============LICENSE_END============================================ +// +// ECOMP is a trademark and service mark of AT&T Intellectual Property. +.inviteMembers { + + .inviteMembers-title { + height: 130px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + h1 {.p_24; margin: 20px 0 10px 0;} + h2 {.p_16_m; margin: 0;} + } + + .add-button { + &:after { + .sprite; + .sprite.add; + display: block; + } + } + + .remove-button { + width:100px; + height:40px; + line-height:20px; + vertical-align:middle; + padding-left:10px; + float:left; + } + + .inviteMembers-form { + margin-top: 20px; + } + + .btn { + width: 100%; + } + + .btn-primary { + border: 1px solid #8799A3; + border-radius: 6px; + background: #1E79B0; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#1E79B0, #62ADD5); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#1E79B0, #62ADD5); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#1E79B0, #62ADD5); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#1E79B0, #62ADD5); /* Standard syntax (must be last) */ + } + +} diff --git a/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.module.js b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.module.js new file mode 100755 index 00000000..61d8f1f0 --- /dev/null +++ b/d2ice.att.io/app/main/activation/inviteMembers/inviteMembers.module.js @@ -0,0 +1,67 @@ +// +// ============LICENSE_START========================================== +// org.onap.vvp/portal +// =================================================================== +// Copyright © 2017 AT&T Intellectual Property. All rights reserved. +// =================================================================== +// +// Unless otherwise specified, all software contained herein is licensed +// under the Apache License, Version 2.0 (the “License”); +// you may not use this software 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. +// +// +// +// Unless otherwise specified, all documentation contained herein is licensed +// under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +// you may not use this documentation except in compliance with the License. +// You may obtain a copy of the License at +// +// https:creativecommons.org/licenses/by/4.0/ +// +// Unless required by applicable law or agreed to in writing, documentation +// 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. +// +// ============LICENSE_END============================================ +// +// ECOMP is a trademark and service mark of AT&T Intellectual Property. +(function () { + + 'use strict'; + + angular + .module('ice.activation.inviteMembers', []) + .config(config); + + function config($stateProvider) { + + $stateProvider + .state('app.inviteMembers', { + url : '/inviteMembers', + views : { + 'main@': { + templateUrl: 'core/layouts/full-page-with-header/full-page-with-header.html', + controller : 'MainController as vm' + }, + 'content@app.inviteMembers': { + templateUrl: 'main/activation/inviteMembers/inviteMembers.html', + controller : 'InviteMembers as vm' + } + }, + bodyClass: 'inviteMembers' + }); + + } + +})(); |