@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
- Card,
13
- {
14
- style: {
15
- borderRadius: 8,
16
- marginBottom: 16,
17
- border: "2px solid rgba(0,0,0,0.23)"
18
- },
19
- variant: "outlined",
20
- children: [
21
- /* @__PURE__ */ jsx(CardHeader, { title: "Access Methods" }),
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
- Typography,
23
+ EntityRefLink,
26
24
  {
27
- variant: "subtitle1",
28
- style: { marginBottom: 8, fontWeight: 600 },
29
- children: "APIs"
25
+ entityRef: method.entityRef,
26
+ defaultKind: "Resource",
27
+ title: method.title
30
28
  }
31
29
  ),
32
- /* @__PURE__ */ jsx("ul", { style: { margin: 0, paddingLeft: 20 }, children: apiEntityRefs.map((apiRef) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(EntityRefLink, { entityRef: apiRef }) }, apiRef)) })
33
- ] }),
34
- hasOther && /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ " ",
35
31
  /* @__PURE__ */ jsx(
36
- Typography,
32
+ Link,
37
33
  {
38
- variant: "subtitle1",
39
- style: { marginTop: hasApis ? 16 : 0, marginBottom: 8, fontWeight: 600 },
40
- children: "Other"
34
+ href: method.url,
35
+ target: "_blank",
36
+ rel: "noopener noreferrer",
37
+ children: "Open"
41
38
  }
42
- ),
43
- /* @__PURE__ */ jsx("ul", { style: { margin: 0, paddingLeft: 20 }, children: accessMethods.map((m) => /* @__PURE__ */ jsxs("li", { style: { marginBottom: 8 }, children: [
44
- /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
45
- /* @__PURE__ */ jsx(
46
- Link,
47
- {
48
- href: m.url,
49
- target: "_blank",
50
- rel: "noopener noreferrer",
51
- children: m.title
52
- }
53
- ),
54
- (m.type || m.format) && /* @__PURE__ */ jsxs(Fragment, { children: [
55
- " ",
56
- "(",
57
- m.type,
58
- m.format ? ` \u2022 ${m.format}` : "",
59
- ")"
60
- ] })
61
- ] }),
62
- m.description && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", style: { whiteSpace: "pre-line" }, children: m.description })
63
- ] }, m.id)) })
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 CardContent,\n Typography,\n Link\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};\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 style={{\n borderRadius: 8,\n marginBottom: 16,\n border: '2px solid rgba(0,0,0,0.23)',\n }}\n variant=\"outlined\"\n >\n <CardHeader title=\"Access Methods\" />\n <CardContent>\n {!hasApis && !hasOther ? (\n <Typography variant=\"body2\">\n No access methods defined.\n </Typography>\n ) : (\n <>\n {hasApis && (\n <>\n <Typography\n variant=\"subtitle1\"\n style={{ marginBottom: 8, fontWeight: 600 }}\n >\n APIs\n </Typography>\n\n <ul style={{ margin: 0, paddingLeft: 20 }}>\n {apiEntityRefs!.map(apiRef => (\n <li key={apiRef}>\n <EntityRefLink entityRef={apiRef} />\n </li>\n ))}\n </ul>\n </>\n )}\n\n {hasOther && (\n <>\n <Typography\n variant=\"subtitle1\"\n style={{ marginTop: hasApis ? 16 : 0, marginBottom: 8, fontWeight: 600 }}\n >\n Other\n </Typography>\n\n <ul style={{ margin: 0, paddingLeft: 20 }}>\n {accessMethods!.map(m => (\n <li key={m.id} style={{ marginBottom: 8 }}>\n <Typography variant=\"body2\">\n <Link\n href={m.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {m.title}\n </Link>\n {(m.type || m.format) && (\n <>\n {' '}\n ({m.type}\n {m.format ? ` • ${m.format}` : ''})\n </>\n )}\n </Typography>\n\n {m.description && (\n <Typography variant=\"body2\" color=\"textSecondary\" style={{ whiteSpace: 'pre-line' }}>\n {m.description}\n </Typography>\n )}\n </li>\n ))}\n </ul>\n </>\n )}\n </>\n )}\n </CardContent>\n </Card>\n );\n};"],"names":[],"mappings":";;;;AAuBO,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,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,YAAA,EAAc,CAAA;AAAA,QACd,YAAA,EAAc,EAAA;AAAA,QACd,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,OAAA,EAAQ,UAAA;AAAA,MAER,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAM,gBAAA,EAAiB,CAAA;AAAA,wBACnC,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,EAE5B,CAAA,mBAEA,IAAA,CAAA,QAAA,EAAA,EACG,QAA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GAAA;AAAA,oBACR,MAAA,EAAO,QAAA;AAAA,oBACP,GAAA,EAAI,qBAAA;AAAA,oBAEH,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA,iBACH;AAAA,gBAAA,CACE,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,MAAA,qBACd,IAAA,CAAA,QAAA,EAAA,EACK,QAAA,EAAA;AAAA,kBAAA,GAAA;AAAA,kBAAI,GAAA;AAAA,kBACH,CAAA,CAAE,IAAA;AAAA,kBACH,CAAA,CAAE,MAAA,GAAS,CAAA,QAAA,EAAM,CAAA,CAAE,MAAM,CAAA,CAAA,GAAK,EAAA;AAAA,kBAAG;AAAA,iBAAA,EACtC;AAAA,eAAA,EAEJ,CAAA;AAAA,cAEC,CAAA,CAAE,WAAA,oBACC,GAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,OAAA,EAAQ,KAAA,EAAM,eAAA,EAAgB,KAAA,EAAO,EAAE,UAAA,EAAY,UAAA,EAAW,EACjF,YAAE,WAAA,EACH;AAAA,aAAA,EAAA,EArBK,CAAA,CAAE,EAuBX,CACD,CAAA,EACH;AAAA,WAAA,EACF;AAAA,SAAA,EAEJ,CAAA,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
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,EAA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AAAA,YAAC,IAAA;AAAA,YAAA;AAAA,cACC,MAAM,MAAA,CAAO,GAAA;AAAA,cACb,MAAA,EAAO,QAAA;AAAA,cACP,GAAA,EAAI,qBAAA;AAAA,cAEH,QAAA,EAAA,MAAA,CAAO;AAAA;AAAA,WACV;AAAA,UAAA,CAGA,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,MAAA,qBACtB,IAAA,CAAA,QAAA,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.a8871ee9",
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.a8871ee9",
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",