@backstage/plugin-catalog-react 0.0.0-nightly-20230116022721 → 0.0.0-nightly-20230120022944
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -9
- package/alpha/package.json +1 -1
- package/dist/index.alpha.d.ts +3 -1
- package/dist/index.beta.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +22 -30
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20230120022944
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 929e1afe1b: Add `initialFilter` prop to EntityLifecyclePicker. This allows you to set an initial lifecycle for the catalog.
|
|
8
|
+
|
|
9
|
+
## 1.2.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
@@ -8,18 +14,18 @@
|
|
|
8
14
|
- 516b2039b6: Add a reusable pop over `EntityPeekAheadPopover` component. It shows more details about the associated entity. See the playbook here https://backstage.io/storybook/?path=/story/catalog-entitypeekaheadpopover--default
|
|
9
15
|
- 0e33627996: Remove usage of raw span
|
|
10
16
|
- Updated dependencies
|
|
11
|
-
- @backstage/catalog-model@
|
|
12
|
-
- @backstage/catalog-client@
|
|
13
|
-
- @backstage/core-components@0.
|
|
14
|
-
- @backstage/core-plugin-api@
|
|
15
|
-
- @backstage/plugin-permission-react@0.
|
|
17
|
+
- @backstage/catalog-model@1.1.5
|
|
18
|
+
- @backstage/catalog-client@1.3.0
|
|
19
|
+
- @backstage/core-components@0.12.3
|
|
20
|
+
- @backstage/core-plugin-api@1.3.0
|
|
21
|
+
- @backstage/plugin-permission-react@0.4.9
|
|
16
22
|
- @backstage/errors@1.1.4
|
|
17
|
-
- @backstage/integration@
|
|
23
|
+
- @backstage/integration@1.4.2
|
|
18
24
|
- @backstage/theme@0.2.16
|
|
19
25
|
- @backstage/types@1.0.2
|
|
20
26
|
- @backstage/version-bridge@1.0.3
|
|
21
|
-
- @backstage/plugin-catalog-common@
|
|
22
|
-
- @backstage/plugin-permission-common@0.
|
|
27
|
+
- @backstage/plugin-catalog-common@1.0.10
|
|
28
|
+
- @backstage/plugin-permission-common@0.7.3
|
|
23
29
|
|
|
24
30
|
## 1.2.4-next.2
|
|
25
31
|
|
package/alpha/package.json
CHANGED
package/dist/index.alpha.d.ts
CHANGED
|
@@ -212,7 +212,9 @@ export declare class EntityLifecycleFilter implements EntityFilter {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/** @public */
|
|
215
|
-
export declare const EntityLifecyclePicker: (
|
|
215
|
+
export declare const EntityLifecyclePicker: (props: {
|
|
216
|
+
initialFilter?: string[];
|
|
217
|
+
}) => JSX.Element | null;
|
|
216
218
|
|
|
217
219
|
/**
|
|
218
220
|
* Creates new context for entity listing and filtering.
|
package/dist/index.beta.d.ts
CHANGED
|
@@ -212,7 +212,9 @@ export declare class EntityLifecycleFilter implements EntityFilter {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/** @public */
|
|
215
|
-
export declare const EntityLifecyclePicker: (
|
|
215
|
+
export declare const EntityLifecyclePicker: (props: {
|
|
216
|
+
initialFilter?: string[];
|
|
217
|
+
}) => JSX.Element | null;
|
|
216
218
|
|
|
217
219
|
/**
|
|
218
220
|
* Creates new context for entity listing and filtering.
|
package/dist/index.d.ts
CHANGED
|
@@ -212,7 +212,9 @@ export declare class EntityLifecycleFilter implements EntityFilter {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/** @public */
|
|
215
|
-
export declare const EntityLifecyclePicker: (
|
|
215
|
+
export declare const EntityLifecyclePicker: (props: {
|
|
216
|
+
initialFilter?: string[];
|
|
217
|
+
}) => JSX.Element | null;
|
|
216
218
|
|
|
217
219
|
/**
|
|
218
220
|
* Creates new context for entity listing and filtering.
|
package/dist/index.esm.js
CHANGED
|
@@ -974,8 +974,9 @@ const useStyles$d = makeStyles(
|
|
|
974
974
|
);
|
|
975
975
|
const icon$3 = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
976
976
|
const checkedIcon$3 = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
|
|
977
|
-
const EntityLifecyclePicker = () => {
|
|
977
|
+
const EntityLifecyclePicker = (props) => {
|
|
978
978
|
var _a, _b;
|
|
979
|
+
const { initialFilter = [] } = props;
|
|
979
980
|
const classes = useStyles$d();
|
|
980
981
|
const {
|
|
981
982
|
updateFilters,
|
|
@@ -988,7 +989,7 @@ const EntityLifecyclePicker = () => {
|
|
|
988
989
|
[lifecyclesParameter]
|
|
989
990
|
);
|
|
990
991
|
const [selectedLifecycles, setSelectedLifecycles] = useState(
|
|
991
|
-
queryParamLifecycles.length ? queryParamLifecycles : (_b = (_a = filters.lifecycles) == null ? void 0 : _a.values) != null ? _b :
|
|
992
|
+
queryParamLifecycles.length ? queryParamLifecycles : (_b = (_a = filters.lifecycles) == null ? void 0 : _a.values) != null ? _b : initialFilter
|
|
992
993
|
);
|
|
993
994
|
useEffect(() => {
|
|
994
995
|
if (queryParamLifecycles.length) {
|
|
@@ -1133,7 +1134,7 @@ const EntityOwnerPicker = () => {
|
|
|
1133
1134
|
)));
|
|
1134
1135
|
};
|
|
1135
1136
|
|
|
1136
|
-
const EntityCardActions = (
|
|
1137
|
+
const EntityCardActions = (props) => {
|
|
1137
1138
|
const entityRoute = useRouteRef(entityRouteRef);
|
|
1138
1139
|
return /* @__PURE__ */ React.createElement(
|
|
1139
1140
|
IconButton,
|
|
@@ -1141,45 +1142,39 @@ const EntityCardActions = ({ entity }) => {
|
|
|
1141
1142
|
component: Link,
|
|
1142
1143
|
"aria-label": "Show",
|
|
1143
1144
|
title: "Show details",
|
|
1144
|
-
to: entityRoute(
|
|
1145
|
-
name: entity.metadata.name,
|
|
1146
|
-
namespace: entity.metadata.namespace || "default",
|
|
1147
|
-
kind: entity.kind.toLocaleLowerCase("en-US")
|
|
1148
|
-
})
|
|
1145
|
+
to: entityRoute(getCompoundEntityRef(props.entity))
|
|
1149
1146
|
},
|
|
1150
1147
|
/* @__PURE__ */ React.createElement(InfoIcon, null)
|
|
1151
1148
|
);
|
|
1152
1149
|
};
|
|
1153
1150
|
|
|
1154
|
-
const EmailCardAction = (
|
|
1151
|
+
const EmailCardAction = (props) => {
|
|
1155
1152
|
return /* @__PURE__ */ React.createElement(
|
|
1156
1153
|
IconButton,
|
|
1157
1154
|
{
|
|
1158
1155
|
component: Link,
|
|
1159
1156
|
"aria-label": "Email",
|
|
1160
|
-
title: `Email ${email}`,
|
|
1161
|
-
to: `mailto:${email}
|
|
1162
|
-
target: "_blank"
|
|
1157
|
+
title: `Email ${props.email}`,
|
|
1158
|
+
to: `mailto:${props.email}`
|
|
1163
1159
|
},
|
|
1164
1160
|
/* @__PURE__ */ React.createElement(EmailIcon, null)
|
|
1165
1161
|
);
|
|
1166
1162
|
};
|
|
1167
1163
|
|
|
1168
|
-
const GroupCardActions = (
|
|
1164
|
+
const GroupCardActions = (props) => {
|
|
1169
1165
|
var _a;
|
|
1170
|
-
|
|
1166
|
+
const email = (_a = props.entity.spec.profile) == null ? void 0 : _a.email;
|
|
1167
|
+
return email ? /* @__PURE__ */ React.createElement(EmailCardAction, { email }) : null;
|
|
1171
1168
|
};
|
|
1172
1169
|
|
|
1173
|
-
const UserCardActions = (
|
|
1170
|
+
const UserCardActions = (props) => {
|
|
1174
1171
|
var _a;
|
|
1175
|
-
|
|
1172
|
+
const email = (_a = props.entity.spec.profile) == null ? void 0 : _a.email;
|
|
1173
|
+
return email ? /* @__PURE__ */ React.createElement(EmailCardAction, { email }) : null;
|
|
1176
1174
|
};
|
|
1177
1175
|
|
|
1178
1176
|
const useStyles$b = makeStyles(() => {
|
|
1179
1177
|
return {
|
|
1180
|
-
trigger: {
|
|
1181
|
-
display: "inline-block"
|
|
1182
|
-
},
|
|
1183
1178
|
popoverPaper: {
|
|
1184
1179
|
width: "30em"
|
|
1185
1180
|
},
|
|
@@ -1202,25 +1197,22 @@ const EntityPeekAheadPopover = (props) => {
|
|
|
1202
1197
|
variant: "popover",
|
|
1203
1198
|
popupId: "entity-peek-ahead"
|
|
1204
1199
|
});
|
|
1205
|
-
const compoundEntityRef = parseEntityRef(entityRef);
|
|
1206
1200
|
const [isHovered, setIsHovered] = useState(false);
|
|
1207
|
-
const debouncedHandleMouseEnter =
|
|
1208
|
-
() => setIsHovered(true),
|
|
1209
|
-
delayTime
|
|
1201
|
+
const debouncedHandleMouseEnter = useMemo(
|
|
1202
|
+
() => debounce(() => setIsHovered(true), delayTime),
|
|
1203
|
+
[delayTime]
|
|
1210
1204
|
);
|
|
1211
1205
|
const [{ loading, error, value: entity }, load] = useAsyncFn(async () => {
|
|
1212
1206
|
const catalogApi = apiHolder.get(catalogApiRef);
|
|
1213
1207
|
if (catalogApi) {
|
|
1214
|
-
const retrievedEntity = await catalogApi.getEntityByRef(
|
|
1215
|
-
compoundEntityRef
|
|
1216
|
-
);
|
|
1208
|
+
const retrievedEntity = await catalogApi.getEntityByRef(entityRef);
|
|
1217
1209
|
if (!retrievedEntity) {
|
|
1218
|
-
throw new Error(`${
|
|
1210
|
+
throw new Error(`${entityRef} not found`);
|
|
1219
1211
|
}
|
|
1220
1212
|
return retrievedEntity;
|
|
1221
1213
|
}
|
|
1222
1214
|
return void 0;
|
|
1223
|
-
}, [apiHolder,
|
|
1215
|
+
}, [apiHolder, entityRef]);
|
|
1224
1216
|
const handleOnMouseLeave = () => {
|
|
1225
1217
|
setIsHovered(false);
|
|
1226
1218
|
debouncedHandleMouseEnter.cancel();
|
|
@@ -1255,7 +1247,7 @@ const EntityPeekAheadPopover = (props) => {
|
|
|
1255
1247
|
},
|
|
1256
1248
|
onMouseLeave: handleOnMouseLeave
|
|
1257
1249
|
},
|
|
1258
|
-
/* @__PURE__ */ React.createElement(
|
|
1250
|
+
/* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardContent, null, error && /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error }), loading && /* @__PURE__ */ React.createElement(Progress, null), entity && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { color: "textSecondary" }, entity.metadata.namespace), /* @__PURE__ */ React.createElement(Typography, { variant: "h5", component: "div" }, entity.metadata.name), /* @__PURE__ */ React.createElement(Typography, { color: "textSecondary", gutterBottom: true }, entity.kind), entity.metadata.description && /* @__PURE__ */ React.createElement(
|
|
1259
1251
|
Typography,
|
|
1260
1252
|
{
|
|
1261
1253
|
className: classes.descriptionTypography,
|
|
@@ -1264,7 +1256,7 @@ const EntityPeekAheadPopover = (props) => {
|
|
|
1264
1256
|
entity.metadata.description
|
|
1265
1257
|
), /* @__PURE__ */ React.createElement(Typography, null, (_a = entity.spec) == null ? void 0 : _a.type), /* @__PURE__ */ React.createElement(Box, { marginTop: "0.5em" }, (entity.metadata.tags || []).slice(0, maxTagChips).map((tag) => {
|
|
1266
1258
|
return /* @__PURE__ */ React.createElement(Chip, { key: tag, size: "small", label: tag });
|
|
1267
|
-
}), ((_b = entity.metadata.tags) == null ? void 0 : _b.length) && ((_c = entity.metadata.tags) == null ? void 0 : _c.length) > maxTagChips && /* @__PURE__ */ React.createElement(Tooltip, { title: "Drill into the entity to see all of the tags." }, /* @__PURE__ */ React.createElement(Chip, { key: "other-tags", size: "small", label: "..." }))))), !error && /* @__PURE__ */ React.createElement(CardActions, null,
|
|
1259
|
+
}), ((_b = entity.metadata.tags) == null ? void 0 : _b.length) && ((_c = entity.metadata.tags) == null ? void 0 : _c.length) > maxTagChips && /* @__PURE__ */ React.createElement(Tooltip, { title: "Drill into the entity to see all of the tags." }, /* @__PURE__ */ React.createElement(Chip, { key: "other-tags", size: "small", label: "..." }))))), !error && entity && /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(React.Fragment, null, isUserEntity(entity) && /* @__PURE__ */ React.createElement(UserCardActions, { entity }), isGroupEntity(entity) && /* @__PURE__ */ React.createElement(GroupCardActions, { entity }), /* @__PURE__ */ React.createElement(EntityCardActions, { entity }))))
|
|
1268
1260
|
));
|
|
1269
1261
|
};
|
|
1270
1262
|
|