Browse Source

Merge pull request #7610 from nocodb/nc-fix/form-view-field-limit

Nc fix/form view field limit
pull/7624/head
navi 9 months ago committed by GitHub
parent
commit
403e747f87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nc-gui/components/smartsheet/Form.vue
  2. 8
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  3. 88
      packages/nocodb/src/meta/migrations/v2/nc_039_sqlite_alter_column_types.ts
  4. 28
      packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts
  5. 59
      packages/nocodb/src/schema/swagger-v2.json
  6. 59
      packages/nocodb/src/schema/swagger.json

4
packages/nc-gui/components/smartsheet/Form.vue

@ -119,10 +119,6 @@ const { betaFeatureToggleState } = useBetaFeatureToggle()
const updateView = useDebounceFn( const updateView = useDebounceFn(
() => { () => {
if ((formViewData.value?.subheading?.length || 0) > 255) {
return message.error(t('msg.error.formDescriptionTooLong'))
}
updateFormView(formViewData.value) updateFormView(formViewData.value)
}, },
300, 300,

8
packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts

@ -25,6 +25,8 @@ import * as nc_035_add_username_to_users from '~/meta/migrations/v2/nc_035_add_u
import * as nc_036_base_deleted from '~/meta/migrations/v2/nc_036_base_deleted'; import * as nc_036_base_deleted from '~/meta/migrations/v2/nc_036_base_deleted';
import * as nc_037_rename_project_and_base from '~/meta/migrations/v2/nc_037_rename_project_and_base'; import * as nc_037_rename_project_and_base from '~/meta/migrations/v2/nc_037_rename_project_and_base';
import * as nc_038_formula_parsed_tree_column from '~/meta/migrations/v2/nc_038_formula_parsed_tree_column'; import * as nc_038_formula_parsed_tree_column from '~/meta/migrations/v2/nc_038_formula_parsed_tree_column';
import * as nc_039_sqlite_alter_column_types from '~/meta/migrations/v2/nc_039_sqlite_alter_column_types';
import * as nc_040_form_view_alter_column_types from '~/meta/migrations/v2/nc_040_form_view_alter_column_types';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -61,6 +63,8 @@ export default class XcMigrationSourcev2 {
'nc_036_base_deleted', 'nc_036_base_deleted',
'nc_037_rename_project_and_base', 'nc_037_rename_project_and_base',
'nc_038_formula_parsed_tree_column', 'nc_038_formula_parsed_tree_column',
'nc_039_sqlite_alter_column_types',
'nc_040_form_view_alter_column_types',
]); ]);
} }
@ -124,6 +128,10 @@ export default class XcMigrationSourcev2 {
return nc_037_rename_project_and_base; return nc_037_rename_project_and_base;
case 'nc_038_formula_parsed_tree_column': case 'nc_038_formula_parsed_tree_column':
return nc_038_formula_parsed_tree_column; return nc_038_formula_parsed_tree_column;
case 'nc_039_sqlite_alter_column_types':
return nc_039_sqlite_alter_column_types;
case 'nc_040_form_view_alter_column_types':
return nc_040_form_view_alter_column_types;
} }
} }
} }

88
packages/nocodb/src/meta/migrations/v2/nc_039_sqlite_alter_column_types.ts

@ -0,0 +1,88 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
if (knex.client.config.client === 'sqlite3') {
//nc_012_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('cdf').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('dtxp').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('cc').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('ct').alter();
});
//nc_014_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('success_msg').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('redirect_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('banner_image_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('logo_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('description').alter();
});
//nc_016_alter_hooklog_payload_types.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.text('payload').alter();
});
//nc_029_webhook.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.text('response').alter();
});
}
};
const down = async (knex) => {
if (knex.client.config.client === 'sqlite3') {
//nc_012_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('cdf').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('dtxp').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('cc').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('ct').alter();
});
//nc_014_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('success_msg').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('redirect_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('banner_image_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('logo_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.string('description').alter();
});
//nc_016_alter_hooklog_payload_types.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.boolean('payload').alter();
});
//nc_029_webhook.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.boolean('response').alter();
});
}
};
export { up, down };

28
packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts

@ -0,0 +1,28 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('subheading').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('label').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('help').alter();
});
};
const down = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('subheading').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.string('label').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.string('help').alter();
});
};
export { up, down };

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

@ -12947,7 +12947,7 @@
} }
}, },
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"columns": { "columns": {
@ -12990,7 +12990,7 @@
"example": "collaborative" "example": "collaborative"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -13002,7 +13002,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -13010,7 +13010,7 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"type": "string", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form", "description": "The subheading of the form",
"example": "My Form Subheading" "example": "My Form Subheading"
}, },
@ -13019,7 +13019,7 @@
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
}, },
"title": { "title": {
@ -13053,7 +13053,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"email": { "email": {
@ -13067,7 +13067,7 @@
"type": "string" "type": "string"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -13079,7 +13079,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -13087,15 +13087,16 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form" "description": "The subheading of the form",
"example": "My Form Subheading"
}, },
"submit_another_form": { "submit_another_form": {
"$ref": "#/components/schemas/Bool", "$ref": "#/components/schemas/Bool",
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
} }
}, },
@ -13147,8 +13148,8 @@
"description": "Unique ID" "description": "Unique ID"
}, },
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"fk_column_id": { "fk_column_id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
@ -13159,11 +13160,11 @@
"description": "Foreign Key to View" "description": "Foreign Key to View"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -13232,15 +13233,15 @@
}, },
"properties": { "properties": {
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -16751,6 +16752,22 @@
"id": "8v8qzwm3w4v11" "id": "8v8qzwm3w4v11"
} }
}, },
"TextOrNull": {
"description": "Model for TextOrNull",
"examples": [
"string"
],
"oneOf": [
{
"maxLength": 8192,
"type": "string"
},
{
"type": "null"
}
],
"title": "TextOrNull Model"
},
"StringOrNull": { "StringOrNull": {
"description": "Model for StringOrNull", "description": "Model for StringOrNull",
"examples": [ "examples": [

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

@ -18193,7 +18193,7 @@
} }
}, },
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"columns": { "columns": {
@ -18236,7 +18236,7 @@
"example": "collaborative" "example": "collaborative"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -18248,7 +18248,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -18256,7 +18256,7 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"type": "string", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form", "description": "The subheading of the form",
"example": "My Form Subheading" "example": "My Form Subheading"
}, },
@ -18265,7 +18265,7 @@
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
}, },
"title": { "title": {
@ -18299,7 +18299,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"email": { "email": {
@ -18313,7 +18313,7 @@
"type": "string" "type": "string"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -18325,7 +18325,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -18333,15 +18333,16 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form" "description": "The subheading of the form",
"example": "My Form Subheading"
}, },
"submit_another_form": { "submit_another_form": {
"$ref": "#/components/schemas/Bool", "$ref": "#/components/schemas/Bool",
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
} }
}, },
@ -18393,8 +18394,8 @@
"description": "Unique ID" "description": "Unique ID"
}, },
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"fk_column_id": { "fk_column_id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
@ -18405,11 +18406,11 @@
"description": "Foreign Key to View" "description": "Foreign Key to View"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -18478,15 +18479,15 @@
}, },
"properties": { "properties": {
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -22007,6 +22008,22 @@
"id": "8v8qzwm3w4v11" "id": "8v8qzwm3w4v11"
} }
}, },
"TextOrNull": {
"description": "Model for TextOrNull",
"examples": [
"string"
],
"oneOf": [
{
"maxLength": 8192,
"type": "string"
},
{
"type": "null"
}
],
"title": "TextOrNull Model"
},
"StringOrNull": { "StringOrNull": {
"description": "Model for StringOrNull", "description": "Model for StringOrNull",
"examples": [ "examples": [

Loading…
Cancel
Save