Skip to content

Commit

Permalink
chore(backport release-0.8): fix(ui): stop relying on deprecated fiel…
Browse files Browse the repository at this point in the history
…d in images table (#2345)

Co-authored-by: Remington Breeze <[email protected]>
  • Loading branch information
akuitybot and rbreeze authored Jul 24, 2024
1 parent 46d2cf0 commit 94204c6
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions ui/src/features/project/pipelines/images.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,25 @@ export const Images = ({
const images = useMemo(() => {
const images = new Map<string, Map<string, StageStyleMap>>();
stages.forEach((stage) => {
const len = stage.status?.history?.length || 0;
stage.status?.history?.forEach((freight, i) => {
freight.images?.forEach((image) => {
let repo = image.repoURL ? images.get(image.repoURL) : undefined;
if (!repo) {
repo = new Map<string, StageStyleMap>();
images.set(image.repoURL!, repo);
}
let curStages = image.tag ? repo.get(image.tag) : undefined;
if (!curStages) {
curStages = {} as StageStyleMap;
}
curStages[stage.metadata?.name as string] = {
opacity: 1 - i / len,
backgroundColor: colors[stage.metadata?.name as string]
};
repo.set(image.tag!, curStages);
const len = stage.status?.freightHistory?.length || 0;
stage.status?.freightHistory?.forEach((freightGroup, i) => {
(Object.values(freightGroup.items || {}) || []).forEach((freight) => {
freight.images?.forEach((image) => {
let repo = image.repoURL ? images.get(image.repoURL) : undefined;
if (!repo) {
repo = new Map<string, StageStyleMap>();
images.set(image.repoURL!, repo);
}
let curStages = image.tag ? repo.get(image.tag) : undefined;
if (!curStages) {
curStages = {} as StageStyleMap;
}
curStages[stage.metadata?.name as string] = {
opacity: 1 - i / len,
backgroundColor: colors[stage.metadata?.name as string]
};
repo.set(image.tag!, curStages);
});
});
});

Expand Down

0 comments on commit 94204c6

Please sign in to comment.