Skip to content

Commit

Permalink
feat: button to open table settings tab, closes #608
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Jul 5, 2023
1 parent 0044522 commit 38bfea2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/renderer/components/Workspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/WorkspaceExploreBarTableContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
33 changes: 31 additions & 2 deletions src/renderer/components/WorkspaceTabTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 38bfea2

Please sign in to comment.