Browse Source

Merge pull request #6624 from nocodb/nc-refactor/rename-row-to-records

Refactor: Rename row/column to record/field
pull/6630/head
mertmit 1 year ago committed by GitHub
parent
commit
53a34a0e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 2
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue
  3. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  4. 2
      packages/nc-gui/composables/useData.ts
  5. 2
      packages/nc-gui/composables/useExpandedFormStore.ts
  6. 2
      packages/nc-gui/composables/useKanbanViewStore.ts
  7. 2
      packages/nc-gui/composables/useLTARStore.ts
  8. 131
      packages/nc-gui/lang/en.json
  9. 18
      packages/nocodb/src/controllers/data-table.controller.ts
  10. 6
      packages/nocodb/src/db/BaseModelSqlv2.ts
  11. 2
      packages/nocodb/src/db/sql-client/lib/mysql/MysqlClient.ts
  12. 2
      packages/nocodb/src/helpers/PagedResponse.ts
  13. 4
      packages/nocodb/src/helpers/catchError.ts
  14. 8
      packages/nocodb/src/schema/swagger.json
  15. 4
      packages/nocodb/src/services/data-table.service.ts
  16. 72
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts
  17. 2
      packages/nocodb/tests/unit/rest/tests/viewRow.test.ts
  18. 2
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  19. 2
      tests/playwright/pages/Dashboard/Grid/Group.ts
  20. 4
      tests/playwright/pages/Dashboard/Grid/index.ts

2
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -48,7 +48,7 @@ const { getMeta } = useMetas()
const { t } = useI18n()
const columnLabel = computed(() => props.columnLabel || t('objects.column'))
const columnLabel = computed(() => props.columnLabel || t('objects.field'))
const { $e } = useNuxtApp()

2
packages/nc-gui/components/smartsheet/column/LookupOptions.vue

@ -105,7 +105,7 @@ const cellIcon = (column: ColumnType) =>
</a-select>
</a-form-item>
<a-form-item class="flex w-1/2" :label="$t('labels.childColumn')" v-bind="validateInfos.fk_lookup_column_id">
<a-form-item class="flex w-1/2" :label="$t('labels.childField')" v-bind="validateInfos.fk_lookup_column_id">
<a-select
v-model:value="vModel.fk_lookup_column_id"
name="fk_lookup_column_id"

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -402,7 +402,7 @@ const onDeleteRowClick = () => {
const onConfirmDeleteRowClick = async () => {
showDeleteRowModal.value = false
await deleteRowById(primaryKey.value)
message.success('Row deleted')
message.success('Record deleted')
reloadTrigger.trigger()
onClose()
showDeleteRowModal.value = false

2
packages/nc-gui/composables/useData.ts

@ -494,7 +494,7 @@ export function useData(args: {
if (res.message) {
message.info(
`Row delete failed: ${`Unable to delete row with ID ${id} because of the following:
`Record delete failed: ${`Unable to delete record with ID ${id} because of the following:
\n${res.message.join('\n')}.\n
Clear the data first & try again`})}`,
)

2
packages/nc-gui/composables/useExpandedFormStore.ts

@ -322,7 +322,7 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
if (res.message) {
message.info(
`Row delete failed: ${`Unable to delete row with ID ${rowId} because of the following:
`Record delete failed: ${`Unable to delete record with ID ${rowId} because of the following:
\n${res.message.join('\n')}.\n
Clear the data first & try again`})}`,
)

2
packages/nc-gui/composables/useKanbanViewStore.ts

@ -679,7 +679,7 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
if (res.message) {
message.info(
`Row delete failed: ${`Unable to delete row with ID ${id} because of the following:
`Record delete failed: ${`Unable to delete record with ID ${id} because of the following:
\n${res.message.join('\n')}.\n
Clear the data first & try again`})}`,
)

2
packages/nc-gui/composables/useLTARStore.ts

@ -291,7 +291,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
if (res.message) {
message.info(
`Row delete failed: ${`Unable to delete row with ID ${id} because of the following:
`Record delete failed: ${`Unable to delete record with ID ${id} because of the following:
\n${res.message.join('\n')}.\n
Clear the data first & try again`})}`,
)

131
packages/nc-gui/lang/en.json

@ -185,8 +185,8 @@
"tables": "Tables",
"field": "Field",
"fields": "Fields",
"column": "Column",
"columns": "Columns",
"column": "Field",
"columns": "Fields",
"page": "Page",
"pages": "Pages",
"record": "record",
@ -219,7 +219,7 @@
"orgLevelViewer": "Organization Level Viewer"
},
"sqlVIew": "SQL View",
"rowHeight": "Row Height",
"rowHeight": "Record Height",
"heightClass": {
"short": "Short",
"medium": "Medium",
@ -291,11 +291,11 @@
"dateJoined": "Date Joined",
"tokenName": "Token name",
"inDesktop": "in Desktop",
"rowData": "Row data",
"rowData": "Record data",
"creator": "Creator",
"qrCode": "QR Code",
"termsOfService": "Terms of Service",
"updateSelectedRows": "Update Selected Rows",
"updateSelectedRows": "Update Selected Records",
"noFiltersAdded": "No filters added",
"editCards": "Edit Cards",
"noFieldsFound": "No fields found",
@ -366,7 +366,7 @@
"codeSnippet": "Code Snippet",
"keyboardShortcut": "Keyboard Shortcuts",
"generateRandomName": "Generate Random Name",
"findRowByScanningCode": "Find row by scanning a QR or Barcode",
"findRowByScanningCode": "Find record by scanning a QR or Barcode",
"tokenManagement": "Token Management",
"addNewToken": "Add new token",
"accountSettings": "Account Settings",
@ -458,9 +458,9 @@
"createKanbanView": "Create Kanban View",
"viewName": "View name",
"viewLink": "View Link",
"columnName": "Column Name",
"columnToScanFor": "Column to scan",
"columnType": "Column Type",
"columnName": "Field Name",
"columnToScanFor": "Field to scan",
"columnType": "Field Type",
"roleName": "Role Name",
"roleDescription": "Role Description",
"databaseType": "Type in Database",
@ -502,8 +502,8 @@
"sqlOutput": "SQL Output",
"addOption": "Add option",
"interfaceColor": "Interface Color",
"qrCodeValueColumn": "Column with QR code value",
"barcodeValueColumn": "Column with Barcode value",
"qrCodeValueColumn": "Field with QR code value",
"barcodeValueColumn": "Field with Barcode value",
"barcodeFormat": "Barcode format",
"qrCodeValueTooLong": "Too many characters for a QR code",
"barcodeValueTooLong": "Too many characters for a barcode",
@ -519,7 +519,7 @@
"requriedIdentity": "Required-IDENTITY",
"inflection": {
"tableName": "Inflection - Table name",
"columnName": "Inflection - Column name"
"columnName": "Inflection - Field name"
},
"community": {
"starUs1": "Star",
@ -536,7 +536,8 @@
"docReference": "Document Reference",
"selectUserRole": "Select User Role",
"childTable": "Child table",
"childColumn": "Child column",
"childColumn": "Child field",
"childField": "Child field",
"linkToAnotherRecord": "Link to another record",
"links": "Links",
"onUpdate": "On Update",
@ -552,16 +553,16 @@
"sharedBase": "Shared Base",
"importData": "Import Data",
"importSecondaryViews": "Import Secondary Views",
"importRollupColumns": "Import Rollup Columns",
"importLookupColumns": "Import Lookup Columns",
"importAttachmentColumns": "Import Attachment Columns",
"importFormulaColumns": "Import Formula Columns",
"importRollupColumns": "Import Rollup Fields",
"importLookupColumns": "Import Lookup Fields",
"importAttachmentColumns": "Import Attachment Fields",
"importFormulaColumns": "Import Formula Fields",
"importUsers": "Import Users (by email)",
"noData": "No Data",
"goToDashboard": "Go to Dashboard",
"importing": "Importing",
"formatJson": "Format JSON",
"firstRowAsHeaders": "Use First Row as Headers",
"firstRowAsHeaders": "Use First Record as Headers",
"flattenNested": "Flatten Nested",
"downloadAllowed": "Download allowed",
"weAreHiring": "We are Hiring!",
@ -578,8 +579,8 @@
"agreeToTos": "By signing up, you agree to the Terms of Service",
"welcomeToNc": "Welcome to NocoDB!",
"inviteOnlySignup": "Allow signup only using invite url",
"nextRow": "Next Row",
"prevRow": "Previous Row",
"nextRow": "Next Record",
"prevRow": "Previous Record",
"addRowGrid": "Manually add data in grid view",
"addRowForm": "Enter record data through a form",
"noAccess": "No access",
@ -588,7 +589,7 @@
"includeData": "Include Data",
"includeView": "Include View",
"includeWebhook": "Include Webhook",
"zoomInToViewColumns": "Zoom in to view columns"
"zoomInToViewColumns": "Zoom in to view fields"
},
"activity": {
"onCondition": "On Condition",
@ -695,17 +696,17 @@
"deleteTable": "Delete Table",
"addField": "Add new field to this table",
"setDisplay": "Set as Display value",
"addRow": "Add new row",
"saveRow": "Save row",
"addRow": "Add new record",
"saveRow": "Save record",
"saveAndExit": "Save & Exit",
"saveAndStay": "Save & Stay",
"insertRow": "Insert new row",
"duplicateRow": "Duplicate row",
"deleteRow": "Delete row",
"deleteRows": "Delete rows",
"predictColumns": "Predict Columns",
"insertRow": "Insert new record",
"duplicateRow": "Duplicate record",
"deleteRow": "Delete record",
"deleteRows": "Delete records",
"predictColumns": "Predict Fields",
"predictFormulas": "Predict Formulas",
"deleteSelectedRow": "Delete selected rows",
"deleteSelectedRow": "Delete Selected Records",
"importExcel": "Import Excel",
"importCSV": "Import CSV",
"downloadCSV": "Download as CSV",
@ -719,7 +720,7 @@
"changePwd": "Change Password",
"createView": "Create a View",
"shareView": "Share View",
"findRowByCodeScan": "Find row by scan",
"findRowByCodeScan": "Find record by scan",
"fillByCodeScan": "Fill by scan",
"listSharedView": "Shared View List",
"ListView": "Views List",
@ -763,7 +764,7 @@
"expandRecord": "Expand Record",
"deleteRecord": "Delete Record",
"erd": {
"showColumns": "Show Columns",
"showColumns": "Show Fields",
"showPkAndFk": "Show Primary and Foreign Keys",
"showSqlViews": "Show SQL Views",
"showMMTables": "Show Many to Many tables",
@ -821,8 +822,8 @@
"selectDiscordChannels": "Select Discord channels",
"selectMattermostChannels": "Select Mattermost channels",
"webhookTitle": "Webhook Title",
"barcodeColumn": "Select a column for the Barcode value",
"notFoundContent": "No valid Column Type can be found.",
"barcodeColumn": "Select a field for the Barcode value",
"notFoundContent": "No valid field Type can be found.",
"selectBarcodeFormat": "Select a Barcode format",
"projName": "Enter Base Name",
"selectGroupField": "Select a Grouping Field",
@ -836,11 +837,11 @@
"save": "Save password",
"confirm": "Confirm new password"
},
"selectAColumnForTheQRCodeValue": "Select a column for the QR code value",
"selectAColumnForTheQRCodeValue": "Select a field for the QR code value",
"allowNegativeNumbers": "Allow negative numbers",
"searchProjectTree": "Search tables",
"searchFields": "Search fields",
"searchColumn": "Search {search} column",
"searchColumn": "Search {search} field",
"searchApps": "Search apps",
"searchModels": "Search models",
"noItemsFound": "No items found",
@ -871,7 +872,7 @@
"newFormWillBeLoaded": "New form will be loaded after {seconds} seconds",
"optimizedQueryDisabled": "Optimized query is disabled",
"optimizedQueryEnabled": "Optimized query is enabled",
"lookupNonBtWarning": "Lookup column is not supported for non-Belongs to relation",
"lookupNonBtWarning": "Lookup field is not supported for non-Belongs to relation",
"invalidTime": "Invalid Time",
"linkColumnClearNotSupportedYet": "You don't have any supported links for Lookup",
"recordCouldNotBeFound": "Record could not be found",
@ -882,14 +883,14 @@
"webhookBodyMsg2": "body",
"webhookBodyMsg3": "to refer the record under consideration",
"formula": {
"hintStart": "Hint: Use {placeholder1} to reference columns, e.g: {placeholder2}. For more, please check out",
"hintStart": "Hint: Use {placeholder1} to reference fields, e.g: {placeholder2}. For more, please check out",
"hintEnd": "Formulas.",
"noSuggestedFormulaFound": "No suggested formula found",
"numericTypeIsExpected": "Numeric type is expected",
"stringTypeIsExpected": "String type is expected",
"operationNotAvailable": "{operation} operation not available",
"cantSaveFieldFormulaInvalid": "Can’t save field because formula is invalid",
"notSupportedToReferenceColumn": "Not supported to reference column {columnName}",
"notSupportedToReferenceColumn": "Not supported to reference field {columnName}",
"typeIsExpectedButFound": "Type {type} is expected but found Type {found}",
"requiredArgumentsFormula": "{calleeName} requires {requiredArguments} arguments",
"minRequiredArgumentsFormula": "{calleeName} required minimum {minRequiredArguments} arguments",
@ -903,14 +904,14 @@
"firstParamDateDiffHaveDate": "The first parameter of DATEDIFF() should have date value",
"secondParamDateDiffHaveDate": "The second parameter of DATEDIFF() should have date value",
"thirdParamDateDiffHaveDate": "The third parameter of DATETIME_DIFF() should have value either \"milliseconds\", \"ms\", \"seconds\", \"s\", \"minutes\", \"m\", \"hours\", \"h\", \"days\", \"d\", \"weeks\", \"w\", \"months\", \"M\", \"quarters\", \"Q\", \"years\", or \"y\"",
"columnNotAvailable": "Column {columnName} is not available",
"columnNotAvailable": "Field {columnName} is not available",
"cantSaveCircularReference": "Can’t save field because it causes a circular reference",
"columnWithTypeFoundButExpected": "Column {columnName} with {columnType} type is found but {expectedType} type is expected",
"columnWithTypeFoundButExpected": "Field {columnName} with {columnType} type is found but {expectedType} type is expected",
"columnNotMatchedWithType": "{columnName} is not matched with {columnType}"
},
"selectOption": {
"cantBeNull": "Select options can't be null",
"multiSelectCantHaveCommas": "MultiSelect columns can't have commas(',')",
"multiSelectCantHaveCommas": "MultiSelect fields can't have commas(',')",
"cantHaveDuplicates": "Select options can't have duplicates",
"createNewOptionNamed": "Create new option named"
},
@ -919,7 +920,7 @@
"invalidLocale": "Invalid locale",
"invalidCurrencyCode": "Invalid Currency Code",
"postgresHasItsOwnCurrencySettings": "PostgreSQL 'money' type has own currency settings",
"validColumnsForBarCode": "The valid Column Types for a Barcode Column are: Number, Single Line Text, Long Text, Phone Number, URL, Email, Decimal. Please create one first.",
"validColumnsForBarCode": "The valid Field Types for a Barcode Field are: Number, Single Line Text, Long Text, Phone Number, URL, Email, Decimal. Please create one first.",
"hm": {
"title": "Has Many Relation",
"tooltip_desc": "A single record from table ",
@ -951,7 +952,7 @@
"createWebhookMsg2": "Create web-hooks to power you automations,",
"createWebhookMsg3": "Get notified as soon as there are changes in your data",
"areYouSureUWantTo": "Are you sure you want to delete the following",
"idColumnRequired": "ID column is required, you can rename this later if required.",
"idColumnRequired": "ID field is required, you can rename this later if required.",
"length59Required": "The length exceeds the max 59 characters",
"warning": {
"dbValid": "Please make sure database you are trying to connect is valid! This operation can cause schema loss!!",
@ -974,22 +975,22 @@
},
"codeScanner": {
"loadingScanner": "Loading the scanner...",
"selectColumn": "Select a column (QR code or Barcode) that you want to use for finding a row by scanning.",
"moreThanOneRowFoundForCode": "More than one row found for this code. Currently only unique codes are supported.",
"noRowFoundForCode": "No row found for this code for the selected column"
"selectColumn": "Select a field (QR code or Barcode) that you want to use for finding a record by scanning.",
"moreThanOneRowFoundForCode": "More than one record found for this code. Currently only unique codes are supported.",
"noRowFoundForCode": "No record found for this code for the selected field"
},
"map": {
"overLimit": "You're over the limit.",
"closeLimit": "You're getting close to the limit.",
"limitNumber": "The limit of markers shown in a Map View is 1000 records."
},
"footerInfo": "Rows per page",
"footerInfo": "Records per page",
"upload": "Select file to Upload",
"upload_sub": "or drag and drop file",
"excelSupport": "Supported: .xls, .xlsx, .xlsm, .ods, .ots",
"excelURL": "Enter excel file URL",
"csvURL": "Enter CSV file URL",
"footMsg": "# of rows to parse to infer datatype",
"footMsg": "# of records to parse to infer datatype",
"excelImport": "sheet(s) are available for import",
"exportMetadata": "Do you want to export metadata from meta tables?",
"importMetadata": "Do you want to import metadata from meta tables?",
@ -1073,8 +1074,8 @@
"enterTableName": "Enter table name",
"enterLayoutName": "Enter Layout name",
"enterDashboardName": "Enter Dashboard name",
"defaultColumns": "Default columns",
"addDefaultColumns": "Add default columns",
"defaultColumns": "Default fields",
"addDefaultColumns": "Add default fields",
"tableNameInDb": "Table name as saved in database",
"airtable": {
"credentials": "Where to find this?"
@ -1094,7 +1095,7 @@
"cacheEmpty": "Cache is empty",
"exportedCache": "Exported Cache Successfully",
"valueAlreadyInList": "This value is already in the list",
"noColumnsToUpdate": "No columns to update",
"noColumnsToUpdate": "No fields to update",
"tableDeleted": "Deleted table successfully",
"layoutDeleted": "Deleted layout successfully",
"generatePublicShareableReadonlyBase": "Generate publicly shareable readonly base",
@ -1149,11 +1150,11 @@
"internalError": "Some internal error occurred",
"templateGeneratorNotFound": "Template Generator cannot be found!",
"fileUploadFailed": "Failed to upload file",
"primaryColumnUpdateFailed": "Failed to update primary column",
"primaryColumnUpdateFailed": "Failed to update primary field",
"formDescriptionTooLong": "Data too long for Form Description",
"columnsRequired": "Following columns are required",
"selectAtleastOneColumn": "At least one column has to be selected",
"columnDescriptionNotFound": "Cannot find the destination column for",
"columnsRequired": "Following fields are required",
"selectAtleastOneColumn": "At least one field has to be selected",
"columnDescriptionNotFound": "Cannot find the destination field for",
"duplicateMappingFound": "Duplicate mapping found, please remove one of the mapping",
"nullValueViolatesNotNull": "Null value violates not-null constraint",
"sourceHasInvalidNumbers": "Source data contains some invalid numbers",
@ -1165,17 +1166,17 @@
"failedToLoadChildrenList": "Failed to load children list",
"deleteFailed": "Delete failed",
"unlinkFailed": "Unlink failed",
"rowUpdateFailed": "Row update failed",
"deleteRowFailed": "Failed to delete row",
"rowUpdateFailed": "Record update failed",
"deleteRowFailed": "Failed to delete record",
"setFormDataFailed": "Failed to set form data",
"formViewUpdateFailed": "Failed to update form view",
"tableNameRequired": "Table name is required",
"nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _",
"followingCharactersAreNotAllowed": "Following characters are not allowed",
"columnNameRequired": "Column name is required",
"duplicateColumnName": "Duplicate column name",
"columnNameRequired": "Field name is required",
"duplicateColumnName": "Duplicate field name",
"uiDataTypeRequired": "UI data type is required",
"columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters",
"columnNameExceedsCharacters": "The length of field name exceeds the max {value} characters",
"projectNameExceeds50Characters": "Base name exceeds 50 characters",
"projectNameCannotStartWithSpace": "Base name cannot start with space",
"requiredField": "Required field",
@ -1208,8 +1209,8 @@
},
"success": {
"licenseKeyUpdated": "License Key Updated",
"columnDuplicated": "Column duplicated successfully",
"rowDuplicatedWithoutSavedYet": "Row duplicated (not saved)",
"columnDuplicated": "Field duplicated successfully",
"rowDuplicatedWithoutSavedYet": "Record duplicated (not saved)",
"updatedUIACL": "Updated UI ACL for tables successfully",
"pluginUninstalled": "Plugin uninstalled successfully",
"pluginSettingsSaved": "Plugin settings saved successfully",
@ -1217,7 +1218,7 @@
"tableRenamed": "Table renamed successfully",
"layoutRenamed": "Layout renamed successfully",
"viewDeleted": "View deleted successfully",
"primaryColumnUpdated": "Successfully updated as primary column",
"primaryColumnUpdated": "Successfully updated as primary field",
"tableDataExported": "Successfully exported all table data",
"updated": "Successfully updated",
"sharedViewDeleted": "Deleted shared view successfully",
@ -1239,8 +1240,8 @@
"webhookUpdated": "Webhook details updated successfully",
"webhookDeleted": "Hook deleted successfully",
"webhookTested": "Webhook tested successfully",
"columnUpdated": "Column updated",
"columnCreated": "Column created",
"columnUpdated": "Field updated",
"columnCreated": "Field created",
"passwordChanged": "Password changed successfully. Please login again.",
"settingsSaved": "Settings saved successfully",
"roleUpdated": "Role updated successfully"

18
packages/nocodb/src/controllers/data-table.controller.ts

@ -24,7 +24,7 @@ export class DataTableController {
constructor(private readonly dataTableService: DataTableService) {}
// todo: Handle the error case where view doesnt belong to model
@Get('/api/v1/tables/:modelId/rows')
@Get('/api/v2/tables/:modelId/records')
@Acl('dataList')
async dataList(
@Request() req,
@ -43,7 +43,7 @@ export class DataTableController {
res.json(responseData);
}
@Get(['/api/v1/tables/:modelId/rows/count'])
@Get(['/api/v2/tables/:modelId/records/count'])
@Acl('dataCount')
async dataCount(
@Request() req,
@ -60,7 +60,7 @@ export class DataTableController {
res.json(countResult);
}
@Post(['/api/v1/tables/:modelId/rows'])
@Post(['/api/v2/tables/:modelId/records'])
@HttpCode(200)
@Acl('dataInsert')
async dataInsert(
@ -77,7 +77,7 @@ export class DataTableController {
});
}
@Patch(['/api/v1/tables/:modelId/rows'])
@Patch(['/api/v2/tables/:modelId/records'])
@Acl('dataUpdate')
async dataUpdate(
@Request() req,
@ -93,7 +93,7 @@ export class DataTableController {
});
}
@Delete(['/api/v1/tables/:modelId/rows'])
@Delete(['/api/v2/tables/:modelId/records'])
@Acl('dataDelete')
async dataDelete(
@Request() req,
@ -109,7 +109,7 @@ export class DataTableController {
});
}
@Get(['/api/v1/tables/:modelId/rows/:rowId'])
@Get(['/api/v2/tables/:modelId/records/:rowId'])
@Acl('dataRead')
async dataRead(
@Request() req,
@ -125,7 +125,7 @@ export class DataTableController {
});
}
@Get(['/api/v1/tables/:modelId/links/:columnId/rows/:rowId'])
@Get(['/api/v2/tables/:modelId/links/:columnId/records/:rowId'])
@Acl('nestedDataList')
async nestedDataList(
@Request() req,
@ -143,7 +143,7 @@ export class DataTableController {
});
}
@Post(['/api/v1/tables/:modelId/links/:columnId/rows/:rowId'])
@Post(['/api/v2/tables/:modelId/links/:columnId/records/:rowId'])
@Acl('nestedDataLink')
async nestedLink(
@Request() req,
@ -164,7 +164,7 @@ export class DataTableController {
});
}
@Delete(['/api/v1/tables/:modelId/links/:columnId/rows/:rowId'])
@Delete(['/api/v2/tables/:modelId/links/:columnId/records/:rowId'])
@Acl('nestedDataUnlink')
async nestedUnlink(
@Request() req,

6
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -4299,7 +4299,7 @@ class BaseModelSqlv2 {
// validate rowId
if (!row) {
NcError.notFound(`Row with id '${rowId}' not found`);
NcError.notFound(`Record with id '${rowId}' not found`);
}
if (!childIds.length) return;
@ -4524,7 +4524,7 @@ class BaseModelSqlv2 {
// validate rowId
if (!row) {
NcError.notFound(`Row with id '${rowId}' not found`);
NcError.notFound(`Record with id '${rowId}' not found`);
}
if (!childIds.length) return;
@ -4686,7 +4686,7 @@ class BaseModelSqlv2 {
// validate rowId
if (!row) {
NcError.notFound(`Row with id ${id} not found`);
NcError.notFound(`Record with id ${id} not found`);
}
const parentCol = await (

2
packages/nocodb/src/db/sql-client/lib/mysql/MysqlClient.ts

@ -1936,7 +1936,7 @@ class MysqlClient extends KnexClient {
await promisify(jsonfile.writeFile)(
seedSettings,
{
rows: { value: 8, description: 'Maximum number of rows' },
rows: { value: 8, description: 'Maximum number of records' },
foreign_key_rows: {
value: 2,
description: '1:n - Total number foreign key per relation',

2
packages/nocodb/src/helpers/PagedResponse.ts

@ -37,7 +37,7 @@ export class PagedResponseImpl<T> {
if (offset && offset >= +count) {
this.errors = [
{
message: 'Offset is beyond the total number of rows',
message: 'Offset is beyond the total number of records',
},
];
}

4
packages/nocodb/src/helpers/catchError.ts

@ -215,7 +215,7 @@ export function extractDBError(error): {
message = 'A timeout occurred while waiting for a table lock.';
break;
case 'ER_NO_REFERENCED_ROW':
message = 'The referenced row does not exist.';
message = 'The referenced record does not exist.';
break;
case 'ER_ROW_IS_REFERENCED':
message = 'This record is being referenced by other records.';
@ -232,7 +232,7 @@ export function extractDBError(error): {
message = 'A value is required for this field.';
break;
case '23503':
message = 'The referenced row does not exist.';
message = 'The referenced record does not exist.';
break;
case '23514':
message = 'A null value is not allowed for this field.';

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

@ -15338,7 +15338,7 @@
]
}
},
"/api/v1/tables/{tableId}/rows": {
"/api/v2/tables/{tableId}/rows": {
"parameters": [
{
"schema": {
@ -15693,7 +15693,7 @@
]
}
},
"/api/v1/tables/{tableId}/rows/{rowId}": {
"/api/v2/tables/{tableId}/records/{rowId}": {
"parameters": [
{
"schema": {
@ -15790,7 +15790,7 @@
}
}
},
"/api/v1/tables/{tableId}/rows/count": {
"/api/v2/tables/{tableId}/records/count": {
"parameters": [
{
"schema": {
@ -15929,7 +15929,7 @@
}
}
},
"/api/v1/tables/{tableId}/links/{columnId}/rows/{rowId}": {
"/api/v2/tables/{tableId}/links/{columnId}/records/{rowId}": {
"parameters": [
{
"schema": {

4
packages/nocodb/src/services/data-table.service.ts

@ -247,7 +247,7 @@ export class DataTableService {
.join('___');
// if duplicate then throw error
if (keys.has(pk)) {
NcError.unprocessableEntity('Duplicate row with id ' + pk);
NcError.unprocessableEntity('Duplicate record with id ' + pk);
}
if (pk === undefined || pk === null) {
@ -274,7 +274,7 @@ export class DataTableService {
});
if (!(await baseModel.exist(param.rowId))) {
NcError.notFound(`Row with id '${param.rowId}' not found`);
NcError.notFound(`Record with id '${param.rowId}' not found`);
}
const column = await this.getColumn(param);

72
packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

@ -139,7 +139,7 @@ const verifyColumnsInRsp = (row, columns: ColumnType[]) => {
};
async function ncAxiosGet({
url = `/api/v1/tables/${table.id}/rows`,
url = `/api/v2/tables/${table.id}/records`,
query = {},
status = 200,
}: { url?: string; query?: any; status?: number } = {}) {
@ -153,7 +153,7 @@ async function ncAxiosGet({
}
async function ncAxiosPost({
url = `/api/v1/tables/${table.id}/rows`,
url = `/api/v2/tables/${table.id}/records`,
body = {},
status = 200,
}: { url?: string; body?: any; status?: number } = {}) {
@ -166,7 +166,7 @@ async function ncAxiosPost({
}
async function ncAxiosPatch({
url = `/api/v1/tables/${table.id}/rows`,
url = `/api/v2/tables/${table.id}/records`,
body = {},
status = 200,
}: { url?: string; body?: any; status?: number } = {}) {
@ -179,7 +179,7 @@ async function ncAxiosPatch({
}
async function ncAxiosDelete({
url = `/api/v1/tables/${table.id}/rows`,
url = `/api/v2/tables/${table.id}/records`,
body = {},
status = 200,
}: { url?: string; body?: any; status?: number } = {}) {
@ -200,7 +200,7 @@ async function ncAxiosLinkGet({
msg,
}: { urlParams?: any; query?: any; status?: number; msg?: string } = {}) {
const urlParams = { tableId, linkId, rowId };
const url = `/api/v1/tables/${urlParams.tableId}/links/${urlParams.linkId}/rows/${urlParams.rowId}`;
const url = `/api/v2/tables/${urlParams.tableId}/links/${urlParams.linkId}/records/${urlParams.rowId}`;
const response = await request(context.app)
.get(url)
.set('xc-auth', context.token)
@ -226,7 +226,7 @@ async function ncAxiosLinkAdd({
msg,
}: { urlParams?: any; body?: any; status?: number; msg?: string } = {}) {
const urlParams = { tableId, linkId, rowId };
const url = `/api/v1/tables/${urlParams.tableId}/links/${urlParams.linkId}/rows/${urlParams.rowId}`;
const url = `/api/v2/tables/${urlParams.tableId}/links/${urlParams.linkId}/records/${urlParams.rowId}`;
const response = await request(context.app)
.post(url)
.set('xc-auth', context.token)
@ -253,7 +253,7 @@ async function ncAxiosLinkRemove({
msg,
}: { urlParams?: any; body?: any; status?: number; msg?: string } = {}) {
const urlParams = { tableId, linkId, rowId };
const url = `/api/v1/tables/${urlParams.tableId}/links/${urlParams.linkId}/rows/${urlParams.rowId}`;
const url = `/api/v2/tables/${urlParams.tableId}/links/${urlParams.linkId}/records/${urlParams.rowId}`;
const response = await request(context.app)
.delete(url)
.set('xc-auth', context.token)
@ -310,7 +310,7 @@ function generalDb() {
// read first 4 records
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows`,
url: `/api/v2/tables/${countryTable.id}/records`,
query: {
limit: 4,
},
@ -340,7 +340,7 @@ function generalDb() {
// read first 4 records
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows`,
url: `/api/v2/tables/${countryTable.id}/records`,
query: {
limit: 4,
},
@ -366,7 +366,7 @@ function generalDb() {
// read first 4 records
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows`,
url: `/api/v2/tables/${countryTable.id}/records`,
query: {
limit: 4,
},
@ -381,7 +381,7 @@ function generalDb() {
it('Nested Read - Link to another record', async function () {
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows/1`,
url: `/api/v2/tables/${countryTable.id}/records/1`,
});
// extract LTAR column "City List"
@ -398,7 +398,7 @@ function generalDb() {
});
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows/1`,
url: `/api/v2/tables/${countryTable.id}/records/1`,
});
expect(records.body.Lookup).to.deep.equal(['Kabul']);
});
@ -414,7 +414,7 @@ function generalDb() {
});
const records = await ncAxiosGet({
url: `/api/v1/tables/${countryTable.id}/rows/1`,
url: `/api/v2/tables/${countryTable.id}/records/1`,
});
expect(records.body.Rollup).to.equal(1);
@ -792,7 +792,7 @@ function textBased() {
it('List: invalid ID', async function () {
// Invalid table ID
await ncAxiosGet({
url: `/api/v1/tables/123456789/rows`,
url: `/api/v2/tables/123456789/records`,
status: unauthorizedResponse,
});
@ -919,7 +919,7 @@ function textBased() {
it('Create: invalid ID', async function () {
// Invalid table ID
await ncAxiosPost({
url: `/api/v1/tables/123456789/rows`,
url: `/api/v2/tables/123456789/records`,
status: unauthorizedResponse,
});
@ -946,19 +946,19 @@ function textBased() {
it('Read: all fields', async function () {
const rsp = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/100`,
url: `/api/v2/tables/${table.id}/records/100`,
});
});
it('Read: invalid ID', async function () {
// Invalid table ID
await ncAxiosGet({
url: `/api/v1/tables/123456789/rows/100`,
url: `/api/v2/tables/123456789/records/100`,
status: unauthorizedResponse,
});
// Invalid row ID
await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/1000`,
url: `/api/v2/tables/${table.id}/records/1000`,
status: 404,
});
});
@ -984,7 +984,7 @@ function textBased() {
it('Update: partial', async function () {
const recordBeforeUpdate = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/1`,
url: `/api/v2/tables/${table.id}/records/1`,
});
const rsp = await ncAxiosPatch({
@ -999,7 +999,7 @@ function textBased() {
expect(rsp.body).to.deep.equal([{ Id: 1 }]);
const recordAfterUpdate = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/1`,
url: `/api/v2/tables/${table.id}/records/1`,
});
expect(recordAfterUpdate.body).to.deep.equal({
...recordBeforeUpdate.body,
@ -1031,7 +1031,7 @@ function textBased() {
it('Update: invalid ID', async function () {
// Invalid table ID
await ncAxiosPatch({
url: `/api/v1/tables/123456789/rows`,
url: `/api/v2/tables/123456789/records`,
body: { Id: 100, SingleLineText: 'some text' },
status: unauthorizedResponse,
});
@ -1055,7 +1055,7 @@ function textBased() {
// check that it's gone
await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/1`,
url: `/api/v2/tables/${table.id}/records/1`,
status: 404,
});
});
@ -1066,11 +1066,11 @@ function textBased() {
// check that it's gone
await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/1`,
url: `/api/v2/tables/${table.id}/records/1`,
status: 404,
});
await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/2`,
url: `/api/v2/tables/${table.id}/records/2`,
status: 404,
});
});
@ -1080,7 +1080,7 @@ function textBased() {
it('Delete: invalid ID', async function () {
// Invalid table ID
await ncAxiosDelete({
url: `/api/v1/tables/123456789/rows`,
url: `/api/v2/tables/123456789/records`,
body: { Id: 100 },
status: unauthorizedResponse,
});
@ -1261,7 +1261,7 @@ function numberBased() {
// read record with Id 401
rsp = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/401`,
url: `/api/v2/tables/${table.id}/records/401`,
});
expect(rsp.body).to.deep.equal({ ...records[0], Id: 401 });
@ -1452,7 +1452,7 @@ function selectBased() {
// read record with Id 401
rsp = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/401`,
url: `/api/v2/tables/${table.id}/records/401`,
});
expect(rsp.body).to.deep.equal({ Id: 401, ...records[0] });
@ -1591,7 +1591,7 @@ function dateBased() {
// read record with Id 801
rsp = await ncAxiosGet({
url: `/api/v1/tables/${table.id}/rows/801`,
url: `/api/v2/tables/${table.id}/records/801`,
});
expect(rsp.body).to.deep.equal({ Id: 801, ...records[0] });
@ -2262,7 +2262,7 @@ function linkBased() {
...validParams,
urlParams: { ...validParams.urlParams, rowId: 9999 },
status: 404,
msg: "Row with id '9999' not found",
msg: "Record with id '9999' not found",
});
// Body parameter error
@ -2334,7 +2334,7 @@ function linkBased() {
...validParams,
urlParams: { ...validParams.urlParams, rowId: 9999 },
status: 404,
msg: "Row with id '9999' not found",
msg: "Record with id '9999' not found",
});
// Body parameter error
@ -2406,7 +2406,7 @@ function linkBased() {
...validParams,
urlParams: { ...validParams.urlParams, rowId: 9999 },
status: 404,
msg: "Row with id '9999' not found",
msg: "Record with id '9999' not found",
});
// Query parameter error
@ -2430,9 +2430,11 @@ function linkBased() {
status: 200,
});
// Link List: Invalid query parameter - offset > total rows
// Link List: Invalid query parameter - offset > total records
if (debugMode)
console.log('Link List: Invalid query parameter - offset > total rows');
console.log(
'Link List: Invalid query parameter - offset > total records',
);
await ncAxiosLinkGet({
...validParams,
query: { ...validParams.query, offset: 9999 },
@ -2457,9 +2459,9 @@ function linkBased() {
status: 200,
});
// Link List: Invalid query parameter - limit > total rows
// Link List: Invalid query parameter - limit > total records
if (debugMode)
console.log('Link List: Invalid query parameter - limit > total rows');
console.log('Link List: Invalid query parameter - limit > total records');
await ncAxiosLinkGet({
...validParams,
query: { ...validParams.query, limit: 9999 },

2
packages/nocodb/tests/unit/rest/tests/viewRow.test.ts

@ -672,7 +672,7 @@ function viewRowTests() {
.expect(200);
const row = response.body;
if (row['Title'] !== 'Test') throw new Error('Wrong row title');
if (row['Title'] !== 'Test') throw new Error('Wrong record title');
};
it('Create table row grid', async function () {

2
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -260,7 +260,7 @@ export class ColumnPageObject extends BasePage {
await this.rootPage.locator('li[role="menuitem"]:has-text("Delete"):visible').click();
// pressing on delete column button
await this.rootPage.locator('.ant-modal.active button:has-text("Delete Column")').click();
await this.rootPage.locator('.ant-modal.active button:has-text("Delete Field")').click();
// wait till modal is closed
await this.rootPage.locator('.ant-modal.active').waitFor({ state: 'hidden' });

2
tests/playwright/pages/Dashboard/Grid/Group.ts

@ -122,7 +122,7 @@ export class GroupPageObject extends BasePage {
});
// Click text=Delete Row
await this.rootPage.locator('.ant-dropdown-menu-item:has-text("Delete row")').click();
await this.rootPage.locator('.ant-dropdown-menu-item:has-text("Delete record")').click();
// todo: improve selector
await this.rootPage
.locator('span.ant-dropdown-menu-title-content > nc-base-menu-item')

4
tests/playwright/pages/Dashboard/Grid/index.ts

@ -199,7 +199,7 @@ export class GridPage extends BasePage {
});
// Click text=Delete Row
await this.rootPage.locator('.ant-dropdown-menu-item:has-text("Delete row")').click();
await this.rootPage.locator('.ant-dropdown-menu-item:has-text("Delete record")').click();
// todo: improve selector
await this.rootPage
@ -272,7 +272,7 @@ export class GridPage extends BasePage {
await this.get().locator('[data-testid="nc-check-all"]').nth(0).click({
button: 'right',
});
await this.rootPage.locator('.nc-menu-item:has-text("Update Selected Rows")').click();
await this.rootPage.locator('.nc-menu-item:has-text("Update Selected Records")').click();
await this.dashboard.waitForLoaderToDisappear();
}

Loading…
Cancel
Save