Browse Source

feat(nocodb): add KanbanViewColumn

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
e5c12a2a9d
  1. 29
      packages/nocodb/src/lib/models/View.ts

29
packages/nocodb/src/lib/models/View.ts

@ -36,7 +36,9 @@ export default class View implements ViewType {
fk_model_id: string; fk_model_id: string;
model?: Model; model?: Model;
view?: FormView | GridView | KanbanView | GalleryView; view?: FormView | GridView | KanbanView | GalleryView;
columns?: Array<FormViewColumn | GridViewColumn | GalleryViewColumn>; columns?: Array<
FormViewColumn | GridViewColumn | GalleryViewColumn | KanbanViewColumn
>;
sorts: Sort[]; sorts: Sort[];
filter: Filter; filter: Filter;
@ -487,6 +489,17 @@ export default class View implements ViewType {
); );
} }
break; break;
case ViewTypes.KANBAN:
{
col = await KanbanViewColumn.insert(
{
...param,
fk_view_id: view.id,
},
ncMeta
);
}
break;
} }
return col; return col;
@ -503,7 +516,11 @@ export default class View implements ViewType {
static async getColumns( static async getColumns(
viewId: string, viewId: string,
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
): Promise<Array<GridViewColumn | FormViewColumn | GalleryViewColumn>> { ): Promise<
Array<
GridViewColumn | FormViewColumn | GalleryViewColumn | KanbanViewColumn
>
> {
let columns: Array<GridViewColumn | any> = []; let columns: Array<GridViewColumn | any> = [];
const view = await this.get(viewId, ncMeta); const view = await this.get(viewId, ncMeta);
@ -512,13 +529,15 @@ export default class View implements ViewType {
case ViewTypes.GRID: case ViewTypes.GRID:
columns = await GridViewColumn.list(viewId, ncMeta); columns = await GridViewColumn.list(viewId, ncMeta);
break; break;
case ViewTypes.GALLERY: case ViewTypes.GALLERY:
columns = await GalleryViewColumn.list(viewId, ncMeta); columns = await GalleryViewColumn.list(viewId, ncMeta);
break; break;
case ViewTypes.FORM: case ViewTypes.FORM:
columns = await FormViewColumn.list(viewId, ncMeta); columns = await FormViewColumn.list(viewId, ncMeta);
break; break;
case ViewTypes.KANBAN:
columns = await KanbanViewColumn.list(viewId, ncMeta);
break;
} }
return columns; return columns;
@ -583,7 +602,9 @@ export default class View implements ViewType {
show: boolean; show: boolean;
}, },
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
): Promise<GridViewColumn | FormViewColumn | GalleryViewColumn | any> { ): Promise<
GridViewColumn | FormViewColumn | GalleryViewColumn | KanbanViewColumn | any
> {
const view = await this.get(viewId); const view = await this.get(viewId);
const table = this.extractViewColumnsTableName(view); const table = this.extractViewColumnsTableName(view);
console.log(table); console.log(table);

Loading…
Cancel
Save