Skip to content

Commit

Permalink
[Docs] Fixed integration icons in docs (#817)
Browse files Browse the repository at this point in the history
# Description

What - Fixed integration icons in docs
Why - Was changed due to new structure
How - Fixed index.tsx icon parsing

## Type of change

Please leave one option from the following and delete the rest:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation (added/updated documentation)

## Screenshots


![image](https://github.com/user-attachments/assets/c9d30d70-72f8-4186-9506-b95645c06bfb)
  • Loading branch information
matan84 authored Jul 15, 2024
1 parent bca5abe commit 3c2a4c7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions docs/framework-guides/src/components/Integrations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,19 @@ function Index(props): JSX.Element {

const loadIntegrations = async () => {
try {
const colorParams = new URLSearchParams({
const appsParams = new URLSearchParams({
"list-type": '2',
prefix: `icons/blueprintsColor`
})
const colorlessParams = new URLSearchParams({
"list-type": '2',
prefix: `icons/blueprints`
prefix: `icons/apps`
})

const [colorResponse, colorlessResponse, integrationsResponse] = await Promise.all([
fetch(`${BUCKET_URL}?` + colorParams),
fetch(`${BUCKET_URL}?` + colorlessParams),
const [appsResponse, integrationsResponse] = await Promise.all([
fetch(`${BUCKET_URL}?` + appsParams),
fetch('https://ocean-registry.s3.eu-west-1.amazonaws.com/index.json')
])
const integrations = await integrationsResponse.json();
const [colorResult, colorlessResult] = await Promise.all([parseStringPromise(await colorResponse.text()), parseStringPromise(await colorlessResponse.text())])
const appsResult = await parseStringPromise(await appsResponse.text())

const iconInS3 = [colorResult, colorlessResult].flatMap(item => item.ListBucketResult.Contents.map((content) => {
const iconInS3 = [appsResult].flatMap(item => item.ListBucketResult.Contents.map((content) => {
const key = content.Key[0]
const name = key.split("/").pop().split(".")[0];
return [name, key]
Expand Down

0 comments on commit 3c2a4c7

Please sign in to comment.