Browse Source

Merge pull request #8592 from nocodb/nc-fix/comments-validation

fix: Comments - add maxLength constraint in json schema
pull/8594/head
Pranav C 4 months ago committed by GitHub
parent
commit
4f478994cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      packages/nocodb/src/controllers/comments.controller.ts
  2. 1
      packages/nocodb/src/meta/migrations/v2/nc_046_comment_mentions.ts
  3. 4
      packages/nocodb/src/meta/migrations/v2/nc_047_comment_migration.ts
  4. 6
      packages/nocodb/src/schema/swagger-v2.json
  5. 6
      packages/nocodb/src/schema/swagger.json
  6. 3
      packages/nocodb/src/utils/richTextHelper.ts

1
packages/nocodb/src/controllers/comments.controller.ts

@ -11,7 +11,6 @@ import {
Req,
UseGuards,
} from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard';
import { PagedResponseImpl } from '~/helpers/PagedResponse';
import { CommentsService } from '~/services/comments.service';

1
packages/nocodb/src/meta/migrations/v2/nc_046_comment_mentions.ts

@ -1,4 +1,3 @@
import { Logger } from '@nestjs/common';
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';

4
packages/nocodb/src/meta/migrations/v2/nc_047_comment_migration.ts

@ -72,9 +72,7 @@ const up = async (knex: Knex) => {
// check if there are more rows to fetch
fetchNextBatch = rows.length > READ_BATCH_SIZE;
}
logger.log(
'Data migrated from Audit Table to Comments Table',
);
logger.log('Data migrated from Audit Table to Comments Table');
};
const down = async (knex: Knex) => {

6
packages/nocodb/src/schema/swagger-v2.json

@ -12897,7 +12897,8 @@
"comment": {
"type": "string",
"description": "Description for the target row",
"example": "This is the comment for the row"
"example": "This is the comment for the row",
"maxLength": 3000
},
"fk_model_id": {
"type": "string",
@ -12935,7 +12936,8 @@
"comment": {
"type": "string",
"description": "Description for the target row",
"example": "This is the comment for the row"
"example": "This is the comment for the row",
"maxLength": 3000
},
"fk_model_id": {
"type": "string",

6
packages/nocodb/src/schema/swagger.json

@ -18927,7 +18927,8 @@
"comment": {
"type": "string",
"description": "Description for the target row",
"example": "This is the comment for the row"
"example": "This is the comment for the row",
"maxLength": 3000
},
"fk_model_id": {
"type": "string",
@ -18965,7 +18966,8 @@
"comment": {
"type": "string",
"description": "Description for the target row",
"example": "This is the comment for the row"
"example": "This is the comment for the row",
"maxLength": 3000
},
"fk_model_id": {
"type": "string",

3
packages/nocodb/src/utils/richTextHelper.ts

@ -6,8 +6,7 @@ export const extractMentions = (richText: string) => {
const regex = /@\(([^)]+)\)/g;
let match: RegExpExecArray | null;
match = regex.exec(richText);
const match: RegExpExecArray | null = regex.exec(richText);
while (match !== null) {
const userId = match[1].split('|')[0]; // Extracts the userId part from the matched string
mentions.push(userId);

Loading…
Cancel
Save