| Commit-Queue | +1 |
dpapad@ for Lit migration context, iremuguz@ as code OWNER.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM with a couple nits and some minor questions.
private hasDataCollectorSelected(): boolean {
return this.dataCollectors_.some(collector => collector.isIncluded);
}Nit: Can probably inline this at line 85 directly now that is just a single line anyway?
protected onCopyUrlClick_() {
this.browserProxy_.generateCustomizedUrl(this.caseId_, this.dataCollectors_)
.then(this.onUrlGenerationResult_.bind(this));
}
protected onCopyTokenClick_() {
this.browserProxy_.generateSupportToken(this.dataCollectors_)
.then(this.onTokenGenerationResult_.bind(this));
}Optional: Use async/await?
this.dataCollectors_ = this.dataCollectors_.map(
item => ({...item, isIncluded: this.selectAll_}));Optional: Not sure if we have a preferred approach between the "immutable data pattern" or "mutate in-place and call `requestUpdate()`" approaches. Alternatively this could be as follows
```suggestion
for (const collector of this.dataCollectors_) {
collector.isIncluded = this.selectAll_;
}
this.requestUpdate();
```
this.onDataCollectorItemChange_();Having to call this manually is a bit against Lit reactive properties main philosophy of "reacting" to other state changes? Does this better belong as an "observer" in `willUpdate()` (possibly **not** guarded by any `changedProperties.has(...)` check to allow updating even when in-place updates happen) ?
this.onDataCollectorItemChange_();Same question here about whether calling this manually is aligned with Lit's philosophy.
const copyLinkButton = urlGenerator.shadowRoot.getElementById(
'copyURLButton')! as CrButtonElement;Let's change to `querySelector<TypeGoesHere>(...)` instead (here and elsewhere)?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
private hasDataCollectorSelected(): boolean {
return this.dataCollectors_.some(collector => collector.isIncluded);
}Nit: Can probably inline this at line 85 directly now that is just a single line anyway?
Done
protected onCopyUrlClick_() {
this.browserProxy_.generateCustomizedUrl(this.caseId_, this.dataCollectors_)
.then(this.onUrlGenerationResult_.bind(this));
}
protected onCopyTokenClick_() {
this.browserProxy_.generateSupportToken(this.dataCollectors_)
.then(this.onTokenGenerationResult_.bind(this));
}Rebekah PotterOptional: Use async/await?
Done
this.dataCollectors_ = this.dataCollectors_.map(
item => ({...item, isIncluded: this.selectAll_}));Optional: Not sure if we have a preferred approach between the "immutable data pattern" or "mutate in-place and call `requestUpdate()`" approaches. Alternatively this could be as follows
```suggestion
for (const collector of this.dataCollectors_) {
collector.isIncluded = this.selectAll_;
}
this.requestUpdate();
```
Done. I think it should be consistent and we do modify in place elsewhere in this file.
I've removed the requestUpdate() call since this is only called from within willUpdate().
Having to call this manually is a bit against Lit reactive properties main philosophy of "reacting" to other state changes? Does this better belong as an "observer" in `willUpdate()` (possibly **not** guarded by any `changedProperties.has(...)` check to allow updating even when in-place updates happen) ?
Done
Same question here about whether calling this manually is aligned with Lit's philosophy.
Done
const copyLinkButton = urlGenerator.shadowRoot.getElementById(
'copyURLButton')! as CrButtonElement;Let's change to `querySelector<TypeGoesHere>(...)` instead (here and elsewhere)?
it's not conditionally rendered, so I added it to the interface instead. Same for caseIdInput below.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
}`this.requestUpdate()` call missing?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
`this.requestUpdate()` call missing?
This is only called from within willUpdate(), so I think this should be unnecessary (the element is already about to render); WDYT?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Rebekah Potter`this.requestUpdate()` call missing?
This is only called from within willUpdate(), so I think this should be unnecessary (the element is already about to render); WDYT?
Ah I see, didn't realize that, and since it was named 'on...' I assumed was an event listener.
Optional: Maybe inline this in `willUpdate()` since it is not called anywhere else? This would reduce some of the indirection that led to my confusion.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |