Expressions: Fix expression load with legacy UID -100 (#65950)

* Fix expressions instance settings loading

* Introduce a new method to get name or uid

* Update public/app/features/plugins/datasource_srv.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Move getNameOrUid method outside the class

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
ismail simsek
2023-04-12 16:33:31 +02:00
committed by GitHub
co-authored by Ryan McKinley
parent 3224b4c8f0
commit d4bd024951
4 changed files with 86 additions and 34 deletions
@@ -307,6 +307,8 @@ describe('DataSourceWithBackend', () => {
expect(isExpressionReference('Expression')).toBeTruthy(); // Name
expect(isExpressionReference({ type: '__expr__' })).toBeTruthy();
expect(isExpressionReference({ type: '-100' })).toBeTruthy();
expect(isExpressionReference(null)).toBeFalsy();
expect(isExpressionReference(undefined)).toBeFalsy();
});
});
});