Skip to content

Commit

Permalink
fix(cli): map id of settings.storage_default_folder (#104)
Browse files Browse the repository at this point in the history
* refactor: rename dump

* refactor: update pushWithDependencies

* test(e2e): reproduce bug

* test(e2e): add test for default role

* test(e2e): fix tests

* fix(cli): map id of settings.storage_default_folder

* chore(e2e): enable all tests
  • Loading branch information
EdouardDem authored Sep 22, 2024
1 parent 0ef775b commit bc060b1
Show file tree
Hide file tree
Showing 80 changed files with 505 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LOGGER } from '../../../constants';
import { SETTINGS_COLLECTION } from './constants';
import { DirectusSettings } from './interfaces';
import { RolesIdMapperClient } from '../roles';
import { FoldersIdMapperClient } from '../folders';

@Service()
export class SettingsDataMapper extends DataMapper<DirectusSettings> {
Expand All @@ -22,6 +23,7 @@ export class SettingsDataMapper extends DataMapper<DirectusSettings> {
protected idMappers: IdMappers<DirectusSettings, 'public_registration_role'> =
{
public_registration_role: Container.get(RolesIdMapperClient),
storage_default_folder: Container.get(FoldersIdMapperClient),
};

constructor(@Inject(LOGGER) baseLogger: pino.Logger) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name": "derideo vulticulus",
"parent": null,
"_syncId": "92d60c0c-30b8-49d9-bd63-11008fa652af"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"name": "Administrator",
"icon": "verified",
"description": "$t:admin_description",
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"roles": [
{
"role": "_sync_default_admin_role",
"sort": null
}
],
"_syncId": "_sync_default_admin_policy"
},
{
"name": "$t:public_label",
"icon": "public",
"description": "$t:public_description",
"ip_access": null,
"enforce_tfa": false,
"admin_access": false,
"app_access": false,
"roles": [
{
"role": null,
"sort": 1
}
],
"_syncId": "_sync_default_public_policy"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"name": "Administrator",
"icon": "verified",
"description": "$t:admin_description",
"parent": null,
"_syncId": "_sync_default_admin_role"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
{
"project_name": "animadverto",
"project_color": "#6644FF",
"public_note": "Traho cognomen arcus abduco excepturi.",
"auth_login_attempts": 16,
"auth_password_policy": "/^.{8,}$/",
"storage_asset_transform": "none",
"storage_asset_presets": null,
"custom_css": "body {\n --v-button-background-color: #6644FF !important;\n}\n",
"storage_default_folder": "92d60c0c-30b8-49d9-bd63-11008fa652af",
"basemaps": null,
"mapbox_key": "p0l7oxn7yEUmthIaWYH8LKkyAI48fVg3",
"module_bar": null,
"project_descriptor": "Test project",
"default_language": "en-US",
"custom_aspect_ratios": null,
"default_appearance": "light",
"default_theme_light": "Directus Default",
"theme_light_overrides": {
"borderRadius": "2px"
},
"default_theme_dark": null,
"theme_dark_overrides": {
"borderRadius": "1px"
},
"report_error_url": null,
"report_bug_url": null,
"report_feature_url": null,
"public_registration": false,
"public_registration_verify_email": true,
"public_registration_role": null,
"public_registration_email_filter": null,
"_syncId": "26aa9eb5-11af-44cb-9f5b-073c55b57974"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"collection": "directus_sync_id_map",
"meta": null,
"schema": {
"name": "directus_sync_id_map"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "created_at",
"type": "dateTime",
"meta": null,
"schema": {
"name": "created_at",
"table": "directus_sync_id_map",
"data_type": "datetime",
"default_value": "CURRENT_TIMESTAMP",
"max_length": null,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": true,
"is_unique": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "id",
"type": "integer",
"meta": null,
"schema": {
"name": "id",
"table": "directus_sync_id_map",
"data_type": "integer",
"default_value": null,
"max_length": null,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": false,
"is_unique": false,
"is_primary_key": true,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": true,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "local_id",
"type": "string",
"meta": null,
"schema": {
"name": "local_id",
"table": "directus_sync_id_map",
"data_type": "varchar",
"default_value": null,
"max_length": 255,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": false,
"is_unique": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "sync_id",
"type": "string",
"meta": null,
"schema": {
"name": "sync_id",
"table": "directus_sync_id_map",
"data_type": "varchar",
"default_value": null,
"max_length": 255,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": false,
"is_unique": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "table",
"type": "string",
"meta": null,
"schema": {
"name": "table",
"table": "directus_sync_id_map",
"data_type": "varchar",
"default_value": null,
"max_length": 255,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": false,
"is_unique": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": 1,
"directus": "11.1.0",
"vendor": "sqlite"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"name": "Administrator",
"icon": "verified",
"description": "$t:admin_description",
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"roles": [
{
"role": "_sync_default_admin_role",
"sort": null
}
],
"_syncId": "_sync_default_admin_policy"
},
{
"name": "$t:public_label",
"icon": "public",
"description": "$t:public_description",
"ip_access": null,
"enforce_tfa": false,
"admin_access": false,
"app_access": false,
"roles": [
{
"role": null,
"sort": 1
}
],
"_syncId": "_sync_default_public_policy"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "Administrator",
"icon": "verified",
"description": "$t:admin_description",
"parent": null,
"_syncId": "_sync_default_admin_role"
},
{
"name": "capto",
"icon": "alarm_off",
"description": "Agnosco decipio tandem utor maxime calco sol enim vinculum vulgus tolero demo cogo.",
"parent": null,
"_syncId": "52183adc-3e8e-4746-abd2-ee8dfc58efd5"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
{
"project_name": "animadverto",
"project_color": "#6644FF",
"public_note": "Traho cognomen arcus abduco excepturi.",
"auth_login_attempts": 16,
"auth_password_policy": "/^.{8,}$/",
"storage_asset_transform": "none",
"storage_asset_presets": null,
"custom_css": "body {\n --v-button-background-color: #6644FF !important;\n}\n",
"storage_default_folder": null,
"basemaps": null,
"mapbox_key": "p0l7oxn7yEUmthIaWYH8LKkyAI48fVg3",
"module_bar": null,
"project_descriptor": "Test project",
"default_language": "en-US",
"custom_aspect_ratios": null,
"default_appearance": "light",
"default_theme_light": "Directus Default",
"theme_light_overrides": {
"borderRadius": "2px"
},
"default_theme_dark": null,
"theme_dark_overrides": {
"borderRadius": "1px"
},
"report_error_url": null,
"report_bug_url": null,
"report_feature_url": null,
"public_registration": false,
"public_registration_verify_email": true,
"public_registration_role": "52183adc-3e8e-4746-abd2-ee8dfc58efd5",
"public_registration_email_filter": null,
"_syncId": "26aa9eb5-11af-44cb-9f5b-073c55b57974"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"collection": "directus_sync_id_map",
"meta": null,
"schema": {
"name": "directus_sync_id_map"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collection": "directus_sync_id_map",
"field": "created_at",
"type": "dateTime",
"meta": null,
"schema": {
"name": "created_at",
"table": "directus_sync_id_map",
"data_type": "datetime",
"default_value": "CURRENT_TIMESTAMP",
"max_length": null,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": true,
"is_unique": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Loading

0 comments on commit bc060b1

Please sign in to comment.