-
Notifications
You must be signed in to change notification settings - Fork 0
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
Identifying compositions by handler URI #123
base: master
Are you sure you want to change the base?
Conversation
… app to identify compositions by handler uris. Related issue: https://github.com/Starcounter/Blending/issues/422
df3b090
to
180f332
Compare
otherwise many WCT tests of starcounter-include fail
180f332
to
411a40a
Compare
because the changes in source code rely on it to work and the test fails because of an outdated fixture
…it with single expression
I included your requested changes and tested this out with the old and new blending app. Please re-review. |
There are 7 failing WCT tests with the following message:
To reproduce locally, follow the instruction from https://github.com/Starcounter/starcounter-include/blob/master/CONTRIBUTING.md#developing-the-element The problem comes from the line that begins with |
} | ||
const defaultViewHtmlsToBeRendered = | ||
compositionProvider.ActualViewUris.filter( | ||
x => !compositionProvider.ViewUris.includes(x.hasOwnProperty("BlendingUri") ? x.BlendingUri : x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for the path that contain BlendingUri
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today is @PatrykSzwer's last day, so he wont add anything but I may.
Can you add a test for the path that contain
BlendingUri
?
This whole section never had a single test. This PR does not make it much worse, but I agree tests should be added.
starcounter-include/starcounter-include.html
Lines 315 to 339 in e7a9b1e
const defaultViewHtmlsToBeRendered = | |
compositionProvider.ActualViewUris.filter( | |
x => !compositionProvider.ViewUris.includes(x.hasOwnProperty("BlendingUri") ? x.BlendingUri : x)) | |
.map(x => x.hasOwnProperty("ViewHtml") ? x.ViewHtml : x); | |
const keys = Object.keys(this.viewModel); | |
for (let key of keys) { | |
const scoped = this.viewModel[key]; | |
if (scoped && scoped.Html && defaultViewHtmlsToBeRendered.includes(scoped.Html)) { | |
if (this.defaultComposition) { | |
this.template.scopedNodes.forEach((nodes) => { | |
if (nodes.scope === key) { | |
nodes.forEach((node) => appendComposition(customComposition, node)); | |
} | |
}); | |
} | |
else { | |
// BUG,TODO (tomalec): looks like a bug | |
// This means that if there *is* a custom composition, but it does not cover all views, | |
// and it happend that none of the views had a default composition, | |
// we would discard custom composition and use default -> fallback | |
return false; | |
} | |
} | |
} |
Related issue: https://github.com/Starcounter/Blending/issues/422#issuecomment-451958858 p.2