Skip to content

Commit 0689dd8

Browse files
committed
Remove icon from appstore listing
1 parent af251de commit 0689dd8

File tree

5 files changed

+0
-71
lines changed

5 files changed

+0
-71
lines changed

packages/server-admin-ui/scss/_custom.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ form.rjsf div.row.array-item {
3434
text-wrap: balance; /* Fallback for older browsers */
3535
text-wrap: pretty; /* Future spec */
3636
}
37-
38-
.aspect-square {
39-
aspect-ratio: 1 / 1;
40-
}

packages/server-admin-ui/src/views/appstore/Apps/AppIcon.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/server-admin-ui/src/views/appstore/AppsList.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ import React, { useEffect, useState } from 'react'
22
import InfiniteScroll from 'react-infinite-scroll-component'
33
import { ListGroup, ListGroupItem } from 'reactstrap'
44
import ActionCellRenderer from './Grid/cell-renderers/ActionCellRenderer'
5-
import AppIcon from './Apps/AppIcon'
65

76
export function AppListItem(app) {
87
return (
98
<ListGroupItem className="p-3">
109
<div className="d-flex">
11-
<div className="flex-shrink-0 mr-3">
12-
<AppIcon {...app} />
13-
</div>
1410
<div className="d-md-flex align-items-center flex-grow-1">
1511
<div className="flex-grow-1 mr-3">
1612
<h4 className="text-dark mb-0">{app.name}</h4>

packages/server-admin-ui/src/views/appstore/appStore.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,6 @@
117117
justify-content: flex-end;
118118
}
119119

120-
.appicon,
121-
.appicon img {
122-
width: 72px;
123-
height: 72px;
124-
object-fit: contain;
125-
}
126-
127120
.cell-action {
128121
width: 160px;
129122

src/interfaces/appstore.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,6 @@ module.exports = function (app) {
144144
res.json(emptyAppStoreInfo(false))
145145
})
146146
})
147-
148-
app.get(`${SERVERROUTESPREFIX}/appstore/icon/*`, async (req, res) => {
149-
const name = req.params[0]
150-
151-
// Tell browser to cache this for 1 day
152-
res.setHeader('Cache-Control', 'public, max-age=86400, immutable')
153-
154-
try {
155-
const url = await getIconUrl(name)
156-
return res.redirect(url)
157-
} catch (err) {
158-
res.status(404).send(err.message)
159-
}
160-
})
161147
},
162148
stop: () => undefined
163149
}
@@ -407,20 +393,3 @@ module.exports = function (app) {
407393
function packageNameIs(name) {
408394
return (x) => x.package.name === name
409395
}
410-
411-
/* Fetches the package.json from NPM and uses unpkg.com to extract the image */
412-
async function getIconUrl(name) {
413-
const res = await fetch(`https://registry.npmjs.org/${name}`, {
414-
signal: AbortSignal.timeout(5000)
415-
})
416-
417-
if (!res.ok) throw new Error(`Failed to fetch package: ${res.statusText}`)
418-
419-
const data = await res.json()
420-
const version = data['dist-tags']['latest']
421-
const pkg = data.versions[version]
422-
const path = pkg.signalk?.appIcon
423-
if (!path) throw new Error('No icon path defined in package')
424-
425-
return `https://unpkg.com/${name}@${version}/public/${path}`
426-
}

0 commit comments

Comments
 (0)