mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 00:45:58 +00:00
translation-datagrid,filter,macros,newObject
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import { isProApp } from '../utility/proTools';
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let icon;
|
||||
export let title;
|
||||
@@ -21,7 +22,7 @@
|
||||
data-testid={$$props['data-testid']}
|
||||
title={disabled
|
||||
? isProFeature && !isProApp()
|
||||
? 'This feature is available only in DbGate Premium'
|
||||
? _t('common.featurePremium', { defaultMessage: 'This feature is available only in DbGate Premium' })
|
||||
: disabledMessage
|
||||
: undefined}
|
||||
>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
import { registerMenu } from '../utility/contextMenu';
|
||||
import { getLocalStorage, setLocalStorage } from '../utility/storageCache';
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let config;
|
||||
export let setConfig;
|
||||
@@ -173,7 +174,7 @@
|
||||
<div class="left" slot="1">
|
||||
<WidgetColumnBar>
|
||||
<WidgetColumnBarItem
|
||||
title="Columns"
|
||||
title={_t('dataGrid.columns', { defaultMessage: 'Columns' })}
|
||||
name="columns"
|
||||
height="45%"
|
||||
skip={isFormView}
|
||||
@@ -183,7 +184,7 @@
|
||||
</WidgetColumnBarItem>
|
||||
|
||||
<WidgetColumnBarItem
|
||||
title="Filters"
|
||||
title={_t('dataGrid.filters', { defaultMessage: 'Filters' })}
|
||||
name="filters"
|
||||
height={showReferences && display?.hasReferences && !isFormView ? '15%' : '30%'}
|
||||
skip={!display?.filterable}
|
||||
@@ -201,7 +202,7 @@
|
||||
</WidgetColumnBarItem>
|
||||
|
||||
<WidgetColumnBarItem
|
||||
title="References"
|
||||
title={_t('dataGrid.references', { defaultMessage: 'References' })}
|
||||
name="references"
|
||||
height="30%"
|
||||
collapsed={isDetailView}
|
||||
@@ -212,7 +213,7 @@
|
||||
</WidgetColumnBarItem>
|
||||
|
||||
<WidgetColumnBarItem
|
||||
title="Macros"
|
||||
title={_t('dataGrid.macros', { defaultMessage: 'Macros' })}
|
||||
name="macros"
|
||||
skip={!showMacros}
|
||||
collapsed={!expandMacros}
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import TokenizedFilteredText from '../widgets/TokenizedFilteredText.svelte';
|
||||
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let managerSize;
|
||||
export let display: GridDisplay;
|
||||
export let onReferenceClick = ref => {};
|
||||
@@ -24,12 +26,12 @@
|
||||
</script>
|
||||
|
||||
<SearchBoxWrapper>
|
||||
<SearchInput placeholder="Search references" bind:value={filter} />
|
||||
<SearchInput placeholder={_t('dataGrid.searchReferences', { defaultMessage: 'Search references' })} bind:value={filter} />
|
||||
<CloseSearchButton bind:filter />
|
||||
</SearchBoxWrapper>
|
||||
<ManagerInnerContainer width={managerSize}>
|
||||
{#if foreignKeys.length > 0}
|
||||
<div class="bold nowrap ml-1">References tables ({foreignKeys.length})</div>
|
||||
<div class="bold nowrap ml-1">{_t('dataGrid.referencesTables', { defaultMessage: 'References tables' })} ({foreignKeys.length})</div>
|
||||
{#each foreignKeys.filter(fk => filterName(filter, fk.refTableName)) as fk}
|
||||
<div
|
||||
class="link"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import FormViewFilterColumn from './FormViewFilterColumn.svelte';
|
||||
import { stringFilterBehaviour } from 'dbgate-tools';
|
||||
import CheckboxField from '../forms/CheckboxField.svelte';
|
||||
import { _t } from '../translations';
|
||||
// import PrimaryKeyFilterEditor from './PrimaryKeyFilterEditor.svelte';
|
||||
|
||||
export let managerSize;
|
||||
@@ -63,7 +64,7 @@
|
||||
{#if hasMultiColumnFilter}
|
||||
<div class="m-1">
|
||||
<div class="space-between">
|
||||
<span>Multi column filter</span>
|
||||
<span>{_t('dataGrid.multiColumnFilter', { defaultMessage: 'Multi column filter' })}</span>
|
||||
{#if multiColumnFilter}
|
||||
<div class="flex items-center gap-2">
|
||||
<CheckboxField
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
import MacroHeader from './MacroHeader.svelte';
|
||||
import MacroInfoTab from './MacroInfoTab.svelte';
|
||||
import { _t } from '../translations';
|
||||
|
||||
const selectedMacro = getContext('selectedMacro') as any;
|
||||
|
||||
@@ -17,7 +18,7 @@
|
||||
<TabControl
|
||||
tabs={[
|
||||
{
|
||||
label: 'Macro detail',
|
||||
label: _t('datagrid.macros.detail', { defaultMessage: 'Macro detail' }),
|
||||
component: MacroInfoTab,
|
||||
props: {
|
||||
onExecute,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { getContext } from 'svelte';
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import ToolbarButton from '../buttons/ToolbarButton.svelte';
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let onExecute;
|
||||
|
||||
@@ -16,8 +17,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<ToolbarButton icon="icon run" on:click={onExecute}>Execute</ToolbarButton>
|
||||
<ToolbarButton icon="icon close" on:click={() => ($selectedMacro = null)}>Close</ToolbarButton>
|
||||
<ToolbarButton icon="icon run" on:click={onExecute}>{_t('common.execute', { defaultMessage: 'Execute' })}</ToolbarButton>
|
||||
<ToolbarButton icon="icon close" on:click={() => ($selectedMacro = null)}>{_t('common.close', { defaultMessage: 'Close' })}</ToolbarButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import WidgetTitle from '../widgets/WidgetTitle.svelte';
|
||||
import MacroParameters from './MacroParameters.svelte';
|
||||
import { _t } from '../translations';
|
||||
|
||||
const selectedMacro = getContext('selectedMacro') as any;
|
||||
|
||||
@@ -13,23 +14,23 @@
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="section">
|
||||
<WidgetTitle>Execute</WidgetTitle>
|
||||
<FormStyledButton value="Execute" on:click={onExecute} />
|
||||
<WidgetTitle>{_t('common.execute', { defaultMessage: 'Execute' })}</WidgetTitle>
|
||||
<FormStyledButton value={_t('common.execute', { defaultMessage: 'Execute' })} on:click={onExecute} />
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<WidgetTitle>Parameters</WidgetTitle>
|
||||
<WidgetTitle>{_t('common.parameters', { defaultMessage: 'Parameters' })}</WidgetTitle>
|
||||
{#if $selectedMacro?.args && $selectedMacro?.args?.length > 0}
|
||||
{#key $selectedMacro?.name}
|
||||
<MacroParameters args={$selectedMacro?.args||[]} namePrefix={`${$selectedMacro?.name}#`} />
|
||||
{/key}
|
||||
{:else}
|
||||
<div class="m-1">This macro has no parameters</div>
|
||||
<div class="m-1">{_t('datagrid.macros.noParameters', { defaultMessage: 'This macro has no parameters' })}</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<WidgetTitle>Description</WidgetTitle>
|
||||
<WidgetTitle>{_t('common.description', { defaultMessage: 'Description' })}</WidgetTitle>
|
||||
<div class="m-1">{$selectedMacro?.description}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import SearchBoxWrapper from '../elements/SearchBoxWrapper.svelte';
|
||||
import SearchInput from '../elements/SearchInput.svelte';
|
||||
import macros from './macros';
|
||||
import { _t } from '../translations';
|
||||
|
||||
let filter = '';
|
||||
export let managerSize;
|
||||
@@ -16,7 +17,7 @@
|
||||
|
||||
<ManagerInnerContainer width={managerSize}>
|
||||
<SearchBoxWrapper>
|
||||
<SearchInput placeholder="Search macros" bind:value={filter} />
|
||||
<SearchInput placeholder={_t('datagrid.searchMacros', { defaultMessage: "Search macros"})} bind:value={filter} />
|
||||
</SearchBoxWrapper>
|
||||
<AppObjectList
|
||||
list={_.sortBy(macros, 'title').filter(x => (macroCondition ? macroCondition(x) : true))}
|
||||
|
||||
@@ -1,37 +1,39 @@
|
||||
import { _t } from '../translations';
|
||||
|
||||
const macros = [
|
||||
{
|
||||
title: 'Remove diacritics',
|
||||
title: _t('datagrid.macros.removeDiacritics', { defaultMessage: 'Remove diacritics' }),
|
||||
name: 'removeDiacritics',
|
||||
group: 'Text',
|
||||
description: 'Removes diacritics from selected cells',
|
||||
description: _t('datagrid.macros.removeDiacriticsDescription', { defaultMessage: 'Removes diacritics from selected cells' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.deburr(value)`,
|
||||
},
|
||||
{
|
||||
title: 'Search & replace text',
|
||||
title: _t('datagrid.macros.searchReplaceText', { defaultMessage: 'Search & replace text' }),
|
||||
name: 'stringReplace',
|
||||
group: 'Text',
|
||||
description: 'Search & replace text or regular expression',
|
||||
description: _t('datagrid.macros.searchReplaceTextDescription', { defaultMessage: 'Search & replace text or regular expression' }),
|
||||
type: 'transformValue',
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Find',
|
||||
label: _t('datagrid.macros.searchReplaceTextFind', { defaultMessage: 'Find' }),
|
||||
name: 'find',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Replace with',
|
||||
label: _t('datagrid.macros.searchReplaceTextReplaceWith', { defaultMessage: 'Replace with' }),
|
||||
name: 'replace',
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
label: 'Case sensitive',
|
||||
label: _t('datagrid.macros.searchReplaceTextCaseSensitive', { defaultMessage: 'Case sensitive' }),
|
||||
name: 'caseSensitive',
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
label: 'Regular expression',
|
||||
label: _t('datagrid.macros.searchReplaceTextIsRegex', { defaultMessage: 'Regular expression' }),
|
||||
name: 'isRegex',
|
||||
},
|
||||
],
|
||||
@@ -42,16 +44,16 @@ return value ? value.toString().replace(new RegExp(rtext, rflags), args.replace
|
||||
`,
|
||||
},
|
||||
{
|
||||
title: 'Change text case',
|
||||
title: _t('datagrid.macros.changeTextCase', { defaultMessage: 'Change text case' }),
|
||||
name: 'changeTextCase',
|
||||
group: 'Text',
|
||||
description: 'Uppercase, lowercase and other case functions',
|
||||
description: _t('datagrid.macros.changeTextCaseDescription', { defaultMessage: 'Uppercase, lowercase and other case functions' }),
|
||||
type: 'transformValue',
|
||||
args: [
|
||||
{
|
||||
type: 'select',
|
||||
options: ['toUpper', 'toLower', 'lowerCase', 'upperCase', 'kebabCase', 'snakeCase', 'camelCase', 'startCase'],
|
||||
label: 'Type',
|
||||
label: _t('datagrid.macros.changeTextCaseType', { defaultMessage: 'Type' }),
|
||||
name: 'type',
|
||||
default: 'toUpper',
|
||||
},
|
||||
@@ -59,81 +61,81 @@ return value ? value.toString().replace(new RegExp(rtext, rflags), args.replace
|
||||
code: `return modules.lodash[args.type](value)`,
|
||||
},
|
||||
{
|
||||
title: 'Pad left',
|
||||
title: _t('datagrid.macros.padLeft', { defaultMessage: 'Pad left' }),
|
||||
name: 'padLeft',
|
||||
group: 'Text',
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Character',
|
||||
label: _t('datagrid.macros.padCharacter', { defaultMessage: 'Character' }),
|
||||
name: 'character',
|
||||
default: '0',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Length',
|
||||
label: _t('datagrid.macros.padLength', { defaultMessage: 'Length' }),
|
||||
name: 'length',
|
||||
default: '3',
|
||||
},
|
||||
],
|
||||
description:
|
||||
'Returns string of a specified length in which the beginning of the current string is padded with spaces or other character',
|
||||
_t('datagrid.macros.padLeftDescription', { defaultMessage: 'Returns string of a specified length in which the beginning of the current string is padded with spaces or other character' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.padStart(value, +args.length, args.character)`,
|
||||
},
|
||||
{
|
||||
title: 'Pad right',
|
||||
title: _t('datagrid.macros.padRight', { defaultMessage: 'Pad right' }),
|
||||
name: 'padRight',
|
||||
group: 'Text',
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Character',
|
||||
label: _t('datagrid.macros.padCharacter', { defaultMessage: 'Character' }),
|
||||
name: 'character',
|
||||
default: '0',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Length',
|
||||
label: _t('datagrid.macros.padLength', { defaultMessage: 'Length' }),
|
||||
name: 'length',
|
||||
default: '3',
|
||||
},
|
||||
],
|
||||
description:
|
||||
'Returns string of a specified length in which the end of the current string is padded with spaces or other character',
|
||||
_t('datagrid.macros.padRightDescription', { defaultMessage: 'Returns string of a specified length in which the end of the current string is padded with spaces or other character' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.padEnd(value, +args.length, args.character)`,
|
||||
},
|
||||
{
|
||||
title: 'Trim',
|
||||
title: _t('datagrid.macros.trim', { defaultMessage: 'Trim' }),
|
||||
name: 'trim',
|
||||
group: 'Text',
|
||||
description: 'Removes leading and trailing whitespace ',
|
||||
description: _t('datagrid.macros.trimDescription', { defaultMessage: 'Removes leading and trailing whitespace' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.trim(value)`,
|
||||
},
|
||||
{
|
||||
title: 'Row index',
|
||||
title: _t('datagrid.macros.rowIndex', { defaultMessage: 'Row index' }),
|
||||
name: 'rowIndex',
|
||||
group: 'Tools',
|
||||
description: 'Index of row from 1 (autoincrement)',
|
||||
description: _t('datagrid.macros.rowIndexDescription', { defaultMessage: 'Index of row from 1 (autoincrement)' }),
|
||||
type: 'transformValue',
|
||||
code: `return rowIndex + 1`,
|
||||
},
|
||||
{
|
||||
title: 'Generate UUID',
|
||||
title: _t('datagrid.macros.generateUUID', { defaultMessage: 'Generate UUID' }),
|
||||
name: 'uuidv1',
|
||||
group: 'Tools',
|
||||
description: 'Generate unique identifier',
|
||||
description: _t('datagrid.macros.generateUUIDDescription', { defaultMessage: 'Generate unique identifier' }),
|
||||
type: 'transformValue',
|
||||
args: [
|
||||
{
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: 'uuidv1', name: 'V1 - from timestamp' },
|
||||
{ value: 'uuidv4', name: 'V4 - random generated' },
|
||||
{ value: 'uuidv1', name: _t('datagrid.macros.uuidv1', { defaultMessage: 'V1 - from timestamp' }) },
|
||||
{ value: 'uuidv4', name: _t('datagrid.macros.uuidv4', { defaultMessage: 'V4 - random generated' }) },
|
||||
],
|
||||
label: 'Version',
|
||||
label: _t('datagrid.macros.version', { defaultMessage: 'Version' }),
|
||||
name: 'version',
|
||||
default: 'uuidv1',
|
||||
},
|
||||
@@ -141,26 +143,26 @@ return value ? value.toString().replace(new RegExp(rtext, rflags), args.replace
|
||||
code: `return modules[args.version]()`,
|
||||
},
|
||||
{
|
||||
title: 'Convert to integer',
|
||||
title: _t('datagrid.macros.toInt', { defaultMessage: 'Convert to integer' }),
|
||||
name: 'toInt',
|
||||
group: 'Tools',
|
||||
description: 'Converts to integral number',
|
||||
description: _t('datagrid.macros.toIntDescription', { defaultMessage: 'Converts to integral number' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.isNaN(parseInt(value)) ? null : parseInt(value)`,
|
||||
},
|
||||
{
|
||||
title: 'Convert to number',
|
||||
title: _t('datagrid.macros.toNumber', { defaultMessage: 'Convert to number' }),
|
||||
name: 'toNumber',
|
||||
group: 'Tools',
|
||||
description: 'Converts to number',
|
||||
description: _t('datagrid.macros.toNumberDescription', { defaultMessage: 'Converts to number' }),
|
||||
type: 'transformValue',
|
||||
code: `return modules.lodash.isNaN(parseFloat(value)) ? null : parseFloat(value)`,
|
||||
},
|
||||
{
|
||||
title: 'Convert to boolean',
|
||||
title: _t('datagrid.macros.toBoolean', { defaultMessage: 'Convert to boolean' }),
|
||||
name: 'toBoolean',
|
||||
group: 'Tools',
|
||||
description: 'Converts to boolean',
|
||||
description: _t('datagrid.macros.toBooleanDescription', { defaultMessage: 'Converts to boolean' }),
|
||||
type: 'transformValue',
|
||||
code: `
|
||||
if (modules.lodash.isString(value)) {
|
||||
@@ -176,10 +178,10 @@ return !!value;
|
||||
`,
|
||||
},
|
||||
{
|
||||
title: 'Convert to string',
|
||||
title: _t('datagrid.macros.toString', { defaultMessage: 'Convert to string' }),
|
||||
name: 'toString',
|
||||
group: 'Tools',
|
||||
description: 'Converts to string',
|
||||
description: _t('datagrid.macros.toStringDescription', { defaultMessage: 'Converts to string' }),
|
||||
type: 'transformValue',
|
||||
code: `
|
||||
if (value==null) return null;
|
||||
@@ -188,15 +190,15 @@ return !!value;
|
||||
`,
|
||||
},
|
||||
{
|
||||
title: 'Current date',
|
||||
title: _t('datagrid.macros.currentDate', { defaultMessage: 'Current date' }),
|
||||
name: 'currentDate',
|
||||
group: 'Tools',
|
||||
description: 'Gets current date',
|
||||
description: _t('datagrid.macros.currentDateDescription', { defaultMessage: 'Gets current date' }),
|
||||
type: 'transformValue',
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Format',
|
||||
label: _t('datagrid.macros.format', { defaultMessage: 'Format' }),
|
||||
name: 'format',
|
||||
default: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
@@ -204,10 +206,10 @@ return !!value;
|
||||
code: `return modules.moment().format(args.format)`,
|
||||
},
|
||||
{
|
||||
title: 'Duplicate columns',
|
||||
title: _t('datagrid.macros.duplicateColumns', { defaultMessage: 'Duplicate columns' }),
|
||||
name: 'duplicateColumns',
|
||||
group: 'Tools',
|
||||
description: 'Duplicate selected columns',
|
||||
description: _t('datagrid.macros.duplicateColumnsDescription', { defaultMessage: 'Duplicate selected columns' }),
|
||||
type: 'transformRow',
|
||||
code: `
|
||||
return {
|
||||
@@ -218,22 +220,22 @@ return !!value;
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Prefix',
|
||||
label: _t('datagrid.macros.prefix', { defaultMessage: 'Prefix' }),
|
||||
name: 'prefix',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Postfix',
|
||||
label: _t('datagrid.macros.postfix', { defaultMessage: 'Postfix' }),
|
||||
name: 'postfix',
|
||||
default: '_copy',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Split columns',
|
||||
title: _t('datagrid.macros.splitColumns', { defaultMessage: 'Split columns' }),
|
||||
name: 'splitColumns',
|
||||
group: 'Tools',
|
||||
description: 'Split selected columns',
|
||||
description: _t('datagrid.macros.splitColumnsDescription', { defaultMessage: 'Split selected columns' }),
|
||||
type: 'transformRow',
|
||||
code: `
|
||||
const res = {...row};
|
||||
@@ -252,22 +254,22 @@ return !!value;
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Delimiter',
|
||||
label: _t('datagrid.macros.delimiter', { defaultMessage: 'Delimiter' }),
|
||||
name: 'delimiter',
|
||||
default: ',',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Calculation',
|
||||
title: _t('datagrid.macros.calculation', { defaultMessage: 'Calculation' }),
|
||||
name: 'calculation',
|
||||
group: 'Tools',
|
||||
description: 'Custom expression. Use row.column_name for accessing column values, value for original value',
|
||||
description: _t('datagrid.macros.calculationDescription', { defaultMessage: 'Custom expression. Use row.column_name for accessing column values, value for original value' }),
|
||||
type: 'transformValue',
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Expression',
|
||||
label: _t('datagrid.macros.expression', { defaultMessage: 'Expression' }),
|
||||
name: 'expression',
|
||||
default: 'value',
|
||||
},
|
||||
@@ -275,10 +277,10 @@ return !!value;
|
||||
code: `return eval(args.expression);`,
|
||||
},
|
||||
{
|
||||
title: 'Extract date fields',
|
||||
title: _t('datagrid.macros.extractDateFields', { defaultMessage: 'Extract date fields' }),
|
||||
name: 'extractDateFields',
|
||||
group: 'Tools',
|
||||
description: 'Extract yaear, month, day and other date/time fields from selection and adds it as new columns',
|
||||
description: _t('datagrid.macros.extractDateFieldsDescription', { defaultMessage: 'Extract year, month, day and other date/time fields from selection and adds it as new columns' }),
|
||||
type: 'transformRow',
|
||||
code: `
|
||||
let mom = null;
|
||||
@@ -311,37 +313,37 @@ return !!value;
|
||||
args: [
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Year name',
|
||||
label: _t('datagrid.macros.yearName', { defaultMessage: 'Year name' }),
|
||||
name: 'year',
|
||||
default: 'year',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Month name',
|
||||
label: _t('datagrid.macros.monthName', { defaultMessage: 'Month name' }) ,
|
||||
name: 'month',
|
||||
default: 'month',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Day name',
|
||||
label: _t('datagrid.macros.dayName', { defaultMessage: 'Day name' }),
|
||||
name: 'day',
|
||||
default: 'day',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Hour name',
|
||||
label: _t('datagrid.macros.hourName', { defaultMessage: 'Hour name' }),
|
||||
name: 'hour',
|
||||
default: 'hour',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Minute name',
|
||||
label: _t('datagrid.macros.minuteName', { defaultMessage: 'Minute name' }),
|
||||
name: 'minute',
|
||||
default: 'minute',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Second name',
|
||||
label: _t('datagrid.macros.secondName', { defaultMessage: 'Second name' }),
|
||||
name: 'second',
|
||||
default: 'second',
|
||||
},
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { isProApp } from '../utility/proTools';
|
||||
import ModalBase from './ModalBase.svelte';
|
||||
import { closeCurrentModal } from './modalTools';
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let multiTabIndex = undefined;
|
||||
|
||||
@@ -14,8 +15,8 @@
|
||||
{
|
||||
icon: 'icon sql-file',
|
||||
colorClass: 'color-icon-blue',
|
||||
title: 'Query',
|
||||
description: 'SQL query editor',
|
||||
title: _t('common.query', { defaultMessage: 'Query' }),
|
||||
description: _t('common.queryEditor', { defaultMessage: 'SQL query editor' }),
|
||||
action: () => {
|
||||
newQuery({ multiTabIndex });
|
||||
},
|
||||
@@ -25,47 +26,47 @@
|
||||
{
|
||||
icon: 'icon connection',
|
||||
colorClass: 'color-icon-yellow',
|
||||
title: 'Connection',
|
||||
description: 'Database connection stored locally',
|
||||
title: _t('common.connection', { defaultMessage: 'Connection' }),
|
||||
description: _t('newObject.connectionLocal', { defaultMessage: 'Database connection stored locally' }),
|
||||
command: 'new.connection',
|
||||
changeWidget: 'database',
|
||||
testid: 'NewObjectModal_connection',
|
||||
disabledMessage: 'You are not allowed to create new connections',
|
||||
disabledMessage: _t('newObject.connectionLocalDisabled', { defaultMessage: 'You are not allowed to create new connections' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon cloud-connection',
|
||||
colorClass: 'color-icon-blue',
|
||||
title: 'Connection on Cloud',
|
||||
description: 'Database connection stored on DbGate Cloud',
|
||||
title: _t('common.connectionOnCloud', { defaultMessage: 'Connection on Cloud' }),
|
||||
description: _t('newObject.connectionOnCloudDescription', { defaultMessage: 'Database connection stored on DbGate Cloud' }),
|
||||
command: 'new.connectionOnCloud',
|
||||
changeWidget: 'cloud-private',
|
||||
testid: 'NewObjectModal_connectionOnCloud',
|
||||
disabledMessage: 'For creating connections on DbGate Cloud, you need to be logged in',
|
||||
disabledMessage: _t('newObject.connectionOnCloudDisabled', { defaultMessage: 'For creating connections on DbGate Cloud, you need to be logged in' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon query-design',
|
||||
colorClass: 'color-icon-red',
|
||||
title: 'Query Designer',
|
||||
description: 'Design SQL queries visually',
|
||||
title: _t('common.queryDesigner', { defaultMessage: 'Query Designer' }),
|
||||
description: _t('newObject.queryDesignerDescription', { defaultMessage: 'Design SQL queries visually' }),
|
||||
command: 'new.queryDesign',
|
||||
testid: 'NewObjectModal_queryDesign',
|
||||
disabledMessage: 'Query Designer is not available for current database',
|
||||
disabledMessage: _t('newObject.queryDesignerDisabled', { defaultMessage: 'Query Designer is not available for current database' }),
|
||||
isProFeature: true,
|
||||
},
|
||||
{
|
||||
icon: 'icon diagram',
|
||||
colorClass: 'color-icon-blue',
|
||||
title: 'ER Diagram',
|
||||
description: 'Visualize database structure',
|
||||
title: _t('common.erDiagram', { defaultMessage: 'ER Diagram' }),
|
||||
description: _t('newObject.erDiagramDescription', { defaultMessage: 'Visualize database structure' }),
|
||||
command: 'new.diagram',
|
||||
testid: 'NewObjectModal_diagram',
|
||||
disabledMessage: 'ER Diagram is not available for current database',
|
||||
disabledMessage: _t('newObject.erDiagramDisabled', { defaultMessage: 'ER Diagram is not available for current database' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon perspective',
|
||||
colorClass: 'color-icon-yellow',
|
||||
title: 'Perspective',
|
||||
description: 'Join complex data from multiple databases',
|
||||
title: _t('common.perspective', { defaultMessage: 'Perspective' }),
|
||||
description: _t('newObject.perspectiveDescription', { defaultMessage: 'Join complex data from multiple databases' }),
|
||||
command: 'new.perspective',
|
||||
testid: 'NewObjectModal_perspective',
|
||||
isProFeature: true,
|
||||
@@ -73,55 +74,55 @@
|
||||
{
|
||||
icon: 'icon table',
|
||||
colorClass: 'color-icon-blue',
|
||||
title: 'Table',
|
||||
description: 'Create table in the current database',
|
||||
title: _t('common.table', { defaultMessage: 'Table' }),
|
||||
description: _t('newObject.tableDescription', { defaultMessage: 'Create table in the current database' }),
|
||||
command: 'new.table',
|
||||
testid: 'NewObjectModal_table',
|
||||
disabledMessage: 'Table creation is not available for current database',
|
||||
disabledMessage: _t('newObject.tableDisabled', { defaultMessage: 'Table creation is not available for current database' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon sql-generator',
|
||||
colorClass: 'color-icon-green',
|
||||
title: 'SQL Generator',
|
||||
description: 'Generate SQL scripts for database objects',
|
||||
title: _t('common.sqlGenerator', { defaultMessage: 'SQL Generator' }),
|
||||
description: _t('newObject.sqlGeneratorDescription', { defaultMessage: 'Generate SQL scripts for database objects' }),
|
||||
command: 'sql.generator',
|
||||
testid: 'NewObjectModal_sqlGenerator',
|
||||
disabledMessage: 'SQL Generator is not available for current database',
|
||||
disabledMessage: _t('newObject.sqlGeneratorDisabled', { defaultMessage: 'SQL Generator is not available for current database' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon export',
|
||||
colorClass: 'color-icon-green',
|
||||
title: 'Export database',
|
||||
description: 'Export to file like CSV, JSON, Excel, or other DB',
|
||||
title: _t('common.exportDatabase', { defaultMessage: 'Export database' }),
|
||||
description: _t('newObject.exportDescription', { defaultMessage: 'Export to file like CSV, JSON, Excel, or other DB' }),
|
||||
command: 'database.export',
|
||||
testid: 'NewObjectModal_databaseExport',
|
||||
disabledMessage: 'Export is not available for current database',
|
||||
disabledMessage: _t('newObject.exportDisabled', { defaultMessage: 'Export is not available for current database' }),
|
||||
},
|
||||
{
|
||||
icon: 'icon compare',
|
||||
colorClass: 'color-icon-red',
|
||||
title: 'Compare database',
|
||||
description: 'Compare database schemas',
|
||||
title: _t('common.compare', { defaultMessage: 'Compare database' }),
|
||||
description: _t('newObject.compareDescription', { defaultMessage: 'Compare database schemas' }),
|
||||
command: 'database.compare',
|
||||
testid: 'NewObjectModal_databaseCompare',
|
||||
disabledMessage: 'Database comparison is not available for current database',
|
||||
disabledMessage: _t('newObject.compareDisabled', { defaultMessage: 'Database comparison is not available for current database' }),
|
||||
isProFeature: true,
|
||||
},
|
||||
{
|
||||
icon: 'icon ai',
|
||||
colorClass: 'color-icon-blue',
|
||||
title: 'Database Chat',
|
||||
description: 'Chat with your database using AI',
|
||||
title: _t('common.databaseChat', { defaultMessage: 'Database Chat' }),
|
||||
description: _t('newObject.databaseChatDescription', { defaultMessage: 'Chat with your database using AI' }),
|
||||
command: 'database.chat',
|
||||
isProFeature: true,
|
||||
disabledMessage: 'Database chat is not available for current database',
|
||||
disabledMessage: _t('newObject.databaseChatDisabled', { defaultMessage: 'Database chat is not available for current database' }),
|
||||
testid: 'NewObjectModal_databaseChat',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<ModalBase simplefix {...$$restProps}>
|
||||
<div class="create-header">Create new</div>
|
||||
<div class="create-header">{_t('common.createNew', { defaultMessage: 'Create new' })}</div>
|
||||
<div class="wrapper">
|
||||
{#each NEW_ITEMS as item}
|
||||
{@const enabled = item.command
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
disabled={isConnected}
|
||||
data-testid="ConnectionDriverFields_defaultDatabase"
|
||||
asyncMenu={createDatabasesMenu}
|
||||
placeholder="(not selected - optional)"
|
||||
placeholder={_t('common.notSelectedOptional', { defaultMessage : "(not selected - optional)"})}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -475,7 +475,7 @@
|
||||
|
||||
{#if driver?.showConnectionField('useSeparateSchemas', $values, showConnectionFieldArgs)}
|
||||
<FormCheckboxField
|
||||
label={_t('connection.useSeparateSchemas', { defaultMessage: `Use schemas separately (use this if you have many large schemas)` })}
|
||||
label={_t('connection.useSeparateSchemas', { defaultMessage: 'Use schemas separately (use this if you have many large schemas)' })}
|
||||
name="useSeparateSchemas"
|
||||
disabled={isConnected}
|
||||
data-testid="ConnectionDriverFields_useSeparateSchemas"
|
||||
|
||||
Reference in New Issue
Block a user