feat: button to open table settings tab, closes #608

This commit is contained in:
Fabio Di Stasio 2023-07-05 18:27:30 +02:00
parent 0044522390
commit 38bfea279c
3 changed files with 37 additions and 8 deletions

View File

@ -104,7 +104,7 @@
class="tab-link"
:class="{'badge': element.isChanged}"
>
<i class="mdi mdi-tune-vertical-variant mdi-18px mr-1" />
<i class="mdi mdi-wrench-cog mdi-18px mr-1" />
<span :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
{{ cutText(element.elementName, 20, true) }}
<span
@ -121,7 +121,7 @@
class="tab-link"
:class="{'badge': element.isChanged}"
>
<i class="mdi mdi-tune-vertical-variant mdi-18px mr-1" />
<i class="mdi mdi-wrench-cog mdi-18px mr-1" />
<span :title="`${t('word.settings').toUpperCase()}: ${t(`word.view`)}`">
{{ cutText(element.elementName, 20, true) }}
<span
@ -241,7 +241,7 @@
:class="{'badge': element.isChanged}"
@dblclick="openAsPermanentTab(element)"
>
<i class="mdi mdi-18px mdi-tune-vertical-variant mr-1" />
<i class="mdi mdi-18px mdi-wrench-cog mr-1" />
<span :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
<span class=" text-italic">{{ cutText(element.elementName, 20, true) }}</span>
<span
@ -258,7 +258,7 @@
class="tab-link"
:class="{'badge': element.isChanged}"
>
<i class="mdi mdi-18px mdi-tune-vertical-variant mr-1" />
<i class="mdi mdi-18px mdi-wrench-cog mr-1" />
<span :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
{{ cutText(element.elementName, 20, true) }}
<span

View File

@ -8,14 +8,14 @@
class="context-element"
@click="openTableSettingTab"
>
<span class="d-flex"><i class="mdi mdi-18px mdi-tune-vertical-variant text-light pr-1" /> {{ t('word.settings') }}</span>
<span class="d-flex"><i class="mdi mdi-18px mdi-wrench-cog text-light pr-1" /> {{ t('word.settings') }}</span>
</div>
<div
v-if="selectedTable && selectedTable.type === 'view' && customizations.viewSettings"
class="context-element"
@click="openViewSettingTab"
>
<span class="d-flex"><i class="mdi mdi-18px mdi-tune-vertical-variant text-light pr-1" /> {{ t('word.settings') }}</span>
<span class="d-flex"><i class="mdi mdi-18px mdi-wrench-cog text-light pr-1" /> {{ t('word.settings') }}</span>
</div>
<div
v-if="selectedTable && selectedTable.type === 'table' && customizations.tableDuplicate"

View File

@ -89,7 +89,7 @@
<span>{{ t('message.insertRow', 2) }}</span>
</button>
<div class="dropdown table-dropdown pr-2">
<div class="dropdown table-dropdown">
<button
:disabled="isQuering"
class="btn btn-dark btn-sm dropdown-toggle mr-0 pr-0"
@ -114,6 +114,19 @@
</li>
</ul>
</div>
<div class="divider-vert py-3" />
<button
v-if="isTable"
class="btn btn-dark btn-sm"
:disabled="isQuering"
:title="t('word.settings')"
@click="openTableSettingTab()"
>
<i class="mdi mdi-24px mdi-cog" />
<!-- <span>{{ t('word.settings') }}</span> -->
</button>
</div>
<div class="workspace-query-info">
<div
@ -203,6 +216,7 @@ import { ConnectionParams } from 'common/interfaces/antares';
import { TableFilterClausole } from 'common/interfaces/tableApis';
import { useFilters } from '@/composables/useFilters';
import { ipcRenderer } from 'electron';
import { table } from 'console';
const { localeString } = useFilters();
@ -231,7 +245,7 @@ const workspacesStore = useWorkspacesStore();
const { dataTabLimit: limit } = storeToRefs(settingsStore);
const { changeBreadcrumbs, getWorkspace } = workspacesStore;
const { changeBreadcrumbs, getWorkspace, newTab } = workspacesStore;
const pageSelect: Ref<HTMLInputElement> = ref(null);
const tabUid = ref('data');
@ -428,6 +442,21 @@ const hasApproximately = computed(() => {
results.value[0].rows.length < approximateCount.value;
});
const openTableSettingTab = () => {
newTab({
uid: workspace.value.uid,
elementName: props.table,
schema: props.schema,
type: 'table-props',
elementType: 'table'
});
changeBreadcrumbs({
schema: props.schema,
table: props.table
});
};
watch(() => props.schema, () => {
if (props.isSelected) {
page.value = 1;