mirror of
https://github.com/directus/directus.git
synced 2026-02-07 00:15:07 -05:00
* Move permissions extraction to accountability
* Fix permissions retrieval for public user
* Fetch user / role context in permissions middleware
* Remove unnecessary parseFilter
* Rename schemaCache to systemCache
* Add permissions caching
* Add system cache invalidation on permission changes
* Improve caching perf by reducing scope
* Add note to docs
* Clarify compatibility with conditional fields/filters
* Fix lint warning
* Allow nested vars in system-filter-input
* Add custom getter function that resolves arrays
* Add is-dynamic-variable util
* Export new util
* Cleanup parse filter
* Fix build
* Move debounce up to use-items
* Remove unused prop
* 🧹
* Fix input pattern usage w/ vars
* Remove debounce from search-input, increase throttle
21 lines
468 B
TypeScript
21 lines
468 B
TypeScript
import { isDynamicVariable } from './is-dynamic-variable';
|
|
|
|
const tests: [string, boolean][] = [
|
|
['$NOW', true],
|
|
['$NOW(- 1 year)', true],
|
|
['test', false],
|
|
['$CUSTOM', false],
|
|
['$CURRENT_USER', true],
|
|
['$CURRENT_ROLE', true],
|
|
['$CURRENT_USER.role.name', true],
|
|
['$CURRENT_ROLE.users.id', true],
|
|
];
|
|
|
|
describe('is extension type', () => {
|
|
for (const [value, result] of tests) {
|
|
it(value, () => {
|
|
expect(isDynamicVariable(value)).toBe(result);
|
|
});
|
|
}
|
|
});
|