"use strict"; /** * Licensed Materials - Property of IBM * IBM Cognos Products: admin * Copyright IBM Corp. 2019 * US Government Users Restricted Rights - Use, duplication or disclosure * restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', 'bi/glass/app/ContentView', 'bi/admin/nls/StringResource', 'react-dom', 'react', 'mobx', 'ba-react-admin/ba-react-admin.min'], function (_, ContentView, StringResource, ReactDOM, React, mobx, AdminReact) { 'use strict'; //NOSONAR: meant to be strict var StorageDetailsTab = ContentView.extend({ init: function init(options) { StorageDetailsTab.inherited('init', this, arguments); _.extend(this, options); }, setFocus: function setFocus() {}, render: function render() { this.$el.addClass('reactStorageDetails'); ReactDOM.unmountComponentAtNode(this.$el[0]); this.storageDetailsView = React.createElement(AdminReact.StorageDetailsView, { 'glassContext': this.glassContext, 'slideout': this.slideout, 'StringResource': StringResource, 'objectInfo': this.objectInfo, 'parent': this }); ReactDOM.render(this.storageDetailsView, this.$el[0]); if (this.slideout.contentView) { this.slideout.contentView.canHide = this._canHide.bind(this); } return Promise.resolve(); }, _canHide: function _canHide() { var propertyUIControl = this.slideout.contentView.getPropertyUIControl(); return propertyUIControl.onClose().then(function () { return !propertyUIControl.hasValidationError(); }.bind(this)); }, onClose: function onClose() { StorageDetailsTab.inherited('onClose', this, arguments); if (this.$el[0]) { ReactDOM.unmountComponentAtNode(this.$el[0]); } } }); return StorageDetailsTab; });