1- # OpenShift Console Plugin Template
1+ # OpenShift console plugin template
22
33This project is a minimal template for writing a new OpenShift Console dynamic
44plugin.
55
6- [ Dynamic plugins] ( https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk )
7- allow you to extend the
8- [ OpenShift UI] ( https://github.com/openshift/console )
6+ [ Openshift console plugins] ( https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk )
7+ allow you to extend the [ OpenShift web console] ( https://github.com/openshift/console )
98at runtime, adding custom pages and other extensions. They are based on
109[ webpack module federation] ( https://webpack.js.org/concepts/module-federation/ ) .
1110Plugins are registered with console using the ` ConsolePlugin ` custom resource
1211and enabled in the console operator config by a cluster administrator.
1312
14- Using the latest ` v1 ` API version of ` ConsolePlugin ` CRD, requires OpenShift 4.12
15- and higher. For using old ` v1alpha1 ` API version us OpenShift version 4.10 or 4.11.
16-
17- For an example of a plugin that works with OpenShift 4.11, see the ` release-4.11 ` branch.
18- For a plugin that works with OpenShift 4.10, see the ` release-4.10 ` branch.
13+ The ` main ` branch of this repository contains an example plugin which works
14+ with the latest version. To see an example of a plugin which works with an older
15+ version, visit the appropriate ` release-4.x ` branch.
1916
2017[ Node.js] ( https://nodejs.org/en/ ) and [ yarn] ( https://yarnpkg.com ) are required
2118to build and run the example. To run OpenShift console in a container, either
@@ -24,17 +21,17 @@ to build and run the example. To run OpenShift console in a container, either
2421
2522## Getting started
2623
27- > [ !IMPORTANT]
24+ > [ !IMPORTANT]
2825> To use this template, ** DO NOT FORK THIS REPOSITORY** ! Click ** Use this template** , then select
29- > [ ** Create a new repository** ] ( https://github.com/new?template_name=networking- console-plugin&template_owner=openshift )
26+ > [ ** Create a new repository** ] ( https://github.com/new?template_name=console-plugin-template &template_owner=openshift )
3027> to create a new repository.
3128>
3229> ![ A screenshot showing where the "Use this template" button is located] ( https://i.imgur.com/AhaySbU.png )
3330>
3431> ** Forking this repository** for purposes outside of contributing to this repository
3532> ** will cause issues** , as users cannot have more than one fork of a template repository
3633> at a time. This could prevent future users from forking and contributing to your plugin.
37- >
34+ >
3835> Your fork would also behave like a template repository, which might be confusing for
3936> contributiors, because it is not possible for repositories generated from a template
4037> repository to contribute back to the template.
@@ -177,7 +174,7 @@ naming conflicts. For example, the plugin template uses the
177174with this namespace as follows:
178175
179176``` tsx
180- conster Header : React .FC = () => {
177+ const Header: React .FC = () => {
181178 const { t } = useTranslation (' plugin__console-plugin-template' );
182179 return <h1 >{ t (' Hello, World!' )} </h1 >;
183180};
@@ -207,15 +204,14 @@ plugin template when adding or changing messages.
207204This project adds prettier, eslint, and stylelint. Linting can be run with
208205` yarn run lint ` .
209206
210- The stylelint config disallows hex colors since these cause problems with dark
211- mode (starting in OpenShift console 4.11). You should use the
212- [ PatternFly global CSS variables] ( https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables )
207+ The stylelint config disallows defining colors since these cause problems with dark
208+ mode. Use [ PatternFly semantic tokens] ( https://www.patternfly.org/tokens/all-patternfly-tokens )
213209for colors instead.
214210
215211The stylelint config also disallows naked element selectors like ` table ` and
216212` .pf- ` or ` .co- ` prefixed classes. This prevents plugins from accidentally
217213overwriting default console styles, breaking the layout of existing pages. The
218- best practice is to prefix your CSS classnames with your plugin name to avoid
214+ best practice is to prefix your CSS class names with your plugin name to avoid
219215conflicts. Please don't disable these rules without understanding how they can
220216break console styles!
221217
@@ -225,7 +221,7 @@ Steps to generate reports
225221
2262221 . In command prompt, navigate to root folder and execute the command ` yarn run cypress-merge `
2272232 . Then execute command ` yarn run cypress-generate `
228- The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory
224+ The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory.
229225
230226## References
231227
0 commit comments