aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/modals/confirmation-modal
diff options
context:
space:
mode:
authorys9693 <ys9693@att.com>2020-01-19 13:50:02 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-01-22 12:33:31 +0000
commit16a9fce0e104a38371a9e5a567ec611ae3fc7f33 (patch)
tree03a2aff3060ddb5bc26a90115805a04becbaffc9 /catalog-ui/src/app/view-models/modals/confirmation-modal
parentaa83a2da4f911c3ac89318b8e9e8403b072942e1 (diff)
Catalog alignment
Issue-ID: SDC-2724 Signed-off-by: ys9693 <ys9693@att.com> Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe
Diffstat (limited to 'catalog-ui/src/app/view-models/modals/confirmation-modal')
-rw-r--r--catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts93
-rw-r--r--catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view.html45
-rw-r--r--catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal.less30
3 files changed, 0 insertions, 168 deletions
diff --git a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts b/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts
deleted file mode 100644
index 7998d10623..0000000000
--- a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-'use strict';
-import {ValidationUtils, ModalType} from "app/utils";
-
-export interface IConfirmationModalModel {
- title:string;
- message:string;
- showComment:boolean;
- type:ModalType;
-}
-
-interface IConfirmationModalViewModelScope {
- modalInstanceConfirmation:ng.ui.bootstrap.IModalServiceInstance;
- confirmationModalModel:IConfirmationModalModel;
- comment:any;
- commentValidationPattern:RegExp;
- editForm:ng.IFormController;
- okButtonColor:string;
- hideCancelButton:boolean;
- ok():any;
- cancel():void;
-}
-
-export class ConfirmationModalViewModel {
-
- static '$inject' = ['$scope', '$uibModalInstance', 'confirmationModalModel', 'CommentValidationPattern', 'ValidationUtils'];
-
- constructor(private $scope:IConfirmationModalViewModelScope,
- private $uibModalInstance:ng.ui.bootstrap.IModalServiceInstance,
- confirmationModalModel:IConfirmationModalModel,
- private CommentValidationPattern:RegExp,
- private ValidationUtils:ValidationUtils) {
-
- this.initScope(confirmationModalModel);
- }
-
- private initScope = (confirmationModalModel:IConfirmationModalModel):void => {
- let self = this;
- this.$scope.hideCancelButton = false;
- this.$scope.modalInstanceConfirmation = this.$uibModalInstance;
- this.$scope.confirmationModalModel = confirmationModalModel;
- this.$scope.comment = {"text": ''};
- this.$scope.commentValidationPattern = this.CommentValidationPattern;
-
- this.$scope.ok = ():any => {
- self.$uibModalInstance.close(this.ValidationUtils.stripAndSanitize(self.$scope.comment.text));
- };
-
- this.$scope.cancel = ():void => {
- console.info('Cancel pressed on: ' + this.$scope.confirmationModalModel.title);
- self.$uibModalInstance.dismiss();
- };
-
- // Set the OK button color according to modal type (standard, error, alert)
- let _okButtonColor = 'blue'; // Default
- switch (confirmationModalModel.type) {
- case ModalType.STANDARD:
- _okButtonColor = 'blue';
- break;
- case ModalType.ERROR:
- _okButtonColor = 'red';
- break;
- case ModalType.ALERT:
- this.$scope.hideCancelButton = true;
- _okButtonColor = 'grey';
- break;
- default:
- _okButtonColor = 'blue';
- break;
- }
- this.$scope.okButtonColor = _okButtonColor;
-
- }
-}
diff --git a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view.html b/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view.html
deleted file mode 100644
index cb9b159e51..0000000000
--- a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal-view.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
- ~
- ~ 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.
--->
-
-<ng1-modal modal="modalInstanceConfirmation" type="classic" class="w-sdc-modal-confirmation modal-type-{{confirmationModalModel.type}}" header="{{confirmationModalModel.title}}" show-close-button="true">
- <form novalidate class="w-sdc-form" name="editForm">
- <label class="i-sdc-form-label required w-sdc-modal-label" data-ng-bind-html="confirmationModalModel.message"></label>
-
- <div class="i-sdc-form-item">
- <textarea class="w-sdc-modal-body-comment"
- data-tests-id="checkindialog"
- autofocus="autofocus"
- data-ng-show="confirmationModalModel.showComment===true"
- data-ng-model="comment.text"
- placeholder="Comment..."
- maxlength="256"
- data-required
- name="comment1"
- data-ng-pattern="commentValidationPattern"
- data-ng-maxlength="256"></textarea>
-
- <div class="input-error" data-ng-show="editForm.comment1.$dirty && editForm.comment1.$invalid">
- <span ng-show="editForm.comment1.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
- <span ng-show="editForm.comment1.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Comment' }"></span>
- </div>
- </div>
- </form>
- <div class="w-sdc-modal-footer classic">
- <button class="tlv-btn {{okButtonColor}}" data-tests-id="OK" data-ng-click="ok()" data-ng-disabled="confirmationModalModel.showComment===true && (!comment.text || comment.text && comment.text.length===0)">OK</button>
- <button class="tlv-btn grey" data-ng-if="hideCancelButton===false" data-tests-id="Cancel" data-ng-click="cancel()" >Cancel</button>
- <!--<button class="tlv-btn blue add-property-add-another" data-ng-if="isNew" data-ng-click="saveAndAnother()" type="reset" data-ng-disabled="editForm.$invalid">Add Another</button>-->
- </div>
-</ng1-modal>
diff --git a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal.less b/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal.less
deleted file mode 100644
index 666c41d5ed..0000000000
--- a/catalog-ui/src/app/view-models/modals/confirmation-modal/confirmation-modal.less
+++ /dev/null
@@ -1,30 +0,0 @@
-.w-sdc-modal-confirmation {
- form.w-sdc-form{
- padding: 0;
- }
-
- .w-sdc-modal-body-content {
- .b_6;
- word-break: break-word;
-
- }
- .w-sdc-modal-body {
- height: auto;
- /* padding: 47px 60px 20px 60px; */
- border-bottom: none;
- }
- .w-sdc-modal-body-content {
- padding: 0;
- }
- .w-sdc-modal-body-comment {
- width: 430px;
- height: 127px;
- border: solid 1px @color_e;
- margin: 20px 0 0 0;
- padding: 15px;
- }
- .w-sdc-modal-label {
- .m_14_r;
- text-align: left;
- }
-}