Skip to content
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

Use a fallback for reference filters for unpublished content #725

Closed
wenche opened this issue Jan 11, 2022 · 4 comments
Closed

Use a fallback for reference filters for unpublished content #725

wenche opened this issue Jan 11, 2022 · 4 comments
Assignees
Labels
🐛 bug Something isn't working 👨‍💻 planning 🛠 technical Technical stuffs like reducing debt, refactor or improve code base

Comments

@wenche
Copy link
Contributor

wenche commented Jan 11, 2022

Description

Since the intl plugin for whatever reason adds the intl fields (_intl: en_GB) on publishing for the base language, we need a fallback to be able to filter references for unpublished content. Could we just use the base language as the fallback if there's no _lang value? (We will then need a more robust way to define the base language)

Skjermbilde 2022-01-11 kl. 14.19.08.pngSkjermbilde 2022-01-11 kl. 14.20.02.png

Examples of the errors I see

Runtime error (will add a guard here)
Skjermbilde 2022-01-11 kl. 14.23.30.png
Mix of Norwegian and English references
Skjermbilde 2022-01-11 kl. 14.24.57.png

@wenche wenche added the 🐛 bug Something isn't working label Jan 11, 2022
@adneforslund adneforslund self-assigned this Jan 27, 2022
@nilsml
Copy link
Contributor

nilsml commented Jan 31, 2022

Ask Simeon in the weekly meeting about this

@adneforslund adneforslund removed their assignment Feb 1, 2022
@fernandolucchesi fernandolucchesi self-assigned this Feb 9, 2022
@wenche
Copy link
Contributor Author

wenche commented Feb 9, 2022

We made a fallback in the landingPage.ts, I think we might just do it as simple as this...? Because the translated document will have the language information added when it's created, and not when it's published as with the base language :(
Skjermbilde 2022-02-09 kl. 09.07.03.png
Skjermbilde 2022-02-09 kl. 09.15.07.png

@wenche wenche added the 🛠 technical Technical stuffs like reducing debt, refactor or improve code base label Feb 9, 2022
@fernandolucchesi
Copy link
Contributor

@wenche, can you take a look at this? :)

@wenche
Copy link
Contributor Author

wenche commented Feb 10, 2022

Test

News

  • Internal link News EN -> reference to EN route and EN news

  • Internal link News NO -> reference to NO route and NO news

  • More on this topic link News NO -> reference to NO route and NO news

  • More on this topic News EN -> reference to EN route and EN news

  • Internal link Text block Topic EN -> reference to EN route and EN news

  • C2a link Text block Topic EN -> reference to EN route and EN news

  • Teaser link Topic EN -> reference to EN route and EN news

  • Accordion internal link Topic EN -> reference to EN route and EN news

  • Internal link Text block Topic NO -> reference to NO route and NO news

  • C2a link Text block Topic NO -> reference to NO route and NO news

  • Teaser link Topic NO -> reference to NO route and NO news

  • Accordion internal link Topic NO-> reference to NO route and NO news

Except for the gotcha with the translated document that does not respect the filters, this look really good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 👨‍💻 planning 🛠 technical Technical stuffs like reducing debt, refactor or improve code base
Projects
None yet
Development

No branches or pull requests

4 participants