"use strict"; /** * Licensed Materials - Property of IBM * IBM Cognos Products: admin * Copyright IBM Corp. 2017, 2018 * US Government Users Restricted Rights - Use, duplication or disclosure * restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', 'doT', 'bi/content_apps/PropertiesTab', 'bi/admin/nls/StringResource', 'bi/commons/ui/dialogs/ConfirmationDialog', 'bi/admin/datasource/services/ConnectionUtils', 'text!bi/admin/datasource/templates/TestResultTemplate.html', 'react-dom', 'react', 'mobx', 'ba-react-admin/ba-react-admin.min', 'bi/commons/utils/Utils', 'baglass/core-client/js/core-client/utils/BidiUtil', 'bi/commons/ui/content/dialog/SignOnDialog'], function (_, dot, PropertiesTab, StringResource, ConfirmationDialog, ConnectionUtils, TestResultTemplate, ReactDOM, React, mobx, AdminReact, Utils, BidiUtil, SignOnDialog) { 'use strict'; //NOSONAR: meant to be strict var PropertiesConnectionTab = PropertiesTab.extend({ init: function init(options) { PropertiesConnectionTab.inherited('init', this, arguments); _.extend(this, options); this.removedSignons = []; if (this.objectInfo.isNew) { this.hasChanged = true; } if (!this.objectInfo.connId) { this.objectInfo.connId = this.objectInfo.id; } this._setValidateInitialWhiteSpaceInput(); this.selectedSignonFromReact = null; this.myDSSignon = null; }, _setValidateInitialWhiteSpaceInput: function _setValidateInitialWhiteSpaceInput() { var elem = this.slideout.$el.find(".propertiesBannerLabel.v_defaultName"); elem.on("keyup", function () { if (elem.val() < 1) { elem.val(elem.val().trim()); } if (elem[0].value.length === 0) { elem.on("keydown", function (event) { if (event.which === 32) { event.preventDefault(); } }); } else { elem.off("keydown"); } }); this.slideout.$el.end(); }, _getContent: function _getContent() { return ConnectionUtils.getSignons(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo.dataSourceId, this.objectInfo.id); }, _getConnectionParamsItems: function _getConnectionParamsItems(items) { items.push({ 'name': 'connectionInfo', 'label': StringResource.get('connectionInformation'), 'value': this.objectInfo.permissions && this.objectInfo.permissions.indexOf("write") === -1 ? StringResource.get('viewConnectionInformation') : StringResource.get('editConnectionInformation'), 'type': 'SingleLineValue', 'ellipses': true, 'editCallback': this._openConnectionInformation.bind(this) }); items.push({ 'type': 'Separator' }); }, _resetConnectionInformationSlideout: function _resetConnectionInformationSlideout() { if (this.connectionEditorSlideout) { return this.connectionEditorSlideout.hide({ force: true }); } else { return Promise.resolve(); } }, _openConnectionInformation: function _openConnectionInformation() { if (this.connectionEditorSlideout) { //the slide out is already opened return; } this.hasChanged = this.objectInfo.permissions && this.objectInfo.permissions.indexOf("write") !== -1; this.connectionEditorSlideout = this.glassContext.appController.showSlideOut({ 'pinning': { 'isPinned': true, 'display': false }, 'parent': this.slideout, 'width': "550px", 'content': { 'showGobackButton': false, 'module': this.parseResult.metadata.module, 'parentView': this, 'objectInfo': this.objectInfo, 'parseInfo': this.parseResult, 'glassContext': this.glassContext } }); this.connectionEditorSlideout.onHide = function () { delete this.connectionEditorSlideout; }.bind(this); }, _openSignonPropertiesSlideout: function _openSignonPropertiesSlideout(signon, signonList) { this.signonListFromReact = mobx.toJS(signonList); this._resetConnectionInformationSlideout().then(function () { var selectedTab = "bi/admin/common/GeneralPropertiesTab"; if (signon.isNew) { selectedTab = "bi/admin/datasource/ui/PropertiesSignonTab"; } var slideout = this.glassContext.appController.showSlideOut({ 'parent': this.slideout, 'width': "450px", 'content': { 'module': 'bi/admin/common/PropertiesPageView', 'parentView': this, 'listPane': this, 'objectInfo': signon, 'glassContext': this._glassContext, 'selectedTabModule': selectedTab, 'tabChanged': function () { var signonUICon = slideout.contentView.getPropertyUIControl(); var modProperties = signonUICon.getModifiedProperties(); _.extend(signon, modProperties); if (modProperties.defaultName) { this._modifySignon(signon); } }.bind(this) }, 'onHide': function () { var signonUICon = slideout.contentView.getPropertyUIControl(); var modProperties = signonUICon.getModifiedProperties(); delete modProperties.credentialsEx; _.extend(signon, modProperties); this._modifySignon(signon); }.bind(this) }); slideout.$el.on("credentialChanged", this.updateSignon.bind(this, slideout)); }.bind(this)); }, _confirmUnsavedChanged: function _confirmUnsavedChanged() { var oDialog = this._newConfirmationDialog('confirmApplyChanges', StringResource.get('confirmChange'), StringResource.get('datasourceConfirmApply')); oDialog.confirm(this._saveConnection.bind(this)); }, _newConfirmationDialog: function _newConfirmationDialog(sType, sTitle, sMessage) { return new ConfirmationDialog(sType, sTitle, sMessage); }, onClose: function onClose() { if (this.hasChanged) { this.hasChanged = false; this._confirmUnsavedChanged(); } ReactDOM.unmountComponentAtNode(this.$el.find('#myReactElement')[0]); return this._oPropertyUIControl.onClose(); }, updateConnectionString: function updateConnectionString() { if (this.parseResult.metadata.code === 'EXTCATALOG') { delete this.parseResult.jdbcURL; } else if (this.parseResult.metadata.categoryId === 'jdbc' && (this.parseResult.jdbcURL === '' || _.isUndefined(this.parseResult.jdbcURL))) { this.parseResult.jdbcURL = this.parseResult.metadata.urlTemplate; } var connString = ConnectionUtils.buildConnection(this.parseResult, this.objectInfo); this.objectInfo.connectionString = ConnectionUtils.getUpdatedConnectionString(this.parseResult, connString); }, _modifySignon: function _modifySignon(localSignOn) { var tempSignonArray = []; var tempSignonObject = {}; var indexToChange; this.signonListFromReact.forEach(function (item, index) { if (item.id === localSignOn.id) { tempSignonObject = { label: localSignOn.defaultName, value: index, id: localSignOn.id }; indexToChange = index; } tempSignonArray.push(this.signonListFromReact[index]); }.bind(this)); if (_.isEmpty(tempSignonObject)) { tempSignonObject = { label: localSignOn.defaultName, value: tempSignonArray.length, id: localSignOn.id }; } if (indexToChange > -1) { tempSignonArray.splice(indexToChange, 1, tempSignonObject); } else { tempSignonArray.push(tempSignonObject); } this.myDSSignon.updateSignons(tempSignonArray); this.myDSSignon.updateSelectedSignon(tempSignonObject); }, updateSignon: function updateSignon(signonSlideout, evt, localSignOn) { var signonUICon = signonSlideout.contentView.getPropertyUIControl(); var modProperties = signonUICon.getModifiedProperties(); if (modProperties.credentialUserName !== localSignOn.newUser) { localSignOn.credentialsEx.username = localSignOn.newUser; } else if (modProperties.credentialUserName) { localSignOn.credentialsEx.username = modProperties.credentialUserName; delete modProperties.credentialUserName; } if (modProperties.credentialPassword !== localSignOn.newPassword) { localSignOn.credentialsEx.password = localSignOn.newPassword; } else if (modProperties.credentialPassword) { localSignOn.credentialsEx.password = modProperties.credentialPassword; delete modProperties.credentialPassword; } delete localSignOn.newUser; delete localSignOn.newPassword; _.extend(localSignOn, modProperties); this._modifySignon(localSignOn); localSignOn.credentialsEx.updatedSignon = 'updated'; localSignOn.updated = true; }, _getTestItems: function _getTestItems(items) { items.push({ 'type': 'Separator' }); items.push({ 'name': 'testGroup', 'type': 'SingleLineLinks', 'items': [{ 'align': 'left', 'items': [{ 'type': 'icon', 'svgIcon': 'common-run', 'clickCallback': this._executeTest.bind(this), 'iconTooltip': StringResource.get('test'), 'role': 'button', 'class': 'testButton' }] }, { 'align': 'right', 'items': [] }] }); items.push({ 'type': 'Separator' }); }, _getFooter: function _getFooter(items) { items.push({ 'type': 'Footer', 'items': [{ 'type': 'Button', 'label': StringResource.get('dataServerSave'), 'primary': true, 'onSelect': this._saveConnection.bind(this) }] }); }, _saveConnection_error: function _saveConnection_error(key) { return this.glassContext.appController.showToast(StringResource.get(key), { 'type': 'error', 'onHidden': function (event) { this.slideout.contentView.getPropertyUIControl().getProperty('defaultName').value = ''; this.setFocus(); }.bind(this) }); }, _saveConnection: function _saveConnection() { var modProperties = this.slideout.contentView.getPropertyUIControl().getModifiedProperties(); _.extend(this.objectInfo, modProperties); this.hasChanged = false; this.updateConnectionString(); this.slideout.connectionSignons = this.connectionSignons; this.slideout.removedSignons = this.removedSignons; delete this.objectInfo.searchPath; delete this.objectInfo.owner; delete this.objectInfo._meta; delete this.objectInfo.ancestors; delete this.objectInfo.version; if (this.objectInfo.defaultName === '') { return this._saveConnection_error('emptyConnectionName'); } if (this.objectInfo.isNew && _.isUndefined(modProperties.defaultName)) { return this._saveConnection_error('unmodifiedConnectionName'); } return this._save().then(function () { return ConnectionUtils.getSignons(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo.dataSourceId, this.objectInfo.id).then(function (signons) { this.connectionSignons = signons; this._updateDatasourceList(); }.bind(this)); }.bind(this)); }, _updateDatasourceList: function _updateDatasourceList() { $(this.slideout.$el).trigger('com.ibm.cognos.bi.admin.refreshDataServerList'); }, _save: function _save() { if (this.objectInfo.gatewayDestination && this.objectInfo.gatewayDestination[0]) { this.objectInfo.gatewayDestination = [{ type: 'gatewayDestination', searchPath: "storeID('" + this.objectInfo.gatewayDestination[0].id + "')" }]; } if (this.objectInfo.isNew) { return this._saveNewConnection(); } else { return this._saveExistingConnection(); } }, _saveNewConnection: function _saveNewConnection() { var savePromise; var isNewConnection = false; if (this.objectInfo.newConnection) { isNewConnection = true; delete this.objectInfo.newConnection; savePromise = ConnectionUtils.createNewConnection(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo, this.connectionSignons); } else { savePromise = ConnectionUtils.createNewDataSource(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo, this.connectionSignons); } savePromise.then(function () { var sText = StringResource.get('datasourceConnectionToastUpdateMsg', { 'name': this.objectInfo.defaultName }); this.glassContext.appController.showToast(sText, { type: 'success' }); this.slideout.contentView.selectedTabModule = "bi/admin/datasource/ui/PropertiesConnectionTab"; if (this.$el.find('#myReactElement')[0]) { ReactDOM.unmountComponentAtNode(this.$el.find('#myReactElement')[0]); } delete this.objectInfo.isNew; this.slideout.contentView.reload(); if (this.parseResult && this.parseResult.gwStringUpdated) { delete this.parseResult.gwStringUpdated; } }.bind(this)).catch(function (error) { if (isNewConnection) { this.objectInfo.newConnection = true; } this._errorResponseCheck(error); }.bind(this)); return savePromise; }, setFocus: function setFocus() { var bannerLabel = this.slideout.$el.find(".propertiesBannerLabel.v_defaultName"); if (bannerLabel.length > 0) { bannerLabel[0].focus(); } }, _saveExistingConnection: function _saveExistingConnection() { return ConnectionUtils.saveConnection(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo, this.connectionSignons, this.removedSignons).then(function () { var sText = StringResource.get('datasourceConnectionToastUpdateMsg', { 'name': this.objectInfo.defaultName }); this.glassContext.appController.showToast(sText, { type: 'success' }); this.slideout.contentView.selectedTabModule = "bi/admin/datasource/ui/PropertiesConnectionTab"; if (this.$el.find('#myReactElement')[0]) { ReactDOM.unmountComponentAtNode(this.$el.find('#myReactElement')[0]); } this.slideout.contentView.reload(); this.connectionSignons.forEach(function (signon) { delete signon.isNew; }); if (this.parseResult && this.parseResult.gwStringUpdated) { delete this.parseResult.gwStringUpdated; } if (this.parseResult && this.parseResult.apiToken) { delete this.parseResult.apiToken; } this.removedSignons = []; }.bind(this)).catch(this._errorResponseCheck.bind(this)); }, _errorResponseCheck: function _errorResponseCheck(error) { var errorCode; if (error.jqXHR && error.jqXHR.responseJSON) { if (error.jqXHR.responseJSON.errors && error.jqXHR.responseJSON.errors[0].errorCode) { errorCode = error.jqXHR.responseJSON.errors[0].errorCode; } else if (error.jqXHR.responseJSON.errorCode) { errorCode = error.jqXHR.responseJSON.errorCode; } else { errorCode = StringResource.get('internalErrorMsg'); } } else { errorCode = StringResource.get('internalErrorMsg'); } var toastMsg; if (errorCode.includes("cmDuplicateName")) { toastMsg = StringResource.get('duplicateDSExists'); } else { toastMsg = StringResource.get('dataServerError', { errorCode: errorCode }); } this.glassContext.appController.showToast(toastMsg, { 'type': 'error', 'onHidden': function (event) { this.setFocus(); }.bind(this) }); }, _renderProperties: function _renderProperties() { var items = []; this._getConnectionParamsItems(items); this._getTestItems(items); if (this.objectInfo.permissions && this.objectInfo.permissions.indexOf("write") !== -1) { this._getFooter(items); } return this.renderPropertyUIControl({ 'el': this.$el, 'glassContext': this.glassContext, 'items': items }).then(function () { $(this.$el.find('.separator')[0]).after($('
')); ReactDOM.unmountComponentAtNode(this.$el.find('#myReactElement')[0]); var dsSignon = React.createElement(AdminReact.DataServSignOn, { 'glassContext': this.glassContext, 'slideout': this.slideout, 'StringResource': StringResource, 'ConnectionUtils': ConnectionUtils, 'objectInfo': this.objectInfo, 'authMethod': this.parseResult.authMethod, 'connectionSignons': this.connectionSignons, 'removedSignons': this.removedSignons, 'textDir': BidiUtil.userPreferredTextDir, 'parent': this }); this.myDSSignon = ReactDOM.render(dsSignon, this.$el.find('#myReactElement')[0]); }.bind(this)); }, render: function render() { this._id = _.uniqueId('prop_'); this.$el.addClass("admin_datasource_slideout"); if (this.objectInfo.isNew) { if (!this.objectInfo.vendor.module) { this.objectInfo.vendor.module = ConnectionUtils._DEFAULTCONNECTIONSTRINGMODULE; } this.parseResult = { metadata: this.objectInfo.vendor, connStringTemplate: ConnectionUtils._connStringTemplateToken, authMethod: "anon" }; if (ConnectionUtils.isTMRConnection(this.objectInfo)) { this.parseResult.tm1Params = { tm1AdminHost: '', tm1Port: '', tm1ServerName: '', tm1UseSSL: false, tm1Language: '' }; } else if (ConnectionUtils.isOLAPConnection(this.objectInfo)) { this.parseResult.msasVersion = ''; this.parseResult.serverUrl = ''; this.parseResult.namedInstance = ''; } this.updateConnectionString(); } else { this.parseResult = ConnectionUtils.parseConnectionString(this.objectInfo); } return this._getContent().then(function (signons) { this.connectionSignons = signons; ConnectionUtils.resolveAuthMethod(this.parseResult, this.objectInfo, signons); //this code is important because this is a reload situation where the signon was saved //we need to update the selectedSignon to be passed to test/ //if this doesn't happen - the selected signon does not get updated on a save and we use invalid //creds for the test connection if (this.selectedSignonFromReact) { this.connectionSignons.forEach(function (item) { if (item.id === signon.id) { return this.selectedSignonFromReact = item; } }.bind(this)); } return this._renderProperties(); }.bind(this)).then(function () { this._completeTestButtonRender(); if (this.slideout && this.slideout.contentView) { $(this.slideout.contentView).on("tabChanged", this._resetConnectionInformationSlideout.bind(this)); } if (this.objectInfo.isNew) { this._openConnectionInformation(); } }.bind(this)); }, _completeTestButtonRender: function _completeTestButtonRender() { var $resultSec = $(this._getTestResultsSection()); var $testSec = $(this._getTestButtonsSection()); var $testButton = $($testSec.find(".testButton")); var $testLabel = $(''); $testButton.append($testLabel); $testSec.addClass("testResultSection"); $resultSec.append('
' + StringResource.get('notTested') + '
'); }, _openTestResultsSlideout: function _openTestResultsSlideout(results) { this._resetConnectionInformationSlideout().then(function () { this.glassContext.appController.showSlideOut({ 'parent': this.slideout, 'width': "450px", 'content': { 'showGobackButton': true, 'module': 'bi/admin/datasource/slideout/TestResultSlideout', 'parentView': this, 'objectInfo': this.objectInfo, 'results': results, 'glassContext': this.glassContext } }); }.bind(this)); }, _getTestGroup: function _getTestGroup() { var testSection = this.getPropertyUIControl().getProperty('testGroup'); if (!testSection) { this.logger.error("could not find test result section"); return; } return testSection.getPropertyNode(); }, _getTestButtonsSection: function _getTestButtonsSection() { var $testSection = $(this._getTestGroup()); return $testSection.find(".left"); }, _getTestResultsSection: function _getTestResultsSection() { var $testSection = $(this._getTestGroup()); return $testSection.find(".right"); }, _showTestExecuting: function _showTestExecuting($testSec) { var loadingAnimation = Utils.getLoadingAnimation(1); var $container = $('
' + StringResource.get('cancel') + '
'); $container.append(loadingAnimation); $testSec.append($container); $container.find(".testCancel").on("primaryaction", this._cancelTesting.bind(this)); }, _cancelTesting: function _cancelTesting() { if (this.testingPromise) { this.testingPromise.cancelled = true; } else { this.testingPromise = new Promise(function (resolve, reject) {}); this.testingPromise.cancelled = true; } this._showTestResult(this.testingPromise); }, _stopTestExecuting: function _stopTestExecuting($testSec) { $testSec.empty(); }, _createResultUI: function _createResultUI(message, icon, resultClass, $root, isCancel) { var htmlStr = dot.template(TestResultTemplate)({ message: message, icon: icon, resultClass: resultClass, isCancel: isCancel ? true : false, openResultLabel: StringResource.get('openResultPane') }); $root.append(htmlStr); }, _showTestResult: function _showTestResult(testingPromise, results) { var $testResultSec = this._getTestResultsSection(); if (testingPromise && testingPromise.objectInfo && testingPromise.objectInfo.connectionString === 'undefined') { this._createResultUI(StringResource.get('connection_empty'), 'common-error', 'testFailed', $testResultSec, true); return; } this._stopTestExecuting($testResultSec); if (testingPromise.cancelled) { this._createResultUI(StringResource.get('canceled'), '', 'canceled', $testResultSec, true); return; } else { var responsePromise = results.jqXHR; if (responsePromise.status === 200) { this._createResultUI(StringResource.get('success'), 'common-success', 'testSuccess', $testResultSec); } else { this._createResultUI(StringResource.get('testingFailed'), 'common-error', 'testFailed', $testResultSec); } var testResInfoEl = $testResultSec.find(".testResultInfoIcon"); $(testResInfoEl).on("primaryaction", this._openTestResultsSlideout.bind(this, responsePromise)); } }, _getNewSignOnDialog: function _getNewSignOnDialog(spec) { return new SignOnDialog(spec); }, _getSelectedSignonFromPrompt: function _getSelectedSignonFromPrompt() { return new Promise(function (resolve, reject) { var signonPrompt = this._getNewSignOnDialog({ 'dataSourceName': "", 'dataSourceConnectionName': "", 'glassContext': this.glassContext, 'displayErrMsg': true, 'canSaveCredentials': false, 'onSubmit': function (Object) { var creds = signonPrompt.view.getCredentialsInfo(); resolve({ credentialsEx: { username: creds.userID, password: creds.password, updatedSignon: 'testDialog' } }); }.bind(this), 'onCancel': function () { this._cancelTesting(); reject(); }.bind(this) }); signonPrompt.view.canSaveCredentials = false; signonPrompt.open(); }.bind(this)); }, _executeTest: function _executeTest() { var testResultSec = this._getTestResultsSection(); $(testResultSec).empty(); var jdbcString = ConnectionUtils.buildConnection(this.parseResult, this.objectInfo); this.objectInfo.connectionString = ConnectionUtils.getUpdatedConnectionString(this.parseResult, jdbcString); if (this.objectInfo.connectionString === 'undefined' || this.objectInfo.connectionString === '') { return this._showTestResult(this, this.testingPromise); } this._showTestExecuting($(testResultSec)); var selectedSignon; if (this.parseResult.authMethod === 'prompt') { selectedSignon = this._getSelectedSignonFromPrompt(); } else { var signOn; if (this.parseResult.authMethod === 'ucac') { signOn = { namespace: this.objectInfo.credentialNamespaces[0].searchPath }; } else { if (this.selectedSignonFromReact) { signOn = this.selectedSignonFromReact; } else { signOn = this.connectionSignons[0]; } } selectedSignon = Promise.resolve(signOn); } return selectedSignon.then(this._completeTesting.bind(this)); }, _completeTesting: function _completeTesting(selectedSignon) { this.testingPromise = ConnectionUtils.test(this.glassContext.getCoreSvc('.Ajax'), this.objectInfo.connectionString, selectedSignon, this.objectInfo.apiToken); this.testingPromise.then(this._showTestResult.bind(this, this.testingPromise)); this.testingPromise.fail(this._showTestResult.bind(this, this.testingPromise)); return this.testingPromise; }, //Calls from React addSignonFromReact: function addSignonFromReact(signonList) { //There is a chance that the connection name has been set so lets use that var connName = this.slideout.$el.find(".v_defaultName"); if (connName.length > 0) { this.objectInfo.defaultName = connName[0].value; } var newSignon = { id: _.uniqueId('signon_'), defaultName: this.objectInfo.defaultName, permissions: ["execute", "read", "setPolicy", "traverse", "write"], disabled: false, hidden: false, isNew: true, type: 'dataSourceSignon', credentialsEx: { password: "###PASSWORD###", username: StringResource.get('NewSigonUserName') } }; this.connectionSignons.push(newSignon); this.hasChanged = true; this._openSignonPropertiesSlideout(newSignon, signonList); }, editSignonFromReact: function editSignonFromReact(signonList, reactSignon) { var signon; this.connectionSignons.forEach(function (item) { if (item.id === reactSignon.id) { signon = item; } }.bind(this)); signon.isEdited = true; this._openSignonPropertiesSlideout(signon, signonList, reactSignon); }, setSelectedSignonFromReact: function setSelectedSignonFromReact(signon) { if (signon) { this.connectionSignons.forEach(function (item) { if (item.id === signon.id) { return this.selectedSignonFromReact = item; } }.bind(this)); } else { if (this.connectionSignons.length > 0) { this.selectedSignonFromReact = this.connectionSignons[0]; } else { this.selectedSignonFromReact = null; } } }, updateAuthFromReact: function updateAuthFromReact(signonOption) { this.hasChanged = this.objectInfo.permissions && this.objectInfo.permissions.indexOf("write") !== -1; this.parseResult.authMethod = signonOption; this.objectInfo.signonOption = signonOption; if (this.objectInfo.signonOption !== 'ucac') { this.objectInfo.credentialNamespaces = []; } }, updateUCACfromReact: function updateUCACfromReact(chosenNamespace) { this.objectInfo.credentialNamespaces = []; this.objectInfo.credentialNamespaces.push(chosenNamespace); }, moveSignonToDeletedFromReact: function moveSignonToDeletedFromReact(selSignon) { this.hasChanged = true; if (selSignon.id.substring(0, 7) !== 'signon_') { this.removedSignons.push(selSignon); } this.connectionSignons = _.reject(this.connectionSignons, function (item) { return item.id === selSignon.id; }); if (this.connectionSignons && this.connectionSignons.length === 0) { this.selectedSignonFromReact = null; } }, deleteSignonsFromReact: function deleteSignonsFromReact() { this.connectionSignons.forEach(function (signon) { if (signon.id.substring(0, 7) !== 'signon_') { this.removedSignons.push(signon); } }.bind(this)); this.connectionSignons = []; this.selectedSignonFromReact = null; } }); return PropertiesConnectionTab; });