DEV: Fix various frontend warnings (#17122)

3 computed property overrides and a tippy warning
This commit is contained in:
Jarek Radosz 2022-06-17 13:45:05 +02:00 committed by GitHub
parent f27f95b2e9
commit 79d3b25d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

View File

@ -80,12 +80,18 @@ export default class DiscoursePopover extends Component {
},
};
const target = document
.getElementById(this.componentId)
.querySelector(
':scope > .d-popover-trigger, :scope > .btn, :scope > [role="button"]'
);
if (!target) {
return null;
}
const instance = tippy(
document
.getElementById(this.componentId)
.querySelector(
':scope > .d-popover-trigger, :scope > .btn, :scope > [role="button"]'
),
target,
Object.assign({}, baseOptions, this.options || {})
);

View File

@ -40,7 +40,7 @@
type="file"
multiple="true"
accept=".png,.gif">
{{d-button class="btn-primary" computedLabel=buttonLabel icon="plus" action=(action "chooseFiles") disabled=uploading}}
{{d-button class="btn-primary" translatedLabel=buttonLabel icon="plus" action=(action "chooseFiles") disabled=uploading}}
</div>
</div>
</div>

View File

@ -269,7 +269,7 @@ export function applyDefaultHandlers(pretender) {
return response(fixturesByUrl["/search.json"]);
} else if (request.queryParams.q === "discourse visited") {
const obj = JSON.parse(JSON.stringify(fixturesByUrl["/search.json"]));
obj.topics.firstObject.visited = true;
obj.topics.firstObject.last_read_post_number = 1;
return response(obj);
} else if (
request.queryParams.q === "discourse in:personal" ||

View File

@ -19,9 +19,7 @@ discourseModule("Integration | Component | d-navigation", function (hooks) {
const categories = this.site.categoriesList
.filter((category) => !category.parent_category_id)
.slice(0, 4);
this.site.setProperties({
categoriesList: categories,
});
this.site.setProperties({ categories });
this.currentUser.set(
"indirectly_muted_category_ids",
categories.slice(0, 3).map((category) => category.id)