feat(playlists): implement playlist plugin
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -103,6 +103,7 @@ import { techDocsPage } from './components/techdocs/TechDocsPage';
|
||||
import { ApacheAirflowPage } from '@backstage/plugin-apache-airflow';
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
||||
import { PlaylistIndexPage } from '@backstage/plugin-playlist';
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
@@ -265,6 +266,7 @@ const routes = (
|
||||
</Route>
|
||||
<Route path="/azure-pull-requests" element={<AzurePullRequestsPage />} />
|
||||
<Route path="/apache-airflow" element={<ApacheAirflowPage />} />
|
||||
<Route path="/playlist" element={<PlaylistIndexPage />} />
|
||||
</FlatRoutes>
|
||||
);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import RuleIcon from '@material-ui/icons/AssignmentTurnedIn';
|
||||
import MapIcon from '@material-ui/icons/MyLocation';
|
||||
import LayersIcon from '@material-ui/icons/Layers';
|
||||
import LibraryBooks from '@material-ui/icons/LibraryBooks';
|
||||
import PlaylistPlayIcon from '@material-ui/icons/PlaylistPlay';
|
||||
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import MenuIcon from '@material-ui/icons/Menu';
|
||||
@@ -105,6 +106,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
|
||||
/>
|
||||
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
|
||||
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
|
||||
<SidebarItem icon={PlaylistPlayIcon} to="playlist" text="Playlists" />
|
||||
<SidebarItem icon={LayersIcon} to="explore" text="Explore" />
|
||||
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
|
||||
{/* End global nav */}
|
||||
|
||||
@@ -104,6 +104,7 @@ import {
|
||||
EntityPagerDutyCard,
|
||||
isPagerDutyAvailable,
|
||||
} from '@backstage/plugin-pagerduty';
|
||||
import { EntityPlaylistDialog } from '@backstage/plugin-playlist';
|
||||
import {
|
||||
EntityRollbarContent,
|
||||
isRollbarAvailable,
|
||||
@@ -114,6 +115,7 @@ import { EntityTechInsightsScorecardCard } from '@backstage/plugin-tech-insights
|
||||
import { EntityTodoContent } from '@backstage/plugin-todo';
|
||||
import { Button, Grid } from '@material-ui/core';
|
||||
import BadgeIcon from '@material-ui/icons/CallToAction';
|
||||
import PlaylistAddIcon from '@material-ui/icons/PlaylistAdd';
|
||||
|
||||
import {
|
||||
EntityGithubInsightsContent,
|
||||
@@ -155,6 +157,7 @@ const customEntityFilterKind = ['Component', 'API', 'System'];
|
||||
|
||||
const EntityLayoutWrapper = (props: { children?: ReactNode }) => {
|
||||
const [badgesDialogOpen, setBadgesDialogOpen] = useState(false);
|
||||
const [playlistDialogOpen, setPlaylistDialogOpen] = useState(false);
|
||||
|
||||
const extraMenuItems = useMemo(() => {
|
||||
return [
|
||||
@@ -163,6 +166,11 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => {
|
||||
Icon: BadgeIcon,
|
||||
onClick: () => setBadgesDialogOpen(true),
|
||||
},
|
||||
{
|
||||
title: 'Add to playlist',
|
||||
Icon: PlaylistAddIcon,
|
||||
onClick: () => setPlaylistDialogOpen(true),
|
||||
},
|
||||
];
|
||||
}, []);
|
||||
|
||||
@@ -180,6 +188,10 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => {
|
||||
open={badgesDialogOpen}
|
||||
onClose={() => setBadgesDialogOpen(false)}
|
||||
/>
|
||||
<EntityPlaylistDialog
|
||||
open={playlistDialogOpen}
|
||||
onClose={() => setPlaylistDialogOpen(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user