Suppress missing template warning #16273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This suppresses the missing template warning by using a render function to generate a valid vnode.
Fixes #16236
Occurred changes and/or fixed issues
Technical notes summary
The render function with a valid v-node technically renders a div. This shouldn't have an effect on the rendered output of the component since the
beforeCreate()hook acts as a router guard to update the route before anything renders to the page.I considered moving the entirety of the logic into
shell/config/router/routes.js, but the reliance on the store has carries more risk for regression.Areas or cases that should be tested
Navigate to the settings page. Warning should be suppressed and the page renders as expected.
Areas which could experience regressions
This could technically render a page with an empty div in the setting page if the routing fails, but this would not be any different from the existing behavior.
Screenshot/Video
NA
Checklist
Admin,Standard UserandUser Base