Browse Source

chore(gui-v2): type correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3057/head
Pranav C 2 years ago
parent
commit
50645333fe
  1. 8
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue
  2. 6
      packages/nocodb-sdk/src/lib/Api.ts
  3. 7
      scripts/sdk/swagger.json

8
packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { FormType, GalleryType, GridType, KanbanType, ViewTypes } from 'nocodb-sdk'
import type { ViewType, ViewTypes } from 'nocodb-sdk'
import type { SortableEvent } from 'sortablejs'
import type { Menu as AntMenu } from 'ant-design-vue'
import { notification } from 'ant-design-vue'
@ -45,7 +45,7 @@ let isMarked = $ref<string | false>(false)
/** Watch currently active view, so we can mark it in the menu */
watch(activeView, (nextActiveView) => {
const _nextActiveView = nextActiveView as GridType | FormType | KanbanType
const _nextActiveView = nextActiveView as ViewType
if (_nextActiveView && _nextActiveView.id) {
selected.value = [_nextActiveView.id]
@ -140,7 +140,7 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi
}
/** Rename a view */
async function onRename(view: Record<string, any>) {
async function onRename(view: ViewType) {
const valid = validate(view.title)
if (valid !== true) {
@ -152,7 +152,7 @@ async function onRename(view: Record<string, any>) {
try {
// todo typing issues, order and id do not exist on all members of ViewTypes (Kanban, Gallery, Form, Grid)
await api.dbView.update(view.id, {
await api.dbView.update(view.id!, {
title: view.title,
order: view.order,
})

6
packages/nocodb-sdk/src/lib/Api.ts

@ -122,7 +122,7 @@ export interface TableType {
export interface ViewType {
id?: string;
title?: string;
title: string;
deleted?: boolean;
order?: number;
fk_model_id?: string;
@ -1518,7 +1518,7 @@ export class Api<
*/
reorder: (
tableId: string,
data: { order?: string },
data: { order?: number },
params: RequestParams = {}
) =>
this.request<void, any>({
@ -1632,7 +1632,7 @@ export class Api<
update: (
viewId: string,
data: {
order?: string;
order?: number;
title?: string;
show_system_fields?: boolean;
lock_type?: 'collaborative' | 'locked' | 'personal';

7
scripts/sdk/swagger.json

@ -1334,7 +1334,7 @@
"type": "object",
"properties": {
"order": {
"type": "string"
"type": "number"
}
}
}
@ -1506,7 +1506,7 @@
"type": "object",
"properties": {
"order": {
"type": "string"
"type": "number"
},
"title": {
"type": "string"
@ -6011,7 +6011,8 @@
"type": "string"
},
"title": {
"type": "string"
"type": "string",
"required": true
},
"deleted": {
"type": "boolean"

Loading…
Cancel
Save