Skip to content

Commit

Permalink
Add report scope (#181)
Browse files Browse the repository at this point in the history
* Add report scope

* Rename fix

* Change migration

* Remove config
  • Loading branch information
artemipanchuk authored Sep 10, 2024
1 parent 851ca29 commit 675d401
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/const/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const ALLOWED_SCOPE_VALUES = [
'widget',
'config',
'presentation',
'report',
];

export const ID_VARIABLES = [
Expand Down
13 changes: 13 additions & 0 deletions src/db/migrations/20240910124901_rename_presentation_to_report.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Knex} from 'knex';

export async function up(knex: Knex): Promise<void> {
return knex.raw(`
ALTER TYPE scope RENAME VALUE 'presentation' TO 'report';
`);
}

export async function down(knex: Knex): Promise<void> {
return knex.raw(`
ALTER TYPE scope RENAME VALUE 'report' TO 'presentation';
`);
}
2 changes: 1 addition & 1 deletion src/services/entry/actions/create-in-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const validateCreateEntryInWorkbook = makeSchemaValidator({
},
scope: {
type: 'string',
enum: ['connection', 'dataset', 'dash', 'widget', 'presentation'],
enum: ['connection', 'dataset', 'dash', 'widget', 'presentation', 'report'],
},
type: {
type: 'string',
Expand Down

0 comments on commit 675d401

Please sign in to comment.