Skip to content

Commit

Permalink
fix: cannot import or add table when project is not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Nov 18, 2024
1 parent da9b69d commit 64bb1f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions opal-ui/src/components/datasource/DatasourceTables.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
size="sm"
>
<q-list>
<q-item clickable v-close-popup @click="onShowAddTable">
<q-item v-if="projectsStore.isReady" clickable v-close-popup @click="onShowAddTable">
<q-item-section>
<q-item-label>{{ $t('add_table') }}</q-item-label>
</q-item-section>
</q-item>

<q-item clickable v-close-popup @click="onShowAddTables">
<q-item-section>
<q-item-label>{{ $t('add_tables') }}</q-item-label>
Expand Down Expand Up @@ -61,7 +60,7 @@
</q-list>
</q-btn-dropdown>
<q-btn-dropdown
v-if="projectsStore.perms.import?.canCreate()"
v-if="projectsStore.isReady && projectsStore.perms.import?.canCreate()"
color="secondary"
icon="input"
size="sm"
Expand Down
3 changes: 3 additions & 0 deletions opal-ui/src/stores/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const useProjectsStore = defineStore('projects', () => {
const subjects = ref([] as Subject[]);
const acls = ref([] as Acl[]);

const isReady = computed(() => summary.value?.datasourceStatus === ProjectDatasourceStatusDto.READY);

function reset() {
projects.value = [];
project.value = {} as ProjectDto;
Expand Down Expand Up @@ -396,6 +398,7 @@ export const useProjectsStore = defineStore('projects', () => {
perms,
subjects,
acls,
isReady,
initProjects,
initProject,
refreshProject,
Expand Down

0 comments on commit 64bb1f4

Please sign in to comment.