@red-hat-developer-hub/backstage-plugin-openshift-image-registry 1.13.1 → 1.13.2
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,13 @@
|
|
|
1
1
|
### Dependencies
|
|
2
2
|
|
|
3
|
+
## 1.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a79f849: Updated dependency `prettier` to `3.6.2`.
|
|
8
|
+
- b3427dd: Updated dependency `@red-hat-developer-hub/backstage-plugin-theme` to `^0.9.0`.
|
|
9
|
+
- 25866e2: Aligned `formatDate` utility with `ADR012 using Luxon`.
|
|
10
|
+
|
|
3
11
|
## 1.13.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -117,7 +125,6 @@
|
|
|
117
125
|
### Minor Changes
|
|
118
126
|
|
|
119
127
|
- 15d2695: Rebased with latest changes from janus-idp/backstage-plugins:
|
|
120
|
-
|
|
121
128
|
- update to backstage 1.31
|
|
122
129
|
- upgrade to yarn v3
|
|
123
130
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState, useMemo } from 'react';
|
|
2
2
|
import { useAsync } from 'react-use';
|
|
3
3
|
import { useApi } from '@backstage/core-plugin-api';
|
|
4
|
-
import { formatDate } from '@janus-idp/shared-react';
|
|
5
4
|
import { openshiftImageRegistryApiRef } from '../api/index.esm.js';
|
|
5
|
+
import { formatDate } from '../utils.esm.js';
|
|
6
6
|
|
|
7
7
|
const useAllNsImageStreams = () => {
|
|
8
8
|
const client = useApi(openshiftImageRegistryApiRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAllNsImageStreams.esm.js","sources":["../../src/hooks/useAllNsImageStreams.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 { useMemo, useState } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useAllNsImageStreams.esm.js","sources":["../../src/hooks/useAllNsImageStreams.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 { useMemo, useState } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { openshiftImageRegistryApiRef } from '../api';\nimport { ImageStream } from '../types';\nimport { formatDate } from '../utils';\n\nexport const useAllNsImageStreams = () => {\n const client = useApi(openshiftImageRegistryApiRef);\n const [imageStreams, setImageStreams] = useState<any[]>([]);\n\n const { loading } = useAsync(async () => {\n const imgSts = (await client.getAllImageStreams()) ?? [];\n setImageStreams(imgSts);\n });\n\n const imageStreamsData: ImageStream[] = useMemo(() => {\n if (imageStreams?.length) {\n return imageStreams.map((imgSt: any) => ({\n uid: imgSt.metadata.uid,\n name: imgSt.metadata.name,\n namespace: imgSt.metadata.namespace,\n last_modified: imgSt.status?.tags?.[0]?.items?.[0]?.created\n ? formatDate(imgSt.status.tags[0].items[0].created)\n : '',\n tags: imgSt.status?.tags?.map((t: any) => t.tag) ?? [],\n dockerImageRepo: imgSt.status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AC,CAAA;AAEjB,EAAO,OAAA,EAAE,OAAS,EAAA,YAAA,EAAc,gBAAiB,EAAA;AACnD;;;;"}
|
package/dist/utils.esm.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { filesize } from 'filesize';
|
|
2
|
+
import { DateTime } from 'luxon';
|
|
2
3
|
|
|
3
4
|
function formatByteSize(sizeInBytes) {
|
|
4
5
|
if (!sizeInBytes) return "N/A";
|
|
5
6
|
return filesize(sizeInBytes);
|
|
6
7
|
}
|
|
8
|
+
function formatDate(date) {
|
|
9
|
+
if (!date || date === -1) {
|
|
10
|
+
return "N/A";
|
|
11
|
+
}
|
|
12
|
+
let dt;
|
|
13
|
+
if (typeof date === "number") {
|
|
14
|
+
dt = DateTime.fromSeconds(date);
|
|
15
|
+
} else if (date instanceof Date) {
|
|
16
|
+
dt = DateTime.fromJSDate(date);
|
|
17
|
+
} else if (/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun),/.test(date)) {
|
|
18
|
+
dt = DateTime.fromRFC2822(date);
|
|
19
|
+
} else {
|
|
20
|
+
dt = DateTime.fromISO(date);
|
|
21
|
+
}
|
|
22
|
+
if (!dt.isValid) {
|
|
23
|
+
return "N/A";
|
|
24
|
+
}
|
|
25
|
+
return dt.toLocaleString(DateTime.DATETIME_MED);
|
|
26
|
+
}
|
|
7
27
|
|
|
8
|
-
export { formatByteSize };
|
|
28
|
+
export { formatByteSize, formatDate };
|
|
9
29
|
//# sourceMappingURL=utils.esm.js.map
|
package/dist/utils.esm.js.map
CHANGED
|
@@ -1 +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":"
|
|
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';\nimport { DateTime } from 'luxon';\n\nexport function formatByteSize(sizeInBytes: number | undefined): string {\n if (!sizeInBytes) return 'N/A';\n\n return filesize(sizeInBytes);\n}\n\n/**\n * Formats a date using the Backstage-standard Luxon library.\n *\n * @param date - The date to format, can be a string, number (Unix timestamp), or Date object.\n * @returns A formatted date string (e.g., \"Jun 9, 2025, 6:15 PM\") or 'N/A'.\n */\nexport function formatDate(date: string | number | Date | undefined): string {\n if (!date || date === -1) {\n return 'N/A';\n }\n\n let dt: DateTime;\n\n if (typeof date === 'number') {\n dt = DateTime.fromSeconds(date);\n } else if (date instanceof Date) {\n dt = DateTime.fromJSDate(date);\n } else if (/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun),/.test(date)) {\n // Check if it's RFC 2822 format (starts with day name)\n dt = DateTime.fromRFC2822(date);\n } else {\n dt = DateTime.fromISO(date);\n }\n\n if (!dt.isValid) {\n return 'N/A';\n }\n return dt.toLocaleString(DateTime.DATETIME_MED);\n}\n"],"names":[],"mappings":";;;AAkBO,SAAS,eAAe,WAAyC,EAAA;AACtE,EAAI,IAAA,CAAC,aAAoB,OAAA,KAAA;AAEzB,EAAA,OAAO,SAAS,WAAW,CAAA;AAC7B;AAQO,SAAS,WAAW,IAAkD,EAAA;AAC3E,EAAI,IAAA,CAAC,IAAQ,IAAA,IAAA,KAAS,EAAI,EAAA;AACxB,IAAO,OAAA,KAAA;AAAA;AAGT,EAAI,IAAA,EAAA;AAEJ,EAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC5B,IAAK,EAAA,GAAA,QAAA,CAAS,YAAY,IAAI,CAAA;AAAA,GAChC,MAAA,IAAW,gBAAgB,IAAM,EAAA;AAC/B,IAAK,EAAA,GAAA,QAAA,CAAS,WAAW,IAAI,CAAA;AAAA,GACpB,MAAA,IAAA,iCAAA,CAAkC,IAAK,CAAA,IAAI,CAAG,EAAA;AAEvD,IAAK,EAAA,GAAA,QAAA,CAAS,YAAY,IAAI,CAAA;AAAA,GACzB,MAAA;AACL,IAAK,EAAA,GAAA,QAAA,CAAS,QAAQ,IAAI,CAAA;AAAA;AAG5B,EAAI,IAAA,CAAC,GAAG,OAAS,EAAA;AACf,IAAO,OAAA,KAAA;AAAA;AAET,EAAO,OAAA,EAAA,CAAG,cAAe,CAAA,QAAA,CAAS,YAAY,CAAA;AAChD;;;;"}
|
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.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@backstage/theme": "^0.6.6",
|
|
42
42
|
"@emotion/styled": "^11.13.0",
|
|
43
43
|
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
|
|
44
|
-
"@janus-idp/shared-react": "2.18.0",
|
|
45
44
|
"@material-ui/core": "^4.9.13",
|
|
46
45
|
"@material-ui/icons": "^4.11.3",
|
|
47
46
|
"@material-ui/lab": "^4.0.0-alpha.45",
|
|
48
47
|
"filesize": "^10.1.6",
|
|
48
|
+
"luxon": "^3.6.1",
|
|
49
49
|
"react-use": "^17.4.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"@backstage/test-utils": "^1.7.8",
|
|
61
61
|
"@janus-idp/cli": "1.19.1",
|
|
62
62
|
"@mui/icons-material": "^6.1.6",
|
|
63
|
-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.
|
|
63
|
+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.9.0",
|
|
64
64
|
"@spotify/prettier-config": "^15.0.0",
|
|
65
65
|
"@testing-library/jest-dom": "6.6.3",
|
|
66
66
|
"@testing-library/react": "14.3.1",
|
|
67
67
|
"@testing-library/user-event": "14.6.1",
|
|
68
68
|
"cross-fetch": "4.1.0",
|
|
69
69
|
"msw": "1.3.5",
|
|
70
|
-
"prettier": "3.
|
|
70
|
+
"prettier": "3.6.2"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"dist",
|