Skip to content

Commit

Permalink
Allow hiding forms with hide="forms"
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 26, 2024
1 parent 24bfe61 commit 4e63b05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/AutoQueryGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<EnsureAccess :invalid-access="invalidAccess" />
</div>
<div v-else class="pt-1">
<div v-if="create && apis.Create">
<div v-if="show('forms') && create && apis.Create">
<EnsureAccessDialog v-if="invalidCreateAccess" :title="`Create ${modelTitle}`" :invalid-access="invalidCreateAccess" alert-class="text-yellow-700" @done="createDone" />
<slot v-else-if="slots.createform" name="createform" :type="apis.Create.request.name" :configure="configureField" :done="createDone" :save="createSave"></slot>
<AutoCreateForm ref="createForm" v-else :type="apis.Create.request.name" :configure="configureField" @done="createDone" @save="createSave">
Expand All @@ -18,7 +18,7 @@
</template>
</AutoCreateForm>
</div>
<div v-else-if="edit && apis.AnyUpdate">
<div v-else-if="show('forms') && edit && apis.AnyUpdate">
<EnsureAccessDialog v-if="invalidUpdateAccess" :title="`Update ${modelTitle}`" :invalid-access="invalidUpdateAccess" alert-class="text-yellow-700" @done="editDone" />
<slot v-else-if="slots.editform" name="editform" :model="edit" :type="apis.AnyUpdate.request.name" :deleteType="canDelete ? apis.Delete!.request.name : null"
:configure="configureField" :done="editDone" :save="editSave"></slot>
Expand All @@ -32,7 +32,7 @@
</template>
</AutoEditForm>
</div>
<div v-else-if="edit">
<div v-else-if="show('forms') && edit">
<slot v-if="slots.viewform" name="viewform" :model="edit" :apis="apis" :done="editDone"></slot>
<AutoViewForm v-else :model="edit" :apis="apis" :done="editDone" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
/* AutoQueryGrid */
export type GridAllowOptions = "filtering" | "queryString" | "queryFilters"
export type GridShowOptions = "toolbar" | "preferences" | "pagingNav" | "pagingInfo" | "downloadCsv" | "refresh" | "copyApiUrl"
| "resetPreferences" | "filtersView" | "newItem"
| "resetPreferences" | "filtersView" | "newItem" | "forms"
/* MarkdownInput */
export type MarkdownInputOptions = "bold" | "italics" | "link" | "image" | "blockquote" | "code" | "heading" | "orderedList"
| "unorderedList" | "strikethrough" | "undo" | "redo" | "help"
Expand Down

0 comments on commit 4e63b05

Please sign in to comment.