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="tab-link"
:class="{'badge': element.isChanged}" :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}`)}`"> <span :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
{{ cutText(element.elementName, 20, true) }} {{ cutText(element.elementName, 20, true) }}
<span <span
@ -121,7 +121,7 @@
class="tab-link" class="tab-link"
:class="{'badge': element.isChanged}" :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`)}`"> <span :title="`${t('word.settings').toUpperCase()}: ${t(`word.view`)}`">
{{ cutText(element.elementName, 20, true) }} {{ cutText(element.elementName, 20, true) }}
<span <span
@ -241,7 +241,7 @@
:class="{'badge': element.isChanged}" :class="{'badge': element.isChanged}"
@dblclick="openAsPermanentTab(element)" @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 :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
<span class=" text-italic">{{ cutText(element.elementName, 20, true) }}</span> <span class=" text-italic">{{ cutText(element.elementName, 20, true) }}</span>
<span <span
@ -258,7 +258,7 @@
class="tab-link" class="tab-link"
:class="{'badge': element.isChanged}" :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}`)}`"> <span :title="`${t('word.settings').toUpperCase()}: ${t(`word.${element.elementType}`)}`">
{{ cutText(element.elementName, 20, true) }} {{ cutText(element.elementName, 20, true) }}
<span <span

View File

@ -8,14 +8,14 @@
class="context-element" class="context-element"
@click="openTableSettingTab" @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>
<div <div
v-if="selectedTable && selectedTable.type === 'view' && customizations.viewSettings" v-if="selectedTable && selectedTable.type === 'view' && customizations.viewSettings"
class="context-element" class="context-element"
@click="openViewSettingTab" @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>
<div <div
v-if="selectedTable && selectedTable.type === 'table' && customizations.tableDuplicate" v-if="selectedTable && selectedTable.type === 'table' && customizations.tableDuplicate"

View File

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