Skip to content

Commit 113faa4

Browse files
authored
chore(orchestrator): log which OrchestratorFormApi is used (#782)
* chore(orchestrator): log which OrchestratorFormApi is used Signed-off-by: Marek Libra <marek.libra@gmail.com> * export orchestratorFormApiFactory Signed-off-by: Marek Libra <marek.libra@gmail.com> * api reports --------- Signed-off-by: Marek Libra <marek.libra@gmail.com>
1 parent cfed054 commit 113faa4

5 files changed

Lines changed: 31 additions & 9 deletions

File tree

workspaces/orchestrator/plugins/orchestrator-form-react/src/DefaultFormApi.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ import {
2424

2525
class DefaultFormApi implements OrchestratorFormApi {
2626
getFormDecorator(): OrchestratorFormDecorator {
27+
// eslint-disable-next-line no-console
28+
console.log(
29+
'Using the Orchestrator DefaultFormApi (without additional extensions).',
30+
);
31+
2732
return (FormComponent: React.ComponentType<FormDecoratorProps>) =>
2833
FormComponent;
2934
}

workspaces/orchestrator/plugins/orchestrator-form-widgets/report.api.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
55
```ts
66

7+
import { ApiFactory } from '@backstage/core-plugin-api';
78
import { BackstagePlugin } from '@backstage/core-plugin-api';
9+
import { OrchestratorFormApi } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-api';
810

9-
// Warning: (ae-missing-release-tag) "orchestratorFormWidgetsPlugin" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
11+
// Warning: (ae-forgotten-export) The symbol "FormWidgetsApi" needs to be exported by the entry point index.d.ts
1012
//
11-
// @public (undocumented)
12-
export const orchestratorFormWidgetsPlugin: BackstagePlugin< {}, {}, {}>;
13+
// @public
14+
export const orchestratorFormApiFactory: ApiFactory<OrchestratorFormApi, FormWidgetsApi, {
15+
[x: string]: unknown;
16+
}>;
1317

14-
// Warnings were encountered during analysis:
15-
//
16-
// src/plugin.d.ts:5:22 - (ae-undocumented) Missing documentation for "orchestratorFormWidgetsPlugin".
18+
// @public
19+
export const orchestratorFormWidgetsPlugin: BackstagePlugin< {}, {}, {}>;
1720

1821
// (No @packageDocumentation comment for this package)
1922

workspaces/orchestrator/plugins/orchestrator-form-widgets/src/FormWidgetsApi.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const widgets = {
4242

4343
export class FormWidgetsApi implements OrchestratorFormApi {
4444
getFormDecorator: OrchestratorFormApi['getFormDecorator'] = () => {
45+
// eslint-disable-next-line no-console
46+
console.log('Using FormWidgetsApi by RHDH orchestrator-form-widgets.');
47+
4548
return (FormComponent: React.ComponentType<FormDecoratorProps>) => {
4649
return () => {
4750
const { formData, setFormData } = useWrapperFormPropsContext();

workspaces/orchestrator/plugins/orchestrator-form-widgets/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
export { orchestratorFormWidgetsPlugin } from './plugin';
16+
export {
17+
orchestratorFormWidgetsPlugin,
18+
orchestratorFormApiFactory,
19+
} from './plugin';

workspaces/orchestrator/plugins/orchestrator-form-widgets/src/plugin.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@ import { createApiFactory, createPlugin } from '@backstage/core-plugin-api';
1717
import { orchestratorFormApiRef } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-api';
1818
import { FormWidgetsApi } from './FormWidgetsApi';
1919

20-
export const formApiFactory = createApiFactory({
20+
/**
21+
* @public
22+
* Form API factory for the orchestratorFormWidgetsPlugin.
23+
*/
24+
export const orchestratorFormApiFactory = createApiFactory({
2125
api: orchestratorFormApiRef,
2226
deps: {},
2327
factory() {
2428
return new FormWidgetsApi();
2529
},
2630
});
2731

32+
/**
33+
* @public
34+
* Orchestrator Frontend Plugin providing decorator with default RJSF widgets for the Workflow Execution page.
35+
*/
2836
export const orchestratorFormWidgetsPlugin = createPlugin({
2937
id: 'orchestrator-form-widgets',
3038
routes: {},
31-
apis: [formApiFactory],
39+
apis: [orchestratorFormApiFactory],
3240
});

0 commit comments

Comments
 (0)