devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
44 lines (43 loc) • 2.53 kB
JavaScript
/**
* DevExpress HTML/JS Reporting (designer\wizard\pages\fullscreen\specifyMongoDBDataSourceSettingsPage.js)
* Version: 26.1.3
* Build date: Jun 16, 2026
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* License: https://www.devexpress.com/Support/EULAs/universal.xml
*/
import { SpecifyMongoDBDataSourceSettingsPage as AnalyticSpecifyMongoDBDataSourceSettingsPage, _registerSpecifyMongoDBDataSourceSettingsPage as _analyticRegisterSpecifyMongoDBDataSourceSettingsPage, _restoreMongoDBDataSourceFromState } from '@devexpress/analytics-core/analytics-wizard';
import { overrideFullscreenDataSourceWizardPageMetadata } from '../../internal/_utils';
import { _convertToStateDataSource } from '../chooseAvailableDataSourcePage';
import { FullscreenReportWizardPageId } from '../../pageId';
import { createDeferred } from '@devexpress/analytics-core/analytics-internal-native';
import { createNewObjectItem } from '../../../dataObjects/objectItemCreation';
export class SpecifyMongoDBDataSourceSettingsPage extends AnalyticSpecifyMongoDBDataSourceSettingsPage {
constructor(dataSourceWizardOptions) {
super(dataSourceWizardOptions);
this._createMongoDBDataSourceInfo = dataSourceWizardOptions.callbacks.createMongoDBDataSourceInfo;
}
initialize(state) {
this._dataSourceId = state.dataSourceId;
return super.initialize(state);
}
commit() {
const deferred = createDeferred();
super.commit().done((state) => {
const dataSource = _restoreMongoDBDataSourceFromState(state.mongoDBDataSourceWizard, this._requestWrapper, this._dataSourceId);
const infoPromise = this._createMongoDBDataSourceInfo(dataSource);
infoPromise.done((result) => {
result.data = createNewObjectItem(result.data);
deferred.resolve({
mongoDBDataSourceWizard: state.mongoDBDataSourceWizard,
newDataSource: _convertToStateDataSource(result)
});
});
infoPromise.fail((reason) => deferred.reject(reason));
});
return deferred.promise();
}
}
export function _registerSpecifyMongoDBDataSourceSettingsPage(factory, wizardOptions) {
_analyticRegisterSpecifyMongoDBDataSourceSettingsPage(factory, wizardOptions);
overrideFullscreenDataSourceWizardPageMetadata(factory, FullscreenReportWizardPageId.SpecifyMongoDBDataSourceSettingsPage, () => new SpecifyMongoDBDataSourceSettingsPage(wizardOptions));
}