Browse Source

0.90.2 Pre-release (#1733)

* fix: unsafe repository issue in actions/checkout

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* fix: remove extra space

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* docs: fix delete function name

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* fix: remove duplicate and add missing delete api (#1731)

Signed-off-by: mertmit <mertmit99@gmail.com>

* fix: extract correct model id on audit export and ignore table audit if missing meta (#1732)

re #1722

Signed-off-by: Pranav C <pranavxc@gmail.com>

Co-authored-by: Wing-Kam Wong <wingkwong.code@gmail.com>
Co-authored-by: mertmit <mertmit99@gmail.com>
pull/1749/head
Pranav C 3 years ago committed by GitHub
parent
commit
86a2e20166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .github/workflows/sync-to-develop.yml
  2. 2
      packages/noco-docs/content/en/developer-resources/rest-apis.md
  3. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts
  4. 29
      packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts
  5. 16
      packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

5
.github/workflows/sync-to-develop.yml

@ -9,6 +9,11 @@ jobs:
sync-to-develop:
runs-on: ubuntu-latest
steps:
# See https://github.com/actions/checkout/issues/766
- name: Workaround for unsafe repository issue
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Checkout
uses: actions/checkout@v1

2
packages/noco-docs/content/en/developer-resources/rest-apis.md

@ -50,7 +50,7 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| Data | Post | dbTableRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName} |
| Data | Get | dbTableRow | read | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Patch | dbTableRow | update | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Delete| dbTableRow | modelDelete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Delete| dbTableRow | delete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Get | dbTableRow | count | /api/v1/db/data/{orgs}/{projectName}/{tableName}/count |
| Data | Get | dbViewRow | list | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |
| Data | Post | dbViewRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |

4
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -152,9 +152,9 @@ router.patch(
'/api/v1/db/data/:orgs/:projectName/:tableName/:rowId',
ncMetaAclMw(dataUpdate, 'dataUpdate')
);
router.patch(
router.delete(
'/api/v1/db/data/:orgs/:projectName/:tableName/:rowId',
ncMetaAclMw(dataUpdate, 'dataUpdate')
ncMetaAclMw(dataDelete, 'dataDelete')
);
router.get(

29
packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts

@ -8,6 +8,8 @@ import ncProjectUpgraderV2_0090000 from './jobs/ncProjectUpgraderV2_0090000';
const log = debug('nc:upgrader');
import { Tele } from 'nc-help';
import boxen from 'boxen';
export interface NcUpgraderCtx {
ncMeta: NcMetaIO;
}
@ -100,19 +102,40 @@ export default class NcUpgrader {
});
} catch (e) {
await ctx.ncMeta.rollback(e);
console.log('Error', e);
Tele.emit('evt', {
evt_type: 'appMigration:failed',
from: oldVersion,
to: process.env.NC_VERSION,
msg: e.message
msg: e.message,
err: e?.stack
?.split?.('\n')
.slice(0, 2)
.join('\n')
});
console.log(getUpgradeErrorLog(e, oldVersion, process.env.NC_VERSION));
throw e;
}
}
private static log(str, ...args): void {
log(`${str}`, ...args);
}
}
function getUpgradeErrorLog(e: Error, oldVersion: string, newVersion: string) {
const errorTitle = `Migration from ${oldVersion} to ${newVersion} failed`;
return boxen(
`Error
-----
${e.stack}
private;
Please raise an issue in our github by using following link :
https://github.com/nocodb/nocodb/issues/new?labels=Type%3A%20Bug&template=bug_report.md
Or contact us in our Discord community by following link :
https://discord.gg/5RgZmkW ( message @o1lab, @pranavxc or @wingkwong )`,
{ title: errorTitle, padding: 1, borderColor: 'yellow' }
);
}

16
packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

@ -1282,11 +1282,21 @@ async function migrateAutitLog(
};
if (audit.model_name) {
insertObj.fk_model_id = (
const model =
ctx.objModelAliasRef?.[audit.project_id]?.[audit.model_name] ||
ctx.objModelRef?.[audit.project_id]?.[audit.model_name] ||
ctx.metas?.find(m => m.id == audit.model_id)
)?.id;
// extract model by using model_id property from audit
ctx.objModelRef?.[audit.project_id]?.[
ctx.metas?.find(m => m.id == audit.model_id)?.title
] ||
ctx.objModelAliasRef?.[audit.project_id]?.[
ctx.metas?.find(m => m.id == audit.model_id)?.alias
];
// if model is not found skip audit insertion
if (!model) continue;
insertObj.fk_model_id = model.id;
}
await Audit.insert(insertObj, ncMeta);

Loading…
Cancel
Save