Skip to content

Conversation

@ignatevdev
Copy link

@ignatevdev ignatevdev commented Dec 19, 2019

Description

Currently currentServer prop doesn't update if user has switched to another definition.
This causes a bug where "Computed URL" block gets rendered if you opened a direct URL to the correct scheme, but doesn't render if you have opened the scheme from the "Select a definition" dropdown.

I have added a condition which checks whether servers prop has changed, which get's triggered upon the definition change.

How Has This Been Tested?

This has been tested locally on our current set of documentation files, where one file includes a server without a version, and another - with a version.

Previously switching to the scheme with a version would not render a "Computed URL" block.
After the changes - it does.

Screenshots (if appropriate):

Current behaviour:
gif2

After the fix:
gif3

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

Copy link
Contributor

@tim-lai tim-lai left a comment

Choose a reason for hiding this comment

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

@ignatevdev Hi, thanks for the PR! I know it's been awhile but if you can update this PR to only contain the changed file (do not include /dist), I would be happy to re-review and merge.

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