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

feat(links): integrate app version and update link management #1826

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Red-Asuka
Copy link
Member

This pull request includes several changes to handle the application version dynamically and improve the localization of links based on the user's locale. The most important changes include importing the version from package.json, defining a global __APP_VERSION__ variable, and updating the useLinks composable to provide localized links.

Handling application version dynamically:

Localization improvements:

Other changes:

@Red-Asuka Red-Asuka added refactor Refactor code or architecture web MQTTX Web desktop MQTTX Desktop labels Dec 9, 2024
@Red-Asuka Red-Asuka added this to the v2.0.0-alpha.1 milestone Dec 9, 2024
@Red-Asuka Red-Asuka requested a review from ysfscream December 9, 2024 06:13
@Red-Asuka Red-Asuka self-assigned this Dec 9, 2024
Copy link
Member

@ysfscream ysfscream Dec 10, 2024

Choose a reason for hiding this comment

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

Adding a link 404 check, I think would make it even more complete and help validate doc links.

const checkLink = async (url) => {
  if (url === '') return true
  try {
    const { status } = await axios.head(url, { timeout: 30000 })
    return status >= 200 && status < 400
  } catch (error) {
    console.error(`error link url: ${url}`)
    return false
  }
}

Then use Promise.all() to check all links in parallel:

const results = await Promise.all(links.map((link) => checkLink(link)))
results.forEach((isValid) => {
  expect(isValid).toBe(true)
})

@ysfscream ysfscream merged commit d39c7c7 into dev/2.0.0 Dec 10, 2024
6 checks passed
@ysfscream ysfscream deleted the lyd/2.0.0 branch December 10, 2024 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop refactor Refactor code or architecture web MQTTX Web
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants