Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.isOpen = true;
var modalRef = this.modalService.open(error_modal_content_component_1.ErrorModalContent);
modalRef.componentInstance.message = message;
return modalRef.result.then(function (result) {
_this.isOpen = false;
return Promise.resolve(result);
}).catch(function (result) {
_this.isOpen = false;
return Promise.reject(result);
});
}
return Promise.reject('Modal already open.');
};
ErrorNotificationModalService = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [ng_bootstrap_1.NgbModal, logging_service_1.LoggingService])
], ErrorNotificationModalService);
return ErrorNotificationModalService;
}());
exports.ErrorNotificationModalService = ErrorNotificationModalService;
ConfirmationModal.prototype.open = function (message, withCancel) {
if (withCancel === void 0) { withCancel = true; }
var modalRef = this.modalService.open(confirmation_modal_content_component_1.ConfirmationModalContent);
modalRef.componentInstance.message = message;
modalRef.componentInstance.withCancel = withCancel;
return modalRef.result;
};
ConfirmationModal.prototype.confirmSave = function (message) {
if (this.dataService.hasCommits) {
return this.open(message || config_1.Config.CONFIRM_SAVE_MESSAGE);
}
return Promise.resolve();
};
ConfirmationModal = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [ng_bootstrap_1.NgbModal, specmate_data_service_1.SpecmateDataService])
], ConfirmationModal);
return ConfirmationModal;
}());
exports.ConfirmationModal = ConfirmationModal;
ConfirmationModal.prototype.open = function (message, withCancel) {
if (withCancel === void 0) { withCancel = true; }
var modalRef = this.modalService.open(confirmation_modal_content_component_1.ConfirmationModalContent);
modalRef.componentInstance.message = message;
modalRef.componentInstance.withCancel = withCancel;
return modalRef.result;
};
ConfirmationModal.prototype.confirmSave = function (message) {
if (this.dataService.hasCommits) {
return this.open(message || config_1.Config.CONFIRM_SAVE_MESSAGE);
}
return Promise.resolve();
};
ConfirmationModal = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [ng_bootstrap_1.NgbModal, specmate_data_service_1.SpecmateDataService])
], ConfirmationModal);
return ConfirmationModal;
}());
exports.ConfirmationModal = ConfirmationModal;
this.isOpen = true;
var modalRef = this.modalService.open(error_modal_content_component_1.ErrorModalContent);
modalRef.componentInstance.message = message;
return modalRef.result.then(function (result) {
_this.isOpen = false;
return Promise.resolve(result);
}).catch(function (result) {
_this.isOpen = false;
return Promise.reject(result);
});
}
return Promise.reject('Modal already open.');
};
ErrorNotificationModalService = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [ng_bootstrap_1.NgbModal, logging_service_1.LoggingService])
], ErrorNotificationModalService);
return ErrorNotificationModalService;
}());
exports.ErrorNotificationModalService = ErrorNotificationModalService;