Fix registration of component

Signed-off-by: josh <josh.timmons@hashicorp.com>
This commit is contained in:
josh
2023-06-04 15:30:32 -04:00
parent 285de62914
commit 523af24224
6 changed files with 65 additions and 12 deletions
@@ -110,6 +110,8 @@ export const EntityNomadJobVersionListCard = () => {
return <ResponseErrorPanel error={err} />;
}
if (!entity) return <></>;
// Check that job ID is set
if (!isNomadJobIDAvailable(entity)) {
return (
@@ -121,11 +123,11 @@ export const EntityNomadJobVersionListCard = () => {
return (
<Table<rowType>
title="Job Versions"
title="Job versions"
actions={[
{
icon: () => <OpenInNewIcon />,
tooltip: 'Open Job Versions Tab in Nomad',
tooltip: 'Open in Nomad UI',
isFreeAction: true,
onClick: () => window.open(`${nomadAddr}/ui/jobs/${jobID}/versions`),
},
+2 -1
View File
@@ -14,5 +14,6 @@
* limitations under the License.
*/
import { EntityNomadJobVersionListCard } from './EntityNomadJobVersionListCard/EntityNomadJobVersionListCard';
import { EntityNomadAllocationListTable } from './EntityNomadAllocationListTable/EntityNomadAllocationListTable';
export { EntityNomadJobVersionListCard };
export { EntityNomadJobVersionListCard, EntityNomadAllocationListTable };
+5 -2
View File
@@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { nomadPlugin } from './plugin';
export {
nomadPlugin,
EntityNomadJobVersionListCard,
EntityNomadAllocationListTable,
} from './plugin';
export {
isNomadAllocationsAvailable,
isNomadJobIDAvailable,
EmbeddedRouter,
} from './Router';
export { EntityNomadJobVersionListCard } from './components';
+41 -1
View File
@@ -18,8 +18,9 @@ import {
fetchApiRef,
createApiFactory,
createPlugin,
createRoutableExtension,
createRouteRef,
createRoutableExtension,
createComponentExtension,
} from '@backstage/core-plugin-api';
import { rootRouteRef } from './routes';
@@ -44,3 +45,42 @@ export const nomadPlugin = createPlugin({
entityContent: entityContentRouteRef,
},
});
/** @public */
export const EntityNomadContent = nomadPlugin.provide(
createRoutableExtension({
name: 'EntityNomadContent',
component: () => import('./Router').then(m => m.EmbeddedRouter),
mountPoint: entityContentRouteRef,
}),
);
/**
* Card used to show the list of Nomad job versions.
*
* @public
*/
export const EntityNomadJobVersionListCard = nomadPlugin.provide(
createComponentExtension({
name: 'EntityNomadJobVersionListCard',
component: {
lazy: () =>
import('./components').then(m => m.EntityNomadJobVersionListCard),
},
}),
);
/**
* Table used to show the list of Nomad allocations for a job and/or task-group.
*
* @public
*/
export const EntityNomadAllocationListTable = nomadPlugin.provide(
createComponentExtension({
name: 'EntityNomadAllocationListTable',
component: {
lazy: () =>
import('./components').then(m => m.EntityNomadAllocationListTable),
},
}),
);