just some more api report cleanup
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
+13
-49
@@ -10,73 +10,46 @@ import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { InfoCardVariants } from '@backstage/core-components';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityGroupProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityGroupProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
export const EntityGroupProfileCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityMembersListCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityMembersListCard: (_props: {
|
||||
export const EntityMembersListCard: (props: {
|
||||
memberDisplayTitle?: string | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityOwnershipCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityOwnershipCard: ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
export const EntityOwnershipCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
entityFilterKind?: string[] | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityUserProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityUserProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
export const EntityUserProfileCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GroupProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const GroupProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
export const GroupProfileCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "MembersListCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const MembersListCard: (_props: {
|
||||
export const MembersListCard: (props: {
|
||||
memberDisplayTitle?: string;
|
||||
pageSize?: number;
|
||||
}) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export const MyGroupsSidebarItem: ({
|
||||
singularTitle,
|
||||
pluralTitle,
|
||||
icon,
|
||||
}: {
|
||||
export const MyGroupsSidebarItem: (props: {
|
||||
singularTitle: string;
|
||||
pluralTitle: string;
|
||||
icon: IconComponent;
|
||||
}) => JSX.Element | null;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "orgPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
const orgPlugin: BackstagePlugin<
|
||||
{},
|
||||
@@ -87,23 +60,14 @@ const orgPlugin: BackstagePlugin<
|
||||
export { orgPlugin };
|
||||
export { orgPlugin as plugin };
|
||||
|
||||
// Warning: (ae-missing-release-tag) "OwnershipCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const OwnershipCard: ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
entityFilterKind?: string[] | undefined;
|
||||
export const OwnershipCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
entityFilterKind?: string[];
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "UserProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const UserProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
export const UserProfileCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => JSX.Element;
|
||||
```
|
||||
|
||||
@@ -53,18 +53,15 @@ import {
|
||||
} from '@backstage/core-components';
|
||||
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const CardTitle = ({ title }: { title: string }) => (
|
||||
const CardTitle = (props: { title: string }) => (
|
||||
<Box display="flex" alignItems="center">
|
||||
<GroupIcon fontSize="inherit" />
|
||||
<Box ml={1}>{title}</Box>
|
||||
<Box ml={1}>{props.title}</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
export const GroupProfileCard = ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => {
|
||||
/** @public */
|
||||
export const GroupProfileCard = (props: { variant?: InfoCardVariants }) => {
|
||||
const catalogApi = useApi(catalogApiRef);
|
||||
const alertApi = useApi(alertApiRef);
|
||||
const { entity: group } = useEntity<GroupEntity>();
|
||||
@@ -118,7 +115,7 @@ export const GroupProfileCard = ({
|
||||
<InfoCard
|
||||
title={<CardTitle title={displayName} />}
|
||||
subheader={description}
|
||||
variant={variant}
|
||||
variant={props.variant}
|
||||
action={
|
||||
<>
|
||||
{allowRefresh && (
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
DEFAULT_NAMESPACE,
|
||||
GroupEntity,
|
||||
@@ -61,12 +62,12 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
}),
|
||||
);
|
||||
|
||||
const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
const MemberComponent = (props: { member: UserEntity }) => {
|
||||
const classes = useStyles();
|
||||
const {
|
||||
metadata: { name: metaName },
|
||||
spec: { profile },
|
||||
} = member;
|
||||
} = props.member;
|
||||
const displayName = profile?.displayName ?? metaName;
|
||||
|
||||
return (
|
||||
@@ -92,7 +93,7 @@ const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
<Link
|
||||
to={generatePath(
|
||||
`/catalog/:namespace/user/${metaName}`,
|
||||
entityRouteParams(member),
|
||||
entityRouteParams(props.member),
|
||||
)}
|
||||
>
|
||||
{displayName}
|
||||
@@ -108,12 +109,14 @@ const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const MembersListCard = (_props: {
|
||||
/** @public */
|
||||
export const MembersListCard = (props: {
|
||||
memberDisplayTitle?: string;
|
||||
pageSize?: number;
|
||||
}) => {
|
||||
const { memberDisplayTitle = 'Members', pageSize = 50 } = props;
|
||||
|
||||
const { entity: groupEntity } = useEntity<GroupEntity>();
|
||||
let { memberDisplayTitle, pageSize } = _props;
|
||||
const {
|
||||
metadata: { name: groupName, namespace: grpNamespace },
|
||||
spec: { profile },
|
||||
@@ -128,8 +131,6 @@ export const MembersListCard = (_props: {
|
||||
const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {
|
||||
setPage(pageIndex);
|
||||
};
|
||||
pageSize = pageSize ? pageSize : 50;
|
||||
memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : 'Members';
|
||||
|
||||
const {
|
||||
loading,
|
||||
|
||||
@@ -51,13 +51,13 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const OwnershipCard = ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
/** @public */
|
||||
export const OwnershipCard = (props: {
|
||||
variant?: InfoCardVariants;
|
||||
entityFilterKind?: string[];
|
||||
}) => {
|
||||
const { variant, entityFilterKind } = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const { entity } = useEntity();
|
||||
const isGroup = entity.kind === 'Group';
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RELATION_MEMBER_OF, UserEntity } from '@backstage/catalog-model';
|
||||
import {
|
||||
EntityRefLinks,
|
||||
@@ -40,19 +41,16 @@ import {
|
||||
Link,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
const CardTitle = ({ title }: { title?: string }) =>
|
||||
title ? (
|
||||
const CardTitle = (props: { title?: string }) =>
|
||||
props.title ? (
|
||||
<Box display="flex" alignItems="center">
|
||||
<PersonIcon fontSize="inherit" />
|
||||
<Box ml={1}>{title}</Box>
|
||||
<Box ml={1}>{props.title}</Box>
|
||||
</Box>
|
||||
) : null;
|
||||
|
||||
export const UserProfileCard = ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => {
|
||||
/** @public */
|
||||
export const UserProfileCard = (props: { variant?: InfoCardVariants }) => {
|
||||
const { entity: user } = useEntity<UserEntity>();
|
||||
if (!user) {
|
||||
return <Alert severity="error">User not found</Alert>;
|
||||
@@ -72,7 +70,7 @@ export const UserProfileCard = ({
|
||||
<InfoCard
|
||||
title={<CardTitle title={displayName} />}
|
||||
subheader={description}
|
||||
variant={variant}
|
||||
variant={props.variant}
|
||||
>
|
||||
<Grid container spacing={3} alignItems="flex-start">
|
||||
<Grid item xs={12} sm={2} xl={1}>
|
||||
|
||||
@@ -39,15 +39,13 @@ import { getCompoundEntityRef } from '@backstage/catalog-model';
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const MyGroupsSidebarItem = ({
|
||||
singularTitle,
|
||||
pluralTitle,
|
||||
icon,
|
||||
}: {
|
||||
export const MyGroupsSidebarItem = (props: {
|
||||
singularTitle: string;
|
||||
pluralTitle: string;
|
||||
icon: IconComponent;
|
||||
}) => {
|
||||
const { singularTitle, pluralTitle, icon } = props;
|
||||
|
||||
const identityApi = useApi(identityApiRef);
|
||||
const catalogApi: CatalogApi = useApi(catalogApiRef);
|
||||
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { catalogIndexRouteRef } from './routes';
|
||||
|
||||
/** @public */
|
||||
export const orgPlugin = createPlugin({
|
||||
id: 'org',
|
||||
externalRoutes: {
|
||||
@@ -26,6 +27,7 @@ export const orgPlugin = createPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const EntityGroupProfileCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityGroupProfileCard',
|
||||
@@ -34,6 +36,8 @@ export const EntityGroupProfileCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityMembersListCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityMembersListCard',
|
||||
@@ -42,6 +46,8 @@ export const EntityMembersListCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityOwnershipCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityOwnershipCard',
|
||||
@@ -50,6 +56,8 @@ export const EntityOwnershipCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityUserProfileCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityUserProfileCard',
|
||||
|
||||
Reference in New Issue
Block a user