-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fab): add new mountpoints support for providers and listeners
- Loading branch information
Showing
18 changed files
with
880 additions
and
75 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
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
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
2 changes: 2 additions & 0 deletions
2
...appers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/.eslintignore
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,2 @@ | ||
dist-dynamic | ||
dist-scalprum |
1 change: 1 addition & 0 deletions
1
...rappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/.eslintrc.js
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 @@ | ||
module.exports = require("@backstage/cli/config/eslint-factory")(__dirname); |
62 changes: 62 additions & 0 deletions
62
...rappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/package.json
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,62 @@ | ||
{ | ||
"name": "red-hat-developer-hub-backstage-plugin-global-floating-action-button", | ||
"version": "0.0.3", | ||
"main": "src/index.ts", | ||
"types": "src/index.ts", | ||
"license": "Apache-2.0", | ||
"publishConfig": { | ||
"access": "public", | ||
"main": "dist/index.esm.js", | ||
"types": "dist/index.d.ts" | ||
}, | ||
"backstage": { | ||
"role": "frontend-plugin", | ||
"supported-versions": "1.32.5", | ||
"pluginId": "red-hat-developer-hub-backstage-plugin-global-floating-action-button", | ||
"pluginPackages": [ | ||
"red-hat-developer-hub-backstage-plugin-global-floating-action-button" | ||
] | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
"tsc": "tsc", | ||
"build": "backstage-cli package build", | ||
"lint:check": "backstage-cli package lint", | ||
"test": "backstage-cli package test --passWithNoTests --coverage", | ||
"clean": "backstage-cli package clean", | ||
"export-dynamic": "janus-cli package export-dynamic-plugin --in-place", | ||
"export-dynamic:clean": "run export-dynamic --clean" | ||
}, | ||
"dependencies": { | ||
"@mui/material": "5.16.13", | ||
"@red-hat-developer-hub/backstage-plugin-global-floating-action-button": "0.0.3" | ||
}, | ||
"devDependencies": { | ||
"@backstage/cli": "0.28.2", | ||
"@janus-idp/cli": "1.18.5", | ||
"typescript": "5.6.3" | ||
}, | ||
"scalprum": { | ||
"name": "red-hat-developer-hub.backstage-plugin-global-floating-action-button", | ||
"exposedModules": { | ||
"PluginRoot": "./src/index.ts" | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"dist-scalprum", | ||
"app-config.yaml" | ||
], | ||
"keywords": [ | ||
"backstage", | ||
"plugin" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/redhat-developer/rhdh", | ||
"directory": "dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button" | ||
}, | ||
"author": "Red Hat", | ||
"homepage": "https://red.ht/rhdh", | ||
"bugs": "https://issues.redhat.com/browse/RHIDP" | ||
} |
9 changes: 9 additions & 0 deletions
9
...rappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/src/index.ts
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,9 @@ | ||
import { unstable_ClassNameGenerator as ClassNameGenerator } from "@mui/material/className"; | ||
|
||
ClassNameGenerator.configure((componentName) => { | ||
return componentName.startsWith("v5-") | ||
? componentName | ||
: `v5-${componentName}`; | ||
}); | ||
|
||
export * from "@red-hat-developer-hub/backstage-plugin-global-floating-action-button"; |
9 changes: 9 additions & 0 deletions
9
...appers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/tsconfig.json
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,9 @@ | ||
{ | ||
"extends": "@backstage/cli/config/tsconfig.json", | ||
"include": ["src", "dev", "migrations"], | ||
"exclude": ["node_modules"], | ||
"compilerOptions": { | ||
"outDir": "../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button", | ||
"rootDir": "." | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../wrappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/turbo.json
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,10 @@ | ||
{ | ||
"extends": ["//"], | ||
"tasks": { | ||
"tsc": { | ||
"outputs": [ | ||
"../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-global-floating-action-button/**" | ||
] | ||
} | ||
} | ||
} |
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,20 @@ | ||
import { useContext } from 'react'; | ||
|
||
import { ErrorBoundary } from '@backstage/core-components'; | ||
|
||
import DynamicRootContext from '../DynamicRoot/DynamicRootContext'; | ||
|
||
export const ApplicationListener = () => { | ||
const { mountPoints } = useContext(DynamicRootContext); | ||
const listeners = mountPoints['application/listener'] ?? []; | ||
return listeners.map(({ Component }, index) => { | ||
return ( | ||
<ErrorBoundary | ||
// eslint-disable-next-line react/no-array-index-key | ||
key={index} | ||
> | ||
<Component /> | ||
</ErrorBoundary> | ||
); | ||
}); | ||
}; |
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,25 @@ | ||
import { useContext } from 'react'; | ||
|
||
import { ErrorBoundary } from '@backstage/core-components'; | ||
|
||
import DynamicRootContext from '../DynamicRoot/DynamicRootContext'; | ||
|
||
export const ApplicationProvider = ({ | ||
children, | ||
}: React.PropsWithChildren<{}>) => { | ||
const { mountPoints } = useContext(DynamicRootContext); | ||
const providers = mountPoints['application/provider'] ?? []; | ||
if (providers.length === 0) { | ||
return children; | ||
} | ||
return providers.map(({ Component }, index) => { | ||
return ( | ||
<ErrorBoundary | ||
// eslint-disable-next-line react/no-array-index-key | ||
key={index} | ||
> | ||
<Component>{children}</Component> | ||
</ErrorBoundary> | ||
); | ||
}); | ||
}; |
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
Oops, something went wrong.