Skip to content

Commit d308055

Browse files
committed
fix method call
Signed-off-by: Jonathan Winters <[email protected]>
1 parent b8e5ae8 commit d308055

File tree

1 file changed

+33
-35
lines changed

1 file changed

+33
-35
lines changed

docs/developer-guide/extensions/ui-extensions.md

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,30 @@ It is also possible to add an optional flyout widget to your extension. It can b
129129

130130
Below is an example of an extension using the flyout widget:
131131

132-
133132
```javascript
134133
((window) => {
135-
const component = (props: {
136-
openFlyout: () => any
137-
}) => {
134+
const component = (props: { openFlyout: () => any }) => {
138135
return React.createElement(
139-
"div",
140-
{
141-
style: { padding: "10px" },
142-
onClick: () => props.openFlyout()
143-
},
144-
"Hello World"
136+
"div",
137+
{
138+
style: { padding: "10px" },
139+
onClick: () => props.openFlyout(),
140+
},
141+
"Hello World"
145142
);
146143
};
147144
const flyout = () => {
148145
return React.createElement(
149-
"div",
150-
{ style: { padding: "10px" } },
151-
"This is a flyout"
146+
"div",
147+
{ style: { padding: "10px" } },
148+
"This is a flyout"
152149
);
153150
};
154151
window.extensionsAPI.registerStatusPanelExtension(
155-
component,
156-
"My Extension",
157-
"my_extension",
158-
flyout
152+
component,
153+
"My Extension",
154+
"my_extension",
155+
flyout
159156
);
160157
})(window);
161158
```
@@ -183,7 +180,9 @@ The callback function `shouldDisplay` should return true if the extension should
183180

184181
```typescript
185182
const shouldDisplay = (app: Application) => {
186-
return application.metadata?.labels?.['application.environmentLabelKey'] === "prd";
183+
return (
184+
application.metadata?.labels?.["application.environmentLabelKey"] === "prd"
185+
);
187186
};
188187
```
189188

@@ -196,28 +195,28 @@ Below is an example of a simple extension with a flyout widget:
196195
};
197196
const flyout = () => {
198197
return React.createElement(
199-
"div",
200-
{ style: { padding: "10px" } },
201-
"This is a flyout"
198+
"div",
199+
{ style: { padding: "10px" } },
200+
"This is a flyout"
202201
);
203202
};
204203
const component = () => {
205204
return React.createElement(
206-
"div",
207-
{
208-
onClick: () => flyout()
209-
},
210-
"Toolbar Extension Test"
205+
"div",
206+
{
207+
onClick: () => flyout(),
208+
},
209+
"Toolbar Extension Test"
211210
);
212211
};
213212
window.extensionsAPI.registerTopBarActionMenuExt(
214-
component,
215-
"Toolbar Extension Test",
216-
"Toolbar_Extension_Test",
217-
flyout,
218-
shouldDisplay,
219-
'',
220-
true
213+
component,
214+
"Toolbar Extension Test",
215+
"Toolbar_Extension_Test",
216+
flyout,
217+
shouldDisplay,
218+
"",
219+
true
221220
);
222221
})(window);
223222
```
@@ -228,7 +227,6 @@ App View extensions allow you to create a new Application Details View for an ap
228227

229228
Register this extension through the `extensionsAPI.registerAppViewExtension` method.
230229

231-
232230
```typescript
233231
registerAppViewExtension(
234232
component: ExtensionComponent, // the component to be rendered
@@ -248,7 +246,7 @@ Below is an example of a simple extension:
248246
"Hello World"
249247
);
250248
};
251-
window.extensionsAPI.registerStatusPanelExtension(
249+
window.extensionsAPI.registerAppViewExtension(
252250
component,
253251
"My Extension",
254252
"fa-question-circle"

0 commit comments

Comments
 (0)