This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from newrelic/ru/patch-2
fix: issue with html tag in catalog documentation
- Loading branch information
Showing
2 changed files
with
30 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
|
||
// Render account IDs as links to the account page in APM | ||
export default class AccountIdRenderer extends React.Component { | ||
static test(node) { | ||
const parent = node.__meta.parent; | ||
|
||
if (!parent) return false; | ||
|
||
const isAccountTypeObject = | ||
parent.__meta.typename === 'Account' || | ||
parent.__meta.typename === 'AccountOutline'; | ||
|
||
return isAccountTypeObject && node.__meta.fieldName === 'id'; | ||
} | ||
|
||
render() { | ||
const accountId = this.props.node.value; | ||
return ( | ||
<a | ||
target="_blank" | ||
rel="noreferrer" | ||
href={`https://rpm.newrelic.com/accounts/${accountId}`} | ||
> | ||
Visit Account {accountId} | ||
</a> | ||
); | ||
} | ||
} |