chore: moving some more things to alpha label
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -127,7 +127,7 @@ export type LogEvent = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @alpha
|
||||
export type NextRouterProps = {
|
||||
components?: {
|
||||
TemplateCardComponent?: React_2.ComponentType<{
|
||||
|
||||
@@ -32,7 +32,7 @@ import { TemplateGroupFilter } from '../TemplateListPage/TemplateGroups';
|
||||
/**
|
||||
* The Props for the Scaffolder Router
|
||||
*
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export type NextRouterProps = {
|
||||
components?: {
|
||||
@@ -47,7 +47,7 @@ export type NextRouterProps = {
|
||||
/**
|
||||
* The Scaffolder Router
|
||||
*
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export const Router = (props: PropsWithChildren<NextRouterProps>) => {
|
||||
const { components: { TemplateCardComponent } = {} } = props;
|
||||
|
||||
@@ -27,7 +27,7 @@ import { usePermission } from '@backstage/plugin-permission-react';
|
||||
/**
|
||||
* Properties for {@link RegisterExistingButton}
|
||||
*
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export type RegisterExistingButtonProps = {
|
||||
title: string;
|
||||
@@ -35,7 +35,7 @@ export type RegisterExistingButtonProps = {
|
||||
|
||||
/**
|
||||
* A button that helps users to register an existing component.
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export const RegisterExistingButton = (props: RegisterExistingButtonProps) => {
|
||||
const { title, to } = props;
|
||||
|
||||
@@ -75,7 +75,7 @@ const useStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
|
||||
/**
|
||||
* The Props for the Template Card component
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export interface TemplateCardProps {
|
||||
template: TemplateEntityV1beta3;
|
||||
@@ -84,7 +84,7 @@ export interface TemplateCardProps {
|
||||
|
||||
/**
|
||||
* The Template Card component that is rendered in a list for each template
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export const TemplateCard = (props: TemplateCardProps) => {
|
||||
const { template } = props;
|
||||
@@ -102,7 +102,7 @@ export const TemplateCard = (props: TemplateCardProps) => {
|
||||
content={template.metadata.description ?? 'No description'}
|
||||
/>
|
||||
</Box>
|
||||
{template.metadata.tags?.length ? (
|
||||
{template.metadata.tags?.length > 0 && (
|
||||
<>
|
||||
<Divider className={styles.margin} />
|
||||
<Box>
|
||||
@@ -111,12 +111,12 @@ export const TemplateCard = (props: TemplateCardProps) => {
|
||||
))}
|
||||
</Box>
|
||||
</>
|
||||
) : null}
|
||||
)}
|
||||
</CardContent>
|
||||
<CardActions>
|
||||
<div className={styles.footer}>
|
||||
<div className={styles.ownedBy}>
|
||||
{ownedByRelations.length ? (
|
||||
{ownedByRelations.length > 0 && (
|
||||
<>
|
||||
<UserIcon />
|
||||
<EntityRefLinks
|
||||
@@ -124,7 +124,7 @@ export const TemplateCard = (props: TemplateCardProps) => {
|
||||
defaultKind="Group"
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
)}
|
||||
</div>
|
||||
<Button size="small" variant="outlined" color="primary" to={href}>
|
||||
Choose
|
||||
|
||||
@@ -22,6 +22,9 @@ import { Progress, Link } from '@backstage/core-components';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { errorApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export type TemplateGroupFilter = {
|
||||
title?: React.ReactNode;
|
||||
filter: (entity: Entity) => boolean;
|
||||
|
||||
@@ -45,22 +45,12 @@ export type TemplateListPageProps = {
|
||||
groups?: TemplateGroupFilter[];
|
||||
};
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
contentWrapper: {
|
||||
display: 'grid',
|
||||
gridTemplateAreas: "'filters' 'grid'",
|
||||
gridTemplateColumns: '250px 1fr',
|
||||
gridColumnGap: theme.spacing(2),
|
||||
},
|
||||
}));
|
||||
|
||||
const defaultGroup: TemplateGroupFilter = {
|
||||
title: 'All Templates',
|
||||
filter: () => true,
|
||||
};
|
||||
|
||||
export const TemplateListPage = (props: TemplateListPageProps) => {
|
||||
const styles = useStyles();
|
||||
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
||||
const { TemplateCardComponent, groups = [defaultGroup] } = props;
|
||||
|
||||
|
||||
@@ -14,3 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { TemplateListPage } from './TemplateListPage';
|
||||
export type { TemplateGroupFilter } from './TemplateGroups';
|
||||
|
||||
@@ -36,7 +36,7 @@ export const SecretsContext = createContext<SecretsContextContents | undefined>(
|
||||
/**
|
||||
* The Context Provider that holds the state for the secrets.
|
||||
*
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export const SecretsContextProvider = ({ children }: PropsWithChildren<{}>) => {
|
||||
const [secrets, setSecrets] = useState<Record<string, string>>({});
|
||||
@@ -50,7 +50,7 @@ export const SecretsContextProvider = ({ children }: PropsWithChildren<{}>) => {
|
||||
|
||||
/**
|
||||
* Hook to access the secrets context.
|
||||
* @public
|
||||
* @alpha
|
||||
*/
|
||||
export const useTemplateSecrets = () => {
|
||||
const value = useContext(SecretsContext);
|
||||
|
||||
Reference in New Issue
Block a user