This guide shows you how to integrate functionality between Backstage plugins using both frontend (ApiRef) and backend (ServiceRef) approaches following the latest Backstage patterns.
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
pragma solidity ^0.4.19; | |
import 'zeppelin-solidity/contracts/token/ERC20/MintableToken.sol'; | |
contract BITTokenTest is MintableToken { | |
string public name = "BITTokenTest"; | |
string public symbol = "BIT"; | |
uint8 public decimals = 18; | |
} |
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
/* eslint-disable class-methods-use-this */ | |
type UserProfile = { | |
name: string; | |
avatarUrl: string; | |
balance: number; | |
}; | |
abstract class AbstractWallet { | |
// Returns a promise that resolves an array of strings, each string is an origin | |
async getOrdinals(): Promise<string[]> { |
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
import { GraphQLRelayService } from './GraphQLRelayService'; | |
import superagent, { Response } from 'superagent'; | |
import { jest } from '@jest/globals'; | |
jest.mock('superagent'); | |
interface TokenResponse { | |
body: { | |
access_token: string; | |
expires_in: number; |
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
https://www.youtube.com/playlist?list=PLj6h78yzYM2O3YsKnBocZZPv0M6f-wLu5 |
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
import { | |
CatalogProcessor, | |
CatalogProcessorEmit, | |
CatalogProcessorParser, | |
processingResult, | |
} from '@backstage/plugin-catalog-backend'; | |
import { | |
Entity, | |
parseEntityRef, | |
} from '@backstage/catalog-model'; |
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
// package.json | |
{ | |
"name": "use-entity-client-access-check", | |
"version": "1.0.0", | |
"main": "dist/index.js", | |
"scripts": { | |
"build": "tsc", | |
"test": "jest" | |
}, | |
"dependencies": { |
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
/** | |
* Copyright ... | |
* (License header) | |
*/ | |
export const defaultPreviewTemplate = `# Edit the template parameters below to see how they will render in the scaffolder form UI | |
parameters: | |
- title: Fill in some steps | |
ui:ObjectFieldTemplate: TwoColumn | |
required: |
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
import React from 'react'; | |
import { | |
TemplateCard, | |
type TemplateCardProps, | |
} from '@backstage/plugin-scaffolder-react'; | |
import { Typography, makeStyles } from '@material-ui/core'; | |
const useStyles = makeStyles(theme => ({ | |
annotation: { | |
marginTop: theme.spacing(1), |
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
I'll update both test files to follow modern React Testing Library best practices and linting rules. Here's the improved version of both tests: | |
```xml | |
<code_changes> | |
<changed_files> | |
<file> | |
<file_summary>Update CardHeader test to follow RTL best practices</file_summary> | |
<file_operation>UPDATE</file_operation> | |
<file_path>/plugins/scaffolder-react/src/next/components/TemplateCard/CardHeader.test.tsx</file_path> | |
<file_code><![CDATA[ |
OlderNewer