123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2018, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['react', 'react-dom', 'ba-react-admin/ba-react-admin.min', 'underscore', 'bi/glass/app/ContentView', 'bi/admin/nls/StringResource'], function (React, ReactDOM, AdminReact, _, ContentView, StringResource) {
- 'use strict'; //NOSONAR: meant to be strict
- var ContactPreferencesTab = ContentView.extend({
- init: function init(options) {
- ContactPreferencesTab.inherited('init', this, arguments);
- _.extend(this, options);
- },
- render: function render() {
- AdminReact.ContactStore.update(this.objectInfo);
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- var pane = React.createElement(AdminReact.ContactPreferencesPanel, {
- glassContext: this.glassContext,
- StringResource: StringResource,
- parent: this,
- title: this.title
- });
- ReactDOM.render(pane, this.$el[0]);
- return Promise.resolve();
- },
- onClose: function onClose() {
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- var dirty = AdminReact.ContactStore.isDirty({
- format: this.objectInfo.format,
- locale: this.objectInfo.locale,
- timeZoneID: this.objectInfo.timeZoneID
- });
- if (dirty) {
- this.objectInfo.contactUpdate = {
- format: AdminReact.ContactStore.reportFormatId,
- locale: AdminReact.ContactStore.modifiedContentLocale,
- timeZoneID: AdminReact.ContactStore.modifiedTimeZone
- };
- }
- AdminReact.ContactStore.clear();
- }
- });
- return ContactPreferencesTab;
- });
|