Skip to content

Migrate megamenu to universe-o-o#47

Draft
hellcp wants to merge 1 commit intoopenSUSE:masterfrom
hellcp:universe
Draft

Migrate megamenu to universe-o-o#47
hellcp wants to merge 1 commit intoopenSUSE:masterfrom
hellcp:universe

Conversation

@hellcp
Copy link
Copy Markdown
Member

@hellcp hellcp commented Nov 5, 2022

This introduces fetching resources for megamenu from the universe server set up in openSUSE/universe-o-o#1 (but not yet deployed)

Comment thread src/js/megamenu.js

fetch(languages[lang]).then(sections_response => {
return sections_response.json();
}).then(sections => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it always sends two HTTP requests. How about directly fetch /api/v0/sites-de.json. If the language doesn't exist, let Apache/Nginx to redirect to /api/v0/sites-en.json.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the issue is that we don't know if the language on the server side is xx_YY or xx, so we would need to make two requests that way as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants