Skip to content

Commit

Permalink
Merge pull request #374 from pagopa/fix-spid-images
Browse files Browse the repository at this point in the history
fix: SPID logo retrieval
  • Loading branch information
shadowsheep1 authored May 3, 2024
2 parents 465d53c + 38bda48 commit 80403a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Binary file added assets/spid/idps/spid-idp-etnaid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/spid/idps/spid-idp-infocamereid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/spid/idps/spid-idp-intesigroupspid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/spid/idps/spid-idp-teamsystemid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/routers/services_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,14 @@ addHandler(
},
idps => {
// set the logo url as server local resource
const idpsWithLogo = idps.items.map(idp => ({
...idp,
logo: `${serverUrl}${staticContentRootPath}/logos/spid/idps/spid-idp-${idp.id}.png`
}));
const idpsWithLogo = idps.items.map(idp => {
const urlSegments = idp.logo.split("/");
const logoImageName = urlSegments[urlSegments.length - 1];
return {
...idp,
logo: `${serverUrl}${staticContentRootPath}/logos/spid/idps/${logoImageName}`
};
});
res.json({ ...idps, items: idpsWithLogo });
}
)
Expand Down

0 comments on commit 80403a4

Please sign in to comment.