Browse Source

fix: update bt, hm and mm column names

- BT - `TableRead` => `Table`
- HM - `TableList` => `Table List`
- MM - `TableMMList` => `Table List`

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2482/head
Pranav C 2 years ago
parent
commit
2f5f1ef872
  1. 8
      packages/nocodb/src/__tests__/restv2.test.ts
  2. 8
      packages/nocodb/src/lib/meta/api/columnApis.ts
  3. 6
      packages/nocodb/src/lib/meta/api/metaDiffApis.ts
  4. 4
      packages/nocodb/src/lib/meta/api/projectApis.ts
  5. 2
      scripts/cypress/integration/common/1a_table_operations.js
  6. 4
      scripts/cypress/integration/common/1c_sql_view.js
  7. 4
      scripts/cypress/integration/common/2a_table_with_belongs_to_colulmn.js
  8. 4
      scripts/cypress/integration/common/2b_table_with_m2m_column.js
  9. 2
      scripts/cypress/integration/common/4c_form_view_detailed.js
  10. 6
      scripts/cypress/integration/common/4d_table_view_grid_locked.js
  11. 2
      scripts/cypress/integration/common/4e_form_view_share.js
  12. 2
      scripts/cypress/integration/common/5a_user_role.js
  13. 4
      scripts/cypress/integration/common/6b_downloadCsv.js
  14. 2
      scripts/cypress/integration/common/6f_attachments.js

8
packages/nocodb/src/__tests__/restv2.test.ts

@ -209,7 +209,7 @@ describe('Noco v2 Tests', () => {
type: UITypes.Rollup,
alias: 'filmCount',
rollupColumn: 'FilmId',
relationColumn: 'FilmList',
relationColumn: 'Film List',
rollupFunction: 'count'
}
];
@ -413,7 +413,7 @@ describe('Noco v2 Tests', () => {
type: UITypes.Lookup,
alias: 'filmNames',
lookupColumn: 'Title',
relationColumn: 'FilmList'
relationColumn: 'Film List'
};
request(app)
.post(`/nc/${projectId}/generate`)
@ -1335,7 +1335,7 @@ describe('Noco v2 Tests', () => {
type: UITypes.Lookup,
alias: 'filmIds',
lookupColumn: 'FilmId',
relationColumn: 'FilmList'
relationColumn: 'Film List'
},
{
table: 'actor',
@ -1406,7 +1406,7 @@ describe('Noco v2 Tests', () => {
type: UITypes.Lookup,
alias: 'actorsCountList',
lookupColumn: 'actorsCount',
relationColumn: 'FilmList'
relationColumn: 'Film List'
},
{
table: 'actor',

8
packages/nocodb/src/lib/meta/api/columnApis.ts

@ -57,7 +57,7 @@ async function createHmAndBtColumn(
{
const title = getUniqueColumnAliasName(
await child.getColumns(),
type === 'bt' ? alias : `${parent.title}Read`
type === 'bt' ? alias : `${parent.title}`
);
await Column.insert<LinkToAnotherRecordColumn>({
title,
@ -79,7 +79,7 @@ async function createHmAndBtColumn(
{
const title = getUniqueColumnAliasName(
await parent.getColumns(),
type === 'hm' ? alias : `${child.title}List`
type === 'hm' ? alias : `${child.title} List`
);
await Column.insert({
title,
@ -427,7 +427,7 @@ export async function columnAdd(req: Request, res: Response<TableType>) {
await Column.insert({
title: getUniqueColumnAliasName(
await child.getColumns(),
`${parent.title}List`
`${parent.title} List`
),
uidt: UITypes.LinkToAnotherRecord,
type: 'mm',
@ -447,7 +447,7 @@ export async function columnAdd(req: Request, res: Response<TableType>) {
await Column.insert({
title: getUniqueColumnAliasName(
await parent.getColumns(),
req.body.title ?? `${child.title}List`
req.body.title ?? `${child.title} List`
),
uidt: UITypes.LinkToAnotherRecord,

6
packages/nocodb/src/lib/meta/api/metaDiffApis.ts

@ -671,7 +671,7 @@ export async function metaDiffSync(req, res) {
if (change.relationType === RelationTypes.BELONGS_TO) {
const title = getUniqueColumnAliasName(
childModel.columns,
`${parentModel.title || parentModel.table_name}Read`
`${parentModel.title || parentModel.table_name}`
);
await Column.insert<LinkToAnotherRecordColumn>({
uidt: UITypes.LinkToAnotherRecord,
@ -785,7 +785,7 @@ export async function extractAndGenerateManyToManyRelations(
await Column.insert<LinkToAnotherRecordColumn>({
title: getUniqueColumnAliasName(
modelA.columns,
`${modelB.title}List`
`${modelB.title} List`
),
fk_model_id: modelA.id,
fk_related_model_id: modelB.id,
@ -803,7 +803,7 @@ export async function extractAndGenerateManyToManyRelations(
await Column.insert<LinkToAnotherRecordColumn>({
title: getUniqueColumnAliasName(
modelB.columns,
`${modelA.title}List`
`${modelA.title} List`
),
fk_model_id: modelB.id,
fk_related_model_id: modelA.id,

4
packages/nocodb/src/lib/meta/api/projectApis.ts

@ -215,7 +215,7 @@ async function populateMeta(base: Base, project: Project): Promise<any> {
uidt: UITypes.LinkToAnotherRecord,
type: 'hm',
hm,
title: `${hm.title}List`
title: `${hm.title} List`
};
}),
...belongsTo.map(bt => {
@ -230,7 +230,7 @@ async function populateMeta(base: Base, project: Project): Promise<any> {
uidt: UITypes.LinkToAnotherRecord,
type: 'bt',
bt,
title: `${bt.rtitle}Read`
title: `${bt.rtitle}`
};
})
];

2
scripts/cypress/integration/common/1a_table_operations.js

@ -92,7 +92,7 @@ export const genTest = (apiType, dbType) => {
cy.openTableTab("Country", 25);
mainPage
.getCell("CityList", 1)
.getCell("City List", 1)
.find(".name")
.contains("Kabul")
.should("exist");

4
scripts/cypress/integration/common/1c_sql_view.js

@ -139,8 +139,8 @@ export const genTest = (apiType, dbType) => {
cy.openViewsTab("CustomerList", 25);
cy.closeViewsTab("CustomerList");
cy.openViewsTab("FilmList", 25);
cy.closeViewsTab("FilmList");
cy.openViewsTab("Film List", 25);
cy.closeViewsTab("Film List");
cy.openViewsTab("SalesByFilmCategory", 16);
cy.closeViewsTab("SalesByFilmCategory");

4
scripts/cypress/integration/common/2a_table_with_belongs_to_colulmn.js

@ -23,12 +23,12 @@ export const genTest = (apiType, dbType) => {
it("Expand belongs-to column", () => {
// expand first row
cy.get('td[data-col="CityList"] div:visible', {
cy.get('td[data-col="City List"] div:visible', {
timeout: 12000,
})
.first()
.click();
cy.get('td[data-col="CityList"] div .mdi-arrow-expand:visible')
cy.get('td[data-col="City List"] div .mdi-arrow-expand:visible')
.first()
.click();

4
scripts/cypress/integration/common/2b_table_with_m2m_column.js

@ -23,10 +23,10 @@ export const genTest = (apiType, dbType) => {
it("Expand m2m column", () => {
// expand first row
cy.get('td[data-col="FilmList"] div', { timeout: 12000 })
cy.get('td[data-col="Film List"] div', { timeout: 12000 })
.first()
.click({ force: true });
cy.get('td[data-col="FilmList"] div .mdi-arrow-expand')
cy.get('td[data-col="Film List"] div .mdi-arrow-expand')
.first()
.click({ force: true });

2
scripts/cypress/integration/common/4c_form_view_detailed.js

@ -119,7 +119,7 @@ export const genTest = (apiType, dbType) => {
.should("exist");
cy.get(".nc-field-wrapper")
.eq(1)
.contains("CityList")
.contains("City List")
.should("exist");
cy.get(".nc-field-wrapper")
.eq(2)

6
scripts/cypress/integration/common/4d_table_view_grid_locked.js

@ -77,18 +77,18 @@ export const genTest = (apiType, dbType) => {
// check if add/ expand options available for 'has many' column type
mainPage
.getCell("CityList", 1)
.getCell("City List", 1)
.click()
.find("button.mdi-plus")
.should(`${vString}exist`);
mainPage
.getCell("CityList", 1)
.getCell("City List", 1)
.click()
.find("button.mdi-arrow-expand")
.should(`${vString}exist`);
// update row option (right click) - should not be available for Lock view
mainPage.getCell("CityList", 1).rightclick();
mainPage.getCell("City List", 1).rightclick();
cy.get(".menuable__content__active").should(
`${vString}be.visible`
);

2
scripts/cypress/integration/common/4e_form_view_share.js

@ -131,7 +131,7 @@ export const genTest = (apiType, dbType) => {
// all fields, barring removed field should exist
cy.get('[title="City"]').should("exist");
cy.get('[title="LastUpdate"]').should("exist");
cy.get('[title="CountryRead"]').should("exist");
cy.get('[title="Country"]').should("exist");
cy.get('[title="AddressList"]').should("not.exist");
// order of LastUpdate & City field is retained

2
scripts/cypress/integration/common/5a_user_role.js

@ -209,7 +209,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`City,AddressList,CountryRead`,
`City,AddressList,Country`,
`A Corua (La Corua),939 Probolinggo Loop,Spain`,
`Abha,733 Mandaluyong Place,Saudi Arabia`,
`Abu Dhabi,535 Ahmadnagar Manor,United Arab Emirates`,

4
scripts/cypress/integration/common/6b_downloadCsv.js

@ -31,7 +31,7 @@ export const genTest = (apiType, dbType) => {
// `Angola,"Benguela, Namibe"`,
// ];
let storedRecords = [
['Country','CityList'],
['Country','City List'],
['Afghanistan','Kabul'],
['Algeria','Skikda', 'Bchar', 'Batna'],
['American Samoa','Tafuna'],
@ -41,7 +41,7 @@ export const genTest = (apiType, dbType) => {
// if (isPostgres()) {
// // order of second entry is different
// storedRecords = [
// `Country,CityList`,
// `Country,City List`,
// `Afghanistan,Kabul`,
// `Algeria,"Skikda, Bchar, Batna"`,
// `American Samoa,Tafuna`,

2
scripts/cypress/integration/common/6f_attachments.js

@ -113,7 +113,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
let storedRecords = [
`Country,CityList,testAttach`,
`Country,City List,testAttach`,
`Afghanistan,Kabul,1.json(http://localhost:8080/download/p_h0wxjx5kgoq3w4/vw_skyvc7hsp9i34a/2HvU8R.json)`,
];

Loading…
Cancel
Save