mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 09:12:45 +08:00
DEV: Fix various frontend warnings (#17122)
3 computed property overrides and a tippy warning
This commit is contained in:
parent
f27f95b2e9
commit
79d3b25d97
|
@ -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(
|
const instance = tippy(
|
||||||
document
|
target,
|
||||||
.getElementById(this.componentId)
|
|
||||||
.querySelector(
|
|
||||||
':scope > .d-popover-trigger, :scope > .btn, :scope > [role="button"]'
|
|
||||||
),
|
|
||||||
Object.assign({}, baseOptions, this.options || {})
|
Object.assign({}, baseOptions, this.options || {})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
type="file"
|
type="file"
|
||||||
multiple="true"
|
multiple="true"
|
||||||
accept=".png,.gif">
|
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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -269,7 +269,7 @@ export function applyDefaultHandlers(pretender) {
|
||||||
return response(fixturesByUrl["/search.json"]);
|
return response(fixturesByUrl["/search.json"]);
|
||||||
} else if (request.queryParams.q === "discourse visited") {
|
} else if (request.queryParams.q === "discourse visited") {
|
||||||
const obj = JSON.parse(JSON.stringify(fixturesByUrl["/search.json"]));
|
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);
|
return response(obj);
|
||||||
} else if (
|
} else if (
|
||||||
request.queryParams.q === "discourse in:personal" ||
|
request.queryParams.q === "discourse in:personal" ||
|
||||||
|
|
|
@ -19,9 +19,7 @@ discourseModule("Integration | Component | d-navigation", function (hooks) {
|
||||||
const categories = this.site.categoriesList
|
const categories = this.site.categoriesList
|
||||||
.filter((category) => !category.parent_category_id)
|
.filter((category) => !category.parent_category_id)
|
||||||
.slice(0, 4);
|
.slice(0, 4);
|
||||||
this.site.setProperties({
|
this.site.setProperties({ categories });
|
||||||
categoriesList: categories,
|
|
||||||
});
|
|
||||||
this.currentUser.set(
|
this.currentUser.set(
|
||||||
"indirectly_muted_category_ids",
|
"indirectly_muted_category_ids",
|
||||||
categories.slice(0, 3).map((category) => category.id)
|
categories.slice(0, 3).map((category) => category.id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user