KaotoIO / kaoto

Next version of the UI of the Kaoto project
Apache License 2.0
22 stars 21 forks source link

feat(Settings): Add Settings Page #1201

Closed lordrip closed 20 hours ago

lordrip commented 4 days ago

Context

In the scope of selecting the Runtime in use, a settings page pointing to a catalog URL is needed.

This commit adds a Settings component and a Settings provider. By default, it will store the settings in the browser's LocalStorage.

The idea behind using a SettingsAdapter is to give the possibility to set the settings at the VSCode level if needed.

How to test

For setting a remote catalog you could use: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main as URL

fix: https://github.com/KaotoIO/kaoto/issues/834

apupier commented 2 days ago

I think either we need to keep the index.json or use the non-raw url because there is no way in the UI to get the described url directly. i tis even giving a 400 Invalid request

So either:

lordrip commented 1 day ago

for another iteration:

* check all camel catalog entries, it currently checks only the first one. The error on an entry catalog appears only when trying to load the catalog later. it might be anothe rbutton to call validate/Load test explicitely to avo  dthat it take too much time.

Is that still happening? image

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me, as soon as you save it, the page gets refreshed, and if there's an error, it offers a mechanism to go back: image

apupier commented 1 day ago

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me

it works to load it in Kaoto. it gives an error when accessing directly in the browser.

lordrip commented 1 day ago

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me

it works to load it in Kaoto. it gives an error when accessing directly in the browser.

ah, yes, I think is because loading the URL would be a folder, so nothing to deliver from the CDN perspective, but in Kaoto, we use this to build the final index.json URL

https://github.com/KaotoIO/kaoto/pull/1201/files#diff-c8639e81b24a2fc657a86f21762476165dc395c2b57841851321c61775ac6189R36

apupier commented 1 day ago

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me

it works to load it in Kaoto. it gives an error when accessing directly in the browser.

ah, yes, I think is because loading the URL would be a folder, so nothing to deliver from the CDN perspective, but in Kaoto, we use this to build the final index.json URL

https://github.com/KaotoIO/kaoto/pull/1201/files#diff-c8639e81b24a2fc657a86f21762476165dc395c2b57841851321c61775ac6189R36

my point is that it makes things more complicated for end-users to stripe out the index.json than requiring it

lordrip commented 1 day ago

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me

it works to load it in Kaoto. it gives an error when accessing directly in the browser.

ah, yes, I think is because loading the URL would be a folder, so nothing to deliver from the CDN perspective, but in Kaoto, we use this to build the final index.json URL https://github.com/KaotoIO/kaoto/pull/1201/files#diff-c8639e81b24a2fc657a86f21762476165dc395c2b57841851321c61775ac6189R36

my point is that it makes things more complicated for end-users to stripe out the index.json than requiring it

Ah, absolutely, got it, I'll adapt it to use the URL as an entry point directly then, so if someone wants to have index.json named differently for whatever reason, it can be done.

Initially, I wasn't sure what was the best way to expose this information, so I kept the same approach.

lordrip commented 21 hours ago

Using the following URL: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/ works for me

it works to load it in Kaoto. it gives an error when accessing directly in the browser.

ah, yes, I think is because loading the URL would be a folder, so nothing to deliver from the CDN perspective, but in Kaoto, we use this to build the final index.json URL https://github.com/KaotoIO/kaoto/pull/1201/files#diff-c8639e81b24a2fc657a86f21762476165dc395c2b57841851321c61775ac6189R36

my point is that it makes things more complicated for end-users to stripe out the index.json than requiring it

Ah, absolutely, got it, I'll adapt it to use the URL as an entry point directly then, so if someone wants to have index.json named differently for whatever reason, it can be done.

Initially, I wasn't sure what was the best way to expose this information, so I kept the same approach.

I updated the PR to use the index.json file directly: https://raw.githubusercontent.com/lordrip/kaoto-catalog-test/main/index.json