@red-hat-developer-hub/backstage-plugin-openshift-image-registry 1.13.0 → 1.13.1

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  ### Dependencies
2
2
 
3
+ ## 1.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b037a9: Dev dependency update.
8
+ - 2b037a9: Replaced internal usage of `formatByteSize` with a local implementation using the `filesize` library, matching the original output format.
9
+
3
10
  ## 1.13.0
4
11
 
5
12
  ### Minor Changes
@@ -1,8 +1,8 @@
1
1
  import { useState } from 'react';
2
2
  import { useAsync } from 'react-use';
3
3
  import { useApi } from '@backstage/core-plugin-api';
4
- import { formatByteSize } from '@janus-idp/shared-react';
5
4
  import { openshiftImageRegistryApiRef } from '../api/index.esm.js';
5
+ import { formatByteSize } from '../utils.esm.js';
6
6
 
7
7
  const useImageStreamsMetadataFromTag = (imageStreams) => {
8
8
  const client = useApi(openshiftImageRegistryApiRef);
@@ -1 +1 @@
1
- {"version":3,"file":"useImageStreamsMetadataFromTag.esm.js","sources":["../../src/hooks/useImageStreamsMetadataFromTag.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { formatByteSize } from '@janus-idp/shared-react';\n\nimport { openshiftImageRegistryApiRef } from '../api';\nimport { ImageStream, ImageStreamMetadata } from '../types';\n\nexport const useImageStreamsMetadataFromTag = (imageStreams: ImageStream[]) => {\n const client = useApi(openshiftImageRegistryApiRef);\n const [imageStreamsData, setImageStreamsData] = useState<\n ImageStreamMetadata[]\n >([]);\n\n const { loading } = useAsync(async () => {\n const imgStsData = imageStreams?.length\n ? await Promise.all(\n imageStreams.map(async (imst: ImageStream) => {\n try {\n const tag = await client.getImageStreamTag(\n imst.namespace,\n imst.name,\n imst.tags[0] || '',\n );\n return {\n ...imst,\n description:\n tag.image.dockerImageMetadata?.Config?.Labels?.[\n 'io.k8s.description'\n ] ||\n tag.image.dockerImageMetadata?.Config?.description ||\n '',\n version:\n tag.image.dockerImageMetadata?.Config?.Labels?.version || '',\n size: formatByteSize(tag.image.dockerImageMetadata?.Size) || '',\n };\n } catch {\n return imst;\n }\n }),\n )\n : [];\n setImageStreamsData(imgStsData);\n }, [imageStreams]);\n\n return { loading, imageStreamsMetadata: imageStreamsData };\n};\n"],"names":[],"mappings":";;;;;;AA0Ba,MAAA,8BAAA,GAAiC,CAAC,YAAgC,KAAA;AAC7E,EAAM,MAAA,MAAA,GAAS,OAAO,4BAA4B,CAAA;AAClD,EAAA,MAAM,CAAC,gBAAkB,EAAA,mBAAmB,CAAI,GAAA,QAAA,CAE9C,EAAE,CAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAY,GAAA,QAAA,CAAS,YAAY;AACvC,IAAA,MAAM,UAAa,GAAA,YAAA,EAAc,MAC7B,GAAA,MAAM,OAAQ,CAAA,GAAA;AAAA,MACZ,YAAA,CAAa,GAAI,CAAA,OAAO,IAAsB,KAAA;AAC5C,QAAI,IAAA;AACF,UAAM,MAAA,GAAA,GAAM,MAAM,MAAO,CAAA,iBAAA;AAAA,YACvB,IAAK,CAAA,SAAA;AAAA,YACL,IAAK,CAAA,IAAA;AAAA,YACL,IAAA,CAAK,IAAK,CAAA,CAAC,CAAK,IAAA;AAAA,WAClB;AACA,UAAO,OAAA;AAAA,YACL,GAAG,IAAA;AAAA,YACH,WACE,EAAA,GAAA,CAAI,KAAM,CAAA,mBAAA,EAAqB,MAAQ,EAAA,MAAA,GACrC,oBACF,CAAA,IACA,GAAI,CAAA,KAAA,CAAM,mBAAqB,EAAA,MAAA,EAAQ,WACvC,IAAA,EAAA;AAAA,YACF,SACE,GAAI,CAAA,KAAA,CAAM,mBAAqB,EAAA,MAAA,EAAQ,QAAQ,OAAW,IAAA,EAAA;AAAA,YAC5D,MAAM,cAAe,CAAA,GAAA,CAAI,KAAM,CAAA,mBAAA,EAAqB,IAAI,CAAK,IAAA;AAAA,WAC/D;AAAA,SACM,CAAA,MAAA;AACN,UAAO,OAAA,IAAA;AAAA;AACT,OACD;AAAA,QAEH,EAAC;AACL,IAAA,mBAAA,CAAoB,UAAU,CAAA;AAAA,GAChC,EAAG,CAAC,YAAY,CAAC,CAAA;AAEjB,EAAO,OAAA,EAAE,OAAS,EAAA,oBAAA,EAAsB,gBAAiB,EAAA;AAC3D;;;;"}
1
+ {"version":3,"file":"useImageStreamsMetadataFromTag.esm.js","sources":["../../src/hooks/useImageStreamsMetadataFromTag.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { openshiftImageRegistryApiRef } from '../api';\nimport { ImageStream, ImageStreamMetadata } from '../types';\nimport { formatByteSize } from '../utils';\n\nexport const useImageStreamsMetadataFromTag = (imageStreams: ImageStream[]) => {\n const client = useApi(openshiftImageRegistryApiRef);\n const [imageStreamsData, setImageStreamsData] = useState<\n ImageStreamMetadata[]\n >([]);\n\n const { loading } = useAsync(async () => {\n const imgStsData = imageStreams?.length\n ? await Promise.all(\n imageStreams.map(async (imst: ImageStream) => {\n try {\n const tag = await client.getImageStreamTag(\n imst.namespace,\n imst.name,\n imst.tags[0] || '',\n );\n return {\n ...imst,\n description:\n tag.image.dockerImageMetadata?.Config?.Labels?.[\n 'io.k8s.description'\n ] ||\n tag.image.dockerImageMetadata?.Config?.description ||\n '',\n version:\n tag.image.dockerImageMetadata?.Config?.Labels?.version || '',\n size: formatByteSize(tag.image.dockerImageMetadata?.Size) || '',\n };\n } catch {\n return imst;\n }\n }),\n )\n : [];\n setImageStreamsData(imgStsData);\n }, [imageStreams]);\n\n return { loading, imageStreamsMetadata: imageStreamsData };\n};\n"],"names":[],"mappings":";;;;;;AAyBa,MAAA,8BAAA,GAAiC,CAAC,YAAgC,KAAA;AAC7E,EAAM,MAAA,MAAA,GAAS,OAAO,4BAA4B,CAAA;AAClD,EAAA,MAAM,CAAC,gBAAkB,EAAA,mBAAmB,CAAI,GAAA,QAAA,CAE9C,EAAE,CAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAY,GAAA,QAAA,CAAS,YAAY;AACvC,IAAA,MAAM,UAAa,GAAA,YAAA,EAAc,MAC7B,GAAA,MAAM,OAAQ,CAAA,GAAA;AAAA,MACZ,YAAA,CAAa,GAAI,CAAA,OAAO,IAAsB,KAAA;AAC5C,QAAI,IAAA;AACF,UAAM,MAAA,GAAA,GAAM,MAAM,MAAO,CAAA,iBAAA;AAAA,YACvB,IAAK,CAAA,SAAA;AAAA,YACL,IAAK,CAAA,IAAA;AAAA,YACL,IAAA,CAAK,IAAK,CAAA,CAAC,CAAK,IAAA;AAAA,WAClB;AACA,UAAO,OAAA;AAAA,YACL,GAAG,IAAA;AAAA,YACH,WACE,EAAA,GAAA,CAAI,KAAM,CAAA,mBAAA,EAAqB,MAAQ,EAAA,MAAA,GACrC,oBACF,CAAA,IACA,GAAI,CAAA,KAAA,CAAM,mBAAqB,EAAA,MAAA,EAAQ,WACvC,IAAA,EAAA;AAAA,YACF,SACE,GAAI,CAAA,KAAA,CAAM,mBAAqB,EAAA,MAAA,EAAQ,QAAQ,OAAW,IAAA,EAAA;AAAA,YAC5D,MAAM,cAAe,CAAA,GAAA,CAAI,KAAM,CAAA,mBAAA,EAAqB,IAAI,CAAK,IAAA;AAAA,WAC/D;AAAA,SACM,CAAA,MAAA;AACN,UAAO,OAAA,IAAA;AAAA;AACT,OACD;AAAA,QAEH,EAAC;AACL,IAAA,mBAAA,CAAoB,UAAU,CAAA;AAAA,GAChC,EAAG,CAAC,YAAY,CAAC,CAAA;AAEjB,EAAO,OAAA,EAAE,OAAS,EAAA,oBAAA,EAAsB,gBAAiB,EAAA;AAC3D;;;;"}
@@ -0,0 +1,9 @@
1
+ import { filesize } from 'filesize';
2
+
3
+ function formatByteSize(sizeInBytes) {
4
+ if (!sizeInBytes) return "N/A";
5
+ return filesize(sizeInBytes);
6
+ }
7
+
8
+ export { formatByteSize };
9
+ //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { filesize } from 'filesize';\n\nexport function formatByteSize(sizeInBytes: number | undefined): string {\n if (!sizeInBytes) return 'N/A';\n\n return filesize(sizeInBytes);\n}\n"],"names":[],"mappings":";;AAiBO,SAAS,eAAe,WAAyC,EAAA;AACtE,EAAI,IAAA,CAAC,aAAoB,OAAA,KAAA;AAEzB,EAAA,OAAO,SAAS,WAAW,CAAA;AAC7B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-openshift-image-registry",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -45,6 +45,7 @@
45
45
  "@material-ui/core": "^4.9.13",
46
46
  "@material-ui/icons": "^4.11.3",
47
47
  "@material-ui/lab": "^4.0.0-alpha.45",
48
+ "filesize": "^10.1.6",
48
49
  "react-use": "^17.4.0"
49
50
  },
50
51
  "peerDependencies": {