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

fix: do not lose meta.url if it is specified and apply base host to all urls in meta #583

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

shadowusr
Copy link
Member

@shadowusr shadowusr commented Jul 31, 2024

What's done:

  • fixed a critical bug in suites rendering (not updating section height)
  • now base host is applied to all urls in meta info
  • now we respect meta.url when writing it to DB (previously if some other plugins modified meta.url, we just lost it before writing to db and used suite.url instead)

Copy link
Contributor

@Kabir-Ivan Kabir-Ivan left a comment

Choose a reason for hiding this comment

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

Looks ok

lib/static/components/suites.jsx Show resolved Hide resolved
@@ -95,8 +95,19 @@ class MetaInfoContent extends Component {
formattedMetaInfo[key] = {content: formattedMetaInfo[key]};
});

if (result.suiteUrl) {
formattedMetaInfo.url = {content: result.metaInfo.url || result.suiteUrl, url: getUrlWithBase(result.suiteUrl, baseHost)};
for (const [key, value] of Object.entries(formattedMetaInfo)) {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I'm not sure that we should replace base host for all urls in meta. I believe that by default it should only be used for url field and other fields should be specified by user through metaInfoBaseUrls option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now we apply baseHost only if metaInfoBaseUrls was set to 'auto'.

@shadowusr shadowusr force-pushed the users/shadowusr/INFRADUTY-27411 branch from 4ef266d to 67c7e51 Compare August 1, 2024 11:39
Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

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

🔥

@shadowusr shadowusr force-pushed the users/shadowusr/INFRADUTY-27411 branch from 67c7e51 to 346fdbc Compare August 1, 2024 12:16
@shadowusr shadowusr merged commit ad29f91 into master Aug 1, 2024
4 checks passed
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.

3 participants