Follow up user Roles not loading (#16278)

* applied the same role fix too users invite

* added same fix when saving permissions

* Prevent loading users unecessarily on the permission page

* Added proper `deep` query typing

* fixed typing for tests

* apply similar fix for navigation folder
This commit is contained in:
Brainslug
2022-12-13 15:05:14 +01:00
committed by GitHub
parent 57b023493d
commit 807bda3dcb
7 changed files with 41 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { Query } from '@directus/shared/types';
import { NestedDeepQuery } from '@directus/shared/types';
import knex, { Knex } from 'knex';
import { getTracker, MockClient, Tracker } from 'knex-mock-client';
import { cloneDeep } from 'lodash';
@@ -442,7 +442,7 @@ describe('Integration Tests', () => {
});
const response = await itemsService.readOne(rawItems[0].id, {
fields: ['id', 'items.*'],
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as Query },
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as NestedDeepQuery },
});
expect(tracker.history.select.length).toBe(2);
@@ -532,7 +532,7 @@ describe('Integration Tests', () => {
});
const response = await itemsService.readOne(rawItems[0].id, {
fields: ['id', 'items.*'],
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as Query },
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as NestedDeepQuery },
});
expect(tracker.history.select.length).toBe(2);
@@ -625,7 +625,7 @@ describe('Integration Tests', () => {
expect(() =>
itemsService.readOne(rawItems[0].id, {
fields: ['id', 'items.*'],
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as Query },
deep: { items: { _filter: { title: { _eq: childItems[0].title } } } as NestedDeepQuery },
})
).rejects.toThrow("You don't have permission to access this.");
expect(tracker.history.select.length).toBe(0);