Signed-off-by: Pranav C <pranavxc@gmail.com>
@ -81,13 +81,13 @@ const getAst = async ({
...(await obj),
[col.title]:
allowedCols && (!includePkByDefault || !col.pk)
? (allowedCols[col.id] &&
? allowedCols[col.id] &&
(!isSystemColumn(col) || view.show_system_fields) &&
(!fields?.length || fields.includes(col.title)) &&
value)
: (fields?.length
value
: fields?.length
? fields.includes(col.title) && value
: value),
: value,
};
}, Promise.resolve({}));
@ -5,7 +5,7 @@ import { NcError } from '../helpers/catchError';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import ApiToken from '../../models/ApiToken';
import { metaApiMetrics } from '../helpers/apiMetrics';
import { getAjvValidatorMw } from './helpers'
import { getAjvValidatorMw } from './helpers';
export async function apiTokenList(req: Request, res: Response) {
res.json(await ApiToken.list(req['user'].id));
@ -7,7 +7,7 @@ import Base from '../../models/Base';
import { Tele } from 'nc-help';
import { getAjvValidatorMw, populateMeta } from './helpers'
import { getAjvValidatorMw, populateMeta } from './helpers';
export async function baseGet(
req: Request<any, any, any>,
@ -40,12 +40,13 @@ import { MetaTable } from '../../utils/globals';
import formulaQueryBuilderv2 from '../../db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2';
import {
createHmAndBtColumn,
generateFkName, getAjvValidatorMw,
generateFkName,
getAjvValidatorMw,
randomID,
validateLookupPayload,
validateRequiredField,
validateRollupPayload,
} from './helpers'
} from './helpers';
export enum Altered {
NEW_COLUMN = 1,
@ -13,7 +13,7 @@ import Project from '../../models/Project';
import Filter from '../../models/Filter';
// @ts-ignore
export async function filterGet(req: Request, res: Response, next) {
@ -13,7 +13,7 @@ import View from '../../models/View';
import FormView from '../../models/FormView';
export async function formViewGet(req: Request, res: Response<FormType>) {
@ -3,7 +3,7 @@ import FormViewColumn from '../../models/FormViewColumn';
// import { getAjvValidatorMw } from './helpers'
export async function columnUpdate(req: Request, res: Response) {
@ -5,7 +5,7 @@ import GalleryView from '../../models/GalleryView';
export async function galleryViewGet(req: Request, res: Response<GalleryType>) {
res.json(await GalleryView.get(req.params.galleryViewId));
}
import GridView from '../../models/GridView';
export async function gridViewCreate(req: Request<any, any>, res) {
@ -3,7 +3,7 @@ import GridViewColumn from '../../models/GridViewColumn';
export async function columnList(req: Request, res: Response) {
res.json(await GridViewColumn.list(req.params.gridViewId));
@ -2,12 +2,13 @@ import { customAlphabet } from 'nanoid';
ColumnReqType,
LinkToAnotherRecordType,
LookupColumnReqType, NcBoolType,
LookupColumnReqType,
NcBoolType,
RelationTypes,
RollupColumnReqType,
TableType,
UITypes,
} from 'nocodb-sdk'
} from 'nocodb-sdk';
import Column from '../../../models/Column';
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn';
import LookupColumn from '../../../models/LookupColumn';
@ -9,7 +9,7 @@ import Model from '../../models/Model';
import populateSamplePayload from '../helpers/populateSamplePayload';
export async function hookList(
@ -5,7 +5,7 @@ import KanbanView from '../../models/KanbanView';
export async function kanbanViewGet(req: Request, res: Response<KanbanType>) {
res.json(await KanbanView.get(req.params.kanbanViewId));
@ -4,7 +4,7 @@ import { Router } from 'express';
async function xcVisibilityMetaSetAll(req, res) {
Tele.emit('evt', { evt_type: 'uiAcl:updated' });
for (const d of req.body) {
@ -5,7 +5,7 @@ import Store from '../../models/Store';
import Noco from '../../Noco';
async function licenseGet(_req, res) {
const license = await Store.get(NC_LICENSE_KEY);
@ -18,7 +18,7 @@ import { metaApiMetrics } from '../helpers/apiMetrics';
import { extractPropsAndSanitize } from '../helpers/extractProps';
import NcConfigFactory from '../../utils/NcConfigFactory';
import { promisify } from 'util';
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4);
@ -28,7 +28,7 @@ export async function dataList(req: Request, res: Response) {
if (
view.type !== ViewTypes.GRID &&
view.type !== ViewTypes.KANBAN &&
view.type !== ViewTypes.GALLERY &&
view.type !== ViewTypes.MAP
) {
NcError.notFound('Not found');
@ -12,7 +12,7 @@ import Project from '../../models/Project';
import Sort from '../../models/Sort';
export async function sortGet(req: Request, res: Response<TableType>) {}
@ -89,7 +89,6 @@ async function showAllColumns(req: Request<any, any>, res) {
async function hideAllColumns(req: Request<any, any>, res) {
res.json(
await View.hideAllColumns(
req.params.viewId,
@ -7,7 +7,7 @@ import {
MetaTable,
} from '../utils/globals';
import Model from './Model';
import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk'
import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk';
import NocoCache from '../cache/NocoCache';
import CryptoJS from 'crypto-js';
import { extractProps } from '../meta/helpers/extractProps';
@ -1,4 +1,4 @@
import { NcBoolType } from 'nocodb-sdk'
import { NcBoolType } from 'nocodb-sdk';
import Noco from '../Noco';
import Column from './Column';
@ -93,7 +93,6 @@ export default class MapView implements MapType {
await View.updateColumn(body.fk_view_id, mapViewMappedByColumn.id, {
show: true,
});
// update meta
@ -1,6 +1,6 @@
import Base from './/Base';
import { NcBoolType, ProjectType } from 'nocodb-sdk'
import { NcBoolType, ProjectType } from 'nocodb-sdk';
CacheDelDirection,
CacheGetType,
@ -42,7 +42,6 @@ export enum MetaTable {
MAP_VIEW = 'nc_map_view_v2',
MAP_VIEW_COLUMNS = 'nc_map_view_columns_v2',
STORE = 'nc_store',
export const orderedMetaTables = [