render single page dashboards
Signed-off-by: mufaddal motiwala <mufaddalmm.52@gmail.com>
This commit is contained in:
@@ -73,9 +73,18 @@ export class NewRelicDashboardClient implements NewRelicDashboardApi {
|
||||
const DashboardEntityList = await this.callApi<DashboardEntity>(
|
||||
getDashboardParentGuidQuery,
|
||||
{
|
||||
query: `parentId ='${guid}'`,
|
||||
query: `id ='${guid}' OR parentId ='${guid}'`,
|
||||
},
|
||||
);
|
||||
if (
|
||||
DashboardEntityList &&
|
||||
DashboardEntityList?.data?.actor.entitySearch.results.entities?.length > 1
|
||||
) {
|
||||
DashboardEntityList.data.actor.entitySearch.results.entities =
|
||||
DashboardEntityList?.data.actor.entitySearch.results.entities.filter(
|
||||
entity => entity?.dashboardParentGuid !== null,
|
||||
);
|
||||
}
|
||||
return {
|
||||
getDashboardEntity: DashboardEntityList!,
|
||||
};
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export const getDashboardParentGuidQuery =
|
||||
'query ($query: String) {\n actor {\n entitySearch(query: $query) {\n results {\n entities {\n name\n ... on DashboardEntityOutline {\n name\n guid\n }\n permalink\n }\n }\n }\n }\n}\n';
|
||||
'query ($query: String) {\n actor {\n entitySearch(query: $query) {\n results {\n entities {\n name\n ... on DashboardEntityOutline {\n name\n dashboardParentGuid\n guid\n }\n permalink\n }\n }\n }\n }\n}\n';
|
||||
|
||||
@@ -27,6 +27,7 @@ export type DashboardEntity = {
|
||||
};
|
||||
|
||||
export type ResultEntity = {
|
||||
dashboardParentGuid: string;
|
||||
guid: string;
|
||||
permalink: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user