mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-2511 feat(plugin-data-export): Disable export form for binary processors
This commit is contained in:
+1
-1
@@ -24,4 +24,4 @@ export class DefaultExportOutputSettingsResource
|
||||
async loader() {
|
||||
return (await this.graphQLService.sdk.getDataTransferDefaultParameters()).settings;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled, { css, use } from 'reshadow';
|
||||
import styled, { css } from 'reshadow';
|
||||
|
||||
import { Combobox, FieldCheckbox, InputField, Loader, useDataResource } from '@cloudbeaver/core-blocks';
|
||||
import { Combobox, FieldCheckbox, Loader, useDataResource } from '@cloudbeaver/core-blocks';
|
||||
import type { DataTransferOutputSettings } from '@cloudbeaver/core-sdk';
|
||||
|
||||
import { DefaultExportOutputSettingsResource } from './DefaultExportOutputSettingsResource';
|
||||
@@ -18,10 +18,10 @@ const styles = css`
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
row {
|
||||
root {
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
FieldCheckbox {
|
||||
@@ -47,33 +47,24 @@ export const OutputOptionsForm = observer(function OutputOptionsForm(props: Prop
|
||||
}
|
||||
|
||||
return styled(styles)(
|
||||
<>
|
||||
<row>
|
||||
<Combobox
|
||||
name="encoding"
|
||||
state={props.outputSettings}
|
||||
items={data.supportedEncodings}
|
||||
searchable
|
||||
>
|
||||
Encoding
|
||||
</Combobox>
|
||||
<FieldCheckbox
|
||||
name="insertBom"
|
||||
state={props.outputSettings}
|
||||
>
|
||||
Insert BOM
|
||||
</FieldCheckbox>
|
||||
</row>
|
||||
<InputField
|
||||
name="timestampPattern"
|
||||
<root>
|
||||
<Combobox
|
||||
name="encoding"
|
||||
state={props.outputSettings}
|
||||
small
|
||||
items={data.supportedEncodings}
|
||||
searchable
|
||||
>
|
||||
Filename timestamp pattern
|
||||
</InputField>
|
||||
</>
|
||||
Encoding
|
||||
</Combobox>
|
||||
<FieldCheckbox
|
||||
name="insertBom"
|
||||
state={props.outputSettings}
|
||||
>
|
||||
Insert BOM
|
||||
</FieldCheckbox>
|
||||
</root>
|
||||
);
|
||||
}}
|
||||
</Loader>
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useState } from 'react';
|
||||
import styled, { css } from 'reshadow';
|
||||
|
||||
import { IProperty, PropertiesTable, ErrorMessage, ObjectPropertyInfoForm } from '@cloudbeaver/core-blocks';
|
||||
import { IProperty, PropertiesTable, ErrorMessage } from '@cloudbeaver/core-blocks';
|
||||
import { CommonDialogWrapper } from '@cloudbeaver/core-dialogs';
|
||||
import { useTranslate } from '@cloudbeaver/core-localization';
|
||||
import type { DataTransferOutputSettings, DataTransferProcessorInfo, GQLErrorCatcher, ObjectPropertyInfo } from '@cloudbeaver/core-sdk';
|
||||
import type { DataTransferOutputSettings, DataTransferProcessorInfo, GQLErrorCatcher } from '@cloudbeaver/core-sdk';
|
||||
import { useStyles } from '@cloudbeaver/core-theming';
|
||||
import { ITabData, Tab, TabList, TabsState, UNDERLINE_TAB_STYLES } from '@cloudbeaver/core-ui';
|
||||
|
||||
@@ -43,10 +42,6 @@ const styles = css`
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
content {
|
||||
margin: 24px;
|
||||
}
|
||||
|
||||
ObjectPropertyInfoForm {
|
||||
margin: 12px 0;
|
||||
}
|
||||
@@ -109,7 +104,7 @@ export const ProcessorConfigureDialog = observer<Props>(function ProcessorConfig
|
||||
footer={(
|
||||
<ProcessorConfigureDialogFooter
|
||||
isExporting={isExporting}
|
||||
isFinalStep={currentTabId === SETTINGS_TABS.OUTPUT}
|
||||
isFinalStep={currentTabId === SETTINGS_TABS.OUTPUT || !!processor.isBinary}
|
||||
onExport={onExport}
|
||||
onBack={handleBackClick}
|
||||
onCancel={onClose}
|
||||
@@ -121,29 +116,25 @@ export const ProcessorConfigureDialog = observer<Props>(function ProcessorConfig
|
||||
noBodyPadding
|
||||
onReject={onClose}
|
||||
>
|
||||
<TabsState currentTabId={currentTabId} onChange={handleTabChange}>
|
||||
<TabList>
|
||||
<Tab tabId={SETTINGS_TABS.EXTRACTION} style={UNDERLINE_TAB_STYLES}>
|
||||
{translate('data_transfer_format_settings')}
|
||||
</Tab>
|
||||
<Tab tabId={SETTINGS_TABS.OUTPUT} style={UNDERLINE_TAB_STYLES}>
|
||||
{translate('data_transfer_output_settings')}
|
||||
</Tab>
|
||||
</TabList>
|
||||
</TabsState>
|
||||
{!processor.isBinary ? (
|
||||
<TabsState currentTabId={currentTabId} onChange={handleTabChange}>
|
||||
<TabList>
|
||||
<Tab tabId={SETTINGS_TABS.EXTRACTION} style={UNDERLINE_TAB_STYLES}>
|
||||
{translate('data_transfer_format_settings')}
|
||||
</Tab>
|
||||
<Tab tabId={SETTINGS_TABS.OUTPUT} style={UNDERLINE_TAB_STYLES}>
|
||||
{translate('data_transfer_output_settings')}
|
||||
</Tab>
|
||||
</TabList>
|
||||
</TabsState>
|
||||
) : null}
|
||||
{currentTabId === SETTINGS_TABS.EXTRACTION ? (
|
||||
<PropertiesTable
|
||||
properties={properties}
|
||||
propertiesState={processorProperties}
|
||||
/>
|
||||
) : (
|
||||
<content>
|
||||
<OutputOptionsForm outputSettings={outputSettings} />
|
||||
{/* <ObjectPropertyInfoForm
|
||||
properties={outputProperties}
|
||||
state={processorOutputProperties}
|
||||
/> */}
|
||||
</content>
|
||||
<OutputOptionsForm outputSettings={outputSettings} />
|
||||
)}
|
||||
|
||||
{error.responseMessage && (
|
||||
@@ -155,5 +146,4 @@ export const ProcessorConfigureDialog = observer<Props>(function ProcessorConfig
|
||||
)}
|
||||
</CommonDialogWrapper>
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user