@bcgov/plugin-catalog-dataset 0.2.10-feature.aps-4600-use-built-in-api-entity.a8871ee9 → 0.2.10-feature.aps-4600-use-built-in-api-entity.91b201f2
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.
|
@@ -8,64 +8,56 @@ const AccessMethodsCard = ({
|
|
|
8
8
|
}) => {
|
|
9
9
|
const hasApis = !!apiEntityRefs?.length;
|
|
10
10
|
const hasOther = !!accessMethods?.length;
|
|
11
|
-
return /* @__PURE__ */ jsxs(
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ jsx(CardContent, { children: !hasApis && !hasOther ? /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "No access methods defined." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
hasApis && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(CardHeader, { title: "Access Methods" }),
|
|
13
|
+
/* @__PURE__ */ jsx(CardContent, { children: !hasApis && !hasOther ? /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "No access methods defined." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
hasApis && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: "APIs" }),
|
|
16
|
+
/* @__PURE__ */ jsx("ul", { children: apiEntityRefs.map((apiRef) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(EntityRefLink, { entityRef: apiRef, defaultKind: "API" }) }, apiRef)) })
|
|
17
|
+
] }),
|
|
18
|
+
hasOther && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Other" }),
|
|
20
|
+
/* @__PURE__ */ jsx("ul", { children: accessMethods.map((method) => /* @__PURE__ */ jsxs("li", { children: [
|
|
21
|
+
method.entityRef ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
22
|
/* @__PURE__ */ jsx(
|
|
25
|
-
|
|
23
|
+
EntityRefLink,
|
|
26
24
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
entityRef: method.entityRef,
|
|
26
|
+
defaultKind: "Resource",
|
|
27
|
+
title: method.title
|
|
30
28
|
}
|
|
31
29
|
),
|
|
32
|
-
|
|
33
|
-
] }),
|
|
34
|
-
hasOther && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
" ",
|
|
35
31
|
/* @__PURE__ */ jsx(
|
|
36
|
-
|
|
32
|
+
Link,
|
|
37
33
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
href: method.url,
|
|
35
|
+
target: "_blank",
|
|
36
|
+
rel: "noopener noreferrer",
|
|
37
|
+
children: "Open"
|
|
41
38
|
}
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
] })
|
|
65
|
-
] }) })
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
);
|
|
39
|
+
)
|
|
40
|
+
] }) : /* @__PURE__ */ jsx(
|
|
41
|
+
Link,
|
|
42
|
+
{
|
|
43
|
+
href: method.url,
|
|
44
|
+
target: "_blank",
|
|
45
|
+
rel: "noopener noreferrer",
|
|
46
|
+
children: method.title
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
(method.type || method.format) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
" ",
|
|
51
|
+
"(",
|
|
52
|
+
method.type,
|
|
53
|
+
method.format ? ` \u2022 ${method.format}` : "",
|
|
54
|
+
")"
|
|
55
|
+
] }),
|
|
56
|
+
method.description && /* @__PURE__ */ jsx(Typography, { variant: "body2", children: method.description })
|
|
57
|
+
] }, method.id)) })
|
|
58
|
+
] })
|
|
59
|
+
] }) })
|
|
60
|
+
] });
|
|
69
61
|
};
|
|
70
62
|
|
|
71
63
|
export { AccessMethodsCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessMethodsCard.esm.js","sources":["../../../src/components/CatalogDataset/AccessMethodsCard.tsx"],"sourcesContent":["import {\n Card,\n CardHeader,\n
|
|
1
|
+
{"version":3,"file":"AccessMethodsCard.esm.js","sources":["../../../src/components/CatalogDataset/AccessMethodsCard.tsx"],"sourcesContent":["import {\n Card,\n CardContent,\n CardHeader,\n Link,\n Typography,\n} from '@material-ui/core';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\n\ntype AccessMethod = {\n id: string;\n title: string;\n url: string;\n type?: string;\n format?: string;\n description?: string;\n entityRef?: string;\n};\n\ntype Props = {\n accessMethods?: AccessMethod[];\n apiEntityRefs?: string[];\n};\n\nexport const AccessMethodsCard = ({\n accessMethods,\n apiEntityRefs,\n}: Props) => {\n const hasApis = !!apiEntityRefs?.length;\n const hasOther = !!accessMethods?.length;\n\n return (\n <Card>\n <CardHeader title=\"Access Methods\" />\n <CardContent>\n {!hasApis && !hasOther ? (\n <Typography variant=\"body2\">No access methods defined.</Typography>\n ) : (\n <>\n {hasApis && (\n <>\n <Typography variant=\"h6\">APIs</Typography>\n <ul>\n {apiEntityRefs!.map(apiRef => (\n <li key={apiRef}>\n <EntityRefLink entityRef={apiRef} defaultKind=\"API\" />\n </li>\n ))}\n </ul>\n </>\n )}\n\n {hasOther && (\n <>\n <Typography variant=\"h6\">Other</Typography>\n <ul>\n {accessMethods!.map(method => (\n <li key={method.id}>\n {method.entityRef ? (\n <>\n <EntityRefLink\n entityRef={method.entityRef}\n defaultKind=\"Resource\"\n title={method.title}\n />\n {' '}\n <Link\n href={method.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Open\n </Link>\n </>\n ) : (\n <Link\n href={method.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {method.title}\n </Link>\n )}\n\n {(method.type || method.format) && (\n <>\n {' '}\n ({method.type}\n {method.format ? ` • ${method.format}` : ''})\n </>\n )}\n\n {method.description && (\n <Typography variant=\"body2\">\n {method.description}\n </Typography>\n )}\n </li>\n ))}\n </ul>\n </>\n )}\n </>\n )}\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,oBAAoB,CAAC;AAAA,EAChC,aAAA;AAAA,EACA;AACF,CAAA,KAAa;AACX,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,aAAA,EAAe,MAAA;AACjC,EAAA,MAAM,QAAA,GAAW,CAAC,CAAC,aAAA,EAAe,MAAA;AAElC,EAAA,4BACG,IAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAM,gBAAA,EAAiB,CAAA;AAAA,oBACnC,GAAA,CAAC,WAAA,EAAA,EACE,QAAA,EAAA,CAAC,OAAA,IAAW,CAAC,QAAA,mBACZ,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAAQ,QAAA,EAAA,4BAAA,EAA0B,CAAA,mBAEtD,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,OAAA,oBACC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,QAAA,EAAA,MAAA,EAAI,CAAA;AAAA,4BAC5B,IAAA,EAAA,E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EAAA,EACG,QAAA,EAAA;AAAA,YAAA,GAAA;AAAA,YAAI,GAAA;AAAA,YACH,MAAA,CAAO,IAAA;AAAA,YACR,MAAA,CAAO,MAAA,GAAS,CAAA,QAAA,EAAM,MAAA,CAAO,MAAM,CAAA,CAAA,GAAK,EAAA;AAAA,YAAG;AAAA,WAAA,EAC9C,CAAA;AAAA,UAGD,OAAO,WAAA,oBACN,GAAA,CAAC,cAAW,OAAA,EAAQ,OAAA,EACjB,iBAAO,WAAA,EACV;AAAA,SAAA,EAAA,EAtCK,MAAA,CAAO,EAwChB,CACD,CAAA,EACH;AAAA,OAAA,EACF;AAAA,KAAA,EAEJ,CAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcgov/plugin-catalog-dataset",
|
|
3
|
-
"version": "0.2.10-feature.aps-4600-use-built-in-api-entity.
|
|
3
|
+
"version": "0.2.10-feature.aps-4600-use-built-in-api-entity.91b201f2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@backstage/core-components": "^0.17.3",
|
|
36
36
|
"@backstage/core-plugin-api": "^1.10.9",
|
|
37
37
|
"@backstage/theme": "^0.6.6",
|
|
38
|
-
"@bcgov/plugin-catalog-common-bc-data-catalogue": "0.2.10-feature.aps-4600-use-built-in-api-entity.
|
|
38
|
+
"@bcgov/plugin-catalog-common-bc-data-catalogue": "0.2.10-feature.aps-4600-use-built-in-api-entity.91b201f2",
|
|
39
39
|
"@material-ui/core": "^4.9.13",
|
|
40
40
|
"@material-ui/icons": "^4.9.1",
|
|
41
41
|
"@material-ui/lab": "^4.0.0-alpha.61",
|