-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(demo): Add portal version selection dropdown #567
feat(demo): Add portal version selection dropdown #567
Conversation
demo/src/routes/menu/Versions.svelte
Outdated
const versionsParsed: Version[] = [{folder: 'latest', version: 'Latest'}]; | ||
|
||
onMount(() => { | ||
fetch('https://amadeusitgroup.github.io/AgnosUI/versions.json').then((res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking to add the pathToRoot/versions.json but it won't work on local (kinda useless but still interesting to have). WDYT?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #567 +/- ##
==========================================
+ Coverage 90.02% 90.20% +0.17%
==========================================
Files 111 111
Lines 3931 3931
Branches 729 787 +58
==========================================
+ Hits 3539 3546 +7
+ Misses 390 383 -7
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Instead of building the versions in the onMount of the Versions component, you could do like this: +layout.ts export const prerender = true;
export const load = async () => {
const versionFetch = await fetch('https://amadeusitgroup.github.io/AgnosUI/versions.json');
const versions = [{folder: 'main', version: 'PREVIEW'}].concat(await versionFetch.json());
versions[1].folder === 'latest';
return {
versions
};
} +layout.svelte <script>
export let data;
</script>
...
<Versions versions={data.versions} /> Versions.svelte <script>
interface Version {
folder: string;
version: string;
}
export let versions: Version[];
</script> |
demo/src/routes/menu/Versions.svelte
Outdated
<div class="nav-item ms-3"> | ||
<div class="dropdown"> | ||
<button | ||
class="btn nav-link dropdown-toggle align-items-center d-flex" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add the PREVIEW, targetting main, it could be good to change the styling of the button to make it clear to users it's not released yet.
Maybe something like this ?
<button
class="btn nav-link dropdown-toggle align-items-center d-flex {$currentVersion$.version === 'PREVIEW' ? 'badge text-bg-warning' : ''}"
></button>
898c661
to
44d6eb0
Compare
44d6eb0
to
e17549f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
No description provided.