mirror of
https://github.com/directus/directus.git
synced 2026-01-28 05:18:13 -05:00
0ce2ef244dbddea8748dec94de018f7abfd8a474
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2983e61870 |
The Great TypeScript Modernization Program Season 3 Episode 6: The Big One (#18014)
* Step 1 * Step 2 * False sense of confidence * Couple more before dinner * Update schema package * Update format-title * Upgrade specs file * Close * Replace ts-node-dev with tsx, and various others * Replace lodash with lodash-es * Add lodash-es types * Update knex import * More fun is had * FSE * Consolidate repos * Various tweaks and fixes * Fix specs * Remove dependency on knex-schema-inspector * Fix wrong imports of inspector * Move shared exceptions to new package * Move constants to separate module * Move types to new types package * Use directus/types * I believe this is no longer needed * [WIP] Start moving utils to esm * ESMify Shared * Move shared utils to @directus/utils * Use @directus/utils instead of @directus/shared/utils * It runs! * Use correct schemaoverview type * Fix imports * Fix the thing * Start on new update-checker lib * Use new update-check package * Swap out directus/shared in app * Pushing through the last bits now * Dangerously make extensions SDK ESM * Use @directus/types in tests * Copy util function to test * Fix linter config * Add missing import * Hot takes * Fix build * Curse these default exports * No tests in constants * Add tests * Remove tests from types * Add tests for exceptions * Fix test * Fix app tests * Fix import in test * Fix various tests * Fix specs export * Some more tests * Remove broken integration tests These were broken beyond repair.. They were also written before we really knew what we we're doing with tests, so I think it's better to say goodbye and start over with these * Regenerate lockfile * Fix imports from merge * I create my own problems * Make sharp play nice * Add vitest config * Install missing blackbox dep * Consts shouldn't be in types tsk tsk tsk tsk * Fix type/const usage in extensions-sdk * cursed.default * Reduce circular deps * Fix circular dep in items service * vvv * Trigger testing for all vendors * Add workaround for rollup * Prepend the file protocol for the ESM loader to be compatible with Windows "WARN: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'" * Fix postgres * Schema package updates Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> * Resolve cjs/mjs extensions * Clean-up eslint config * fixed extension concatination * using string interpolation for consistency * Revert MySQL optimisation * Revert testing for all vendors * Replace tsx with esbuild-kit/esm-loader Is a bit faster and we can rely on the built-in `watch` and `inspect` functionalities of Node.js Note: The possibility to watch other files (.env in our case) might be added in the future, see https://github.com/nodejs/node/issues/45467 * Use exact version for esbuild-kit/esm-loader * Fix import --------- Co-authored-by: ian <licitdev@gmail.com> Co-authored-by: Brainslug <tim@brainslug.nl> Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> |
||
|
|
f1a8e0446f |
Fix duplicated results and functions in nested filters (#14798)
* Speed query up by reusing existing aliases which reduces table joins * Use subquery in top level m2o to remove duplicates * Fix linting * Apply distinct on primary key field in subqueries * Use distinct instead as there are only primary keys * Apply subquery on top level * Try remove sub sub query * Test if working for all vendors * Add support for _none and _some * Use subquery only when field depth > 1 * Add tests * Use original table names for columns with functions (#14690) * Use original table names for columns with functions * Extract filter function path parsing as shared util * Fix filter function path when adding node * Pass the originalCollectionName into filter functions * Update unit test * Replace functions within deep GraphQL * Fix invalid operator error for _none and _some * Add filter function tests * Revert triggering for all vendors * Simplify aliasMap * Replace functions in filter within GraphQL aggregate query * Add API support for filtering of alias field * Mark schema as optional * Shift logical operators upwards * Separate recursive parseFilter * Rework shifting of logical operators * Error on invalid usage of _none and _some * Use inner join to preserve sort order * Run tests for all vendors * Reuse aliasMap for sort and filter * Sort on top level query * Remove unnecessary limit on wrapper query * Refactor applyQuery options * Remove duplicates from nested multi relational sort * Fix offset in MSSQL requiring OrderBy * Disable schema cache * Use inner query only for nested sort or multi relational filter * Fix MSSQL duplicate order column * Use inner query only for multi relational * Additional integration tests * Order within partition for multi relational sorts * Rename to directus_row_number * Fix unit test * Add base sort and filter tests * Fix Oracle uppercased rowNumber column * Fix unit test * Fix top level query sort with function * Parse functions in inner query * Increase clarity with knex.ref() * Remove sort filter for top level primary key * Fix unit test * Bypass queries with groupBy * Add collection to aliasMap to fix functions in nested sort * Fix multi relational sort with functions * Add tests for filter and sort with functions * Fix accidental deletion of brackets * Fix top level alias filter node interface * Update M2M sort tests * Add M2A tests * Cast m2a primary key as varchar2 for oracle * Enable filtering tests for M2A * Fix prototype polluting assignment in aliasMap * Remove unnecessary currentKey * Simplify code to increase readability Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * Fix linting and missing 'this' error * Revert optional chaining * Add mysql5 to tests * Fix mysql5 missing rowNumber() * Overcome indexing delays in MySQL5 * Verify MySQL5 sorting is in order as the result count varies between runs * Skip joining when sorting field already exists * Simplify variable assignment Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> * Fix linting * Reduce duplicate logic with vars * Transform _func fields in GraphQL only for valid functions * Fix unit test * Fix unsupported date_part() in CrDB Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Roger Stringer <roger@directus.io> Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> |
||
|
|
8d1966ab04 |
Blackbox testing (#13200)
* Add black box tests * Revert docker compose file * Update workflow * Try use workflow from dev repo * Increase seedDB() timeout * Disable other checks for now * Change DB sequence * Update jest moduleNameMapper * Update workflow's docker-compose.yml path * Slice array first * Remove differentiation of status code * Delete field only after foreign key constraints are removed * Add checks for different types of primary key * Test global query filter for all field types * Increase timeout for m2o seeding * Add case insensitive string operators * Update filter check to run on relational fields * Enable time field checks * Add seeded random and fix relational seeding * Add casting for integer and bigInteger * Minor fixes * Reduce bigInt values * Separate seeding of DB structure from values * Add primaryKey seeding function * Use automatic IDs except for string pk * Try fix ci * Update package-lock.json * Update common.test for concealed user tokens * Use dynamic field type for m2o.test relational fields * Temporary disable missing nicontains for string type * Add support for alias type filtering * Fix relational filter operator checks * Add initial o2m test * Remove integer pk limit * Add empty checks for string and uuid null * Limit generated integer value to 4 bytes * Patch timezone tests for MSSQL * Remove sample query filter test * Fix timezone test for sqlite * Fix MSSQL uuids * Fix MSSQL timestamp inaccuracy * Cast datetime schema to milliseconds for comparison * Fix MySQL / Maria timestamp inaccuracy * Fix MySQL / Maria between operator inconsistency for float type * Fix missing time datatype in Oracle * Skip filter testing on Oracle * Enable o2m filter tests for other collections * Run tests only on SQLite for PRs unless the Full Tests label exists * Try fix actions * Refactor github actions * Update tests flow setup to use getURL() * Start postgres docker * Reinstate package-lock * Fix geometry test * Remove .gitkeep files * Add todo.md * Rename black box to blackbox Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> |