[REF] web: remove unused props in TagsList

Some props like className were declared as optional in TagsList while
they are not used by the component. We remove them from the props
declaration.

Part-of: odoo/odoo#126350
This commit is contained in:
Mathieu Duckerts-Antoine
2023-07-03 16:58:55 +02:00
parent 2b23f73f51
commit b72791f05b
5 changed files with 2 additions and 10 deletions
@@ -14,7 +14,6 @@
<t t-name="mail.ListMany2ManyTagsAvatarUserField" t-inherit="web.Many2ManyTagsAvatarField" t-inherit-mode="primary" owl="1">
<TagsList position="attributes">
<attribute name="displayBadge">!props.readonly</attribute>
<attribute name="displayText">displayText</attribute>
</TagsList>
</t>
@@ -23,7 +23,6 @@ export class RecordsSelector extends Component {
return this.props.resIds.map((id) => ({
text: this.displayNames[id],
onDelete: () => this.removeRecord(id),
displayBadge: true,
}));
}
@@ -5,12 +5,9 @@ import { Component } from "@odoo/owl";
export class TagsList extends Component {
static template = "web.TagsList";
static defaultProps = {
displayBadge: true,
displayText: true,
};
static props = {
className: { type: String, optional: true },
displayBadge: { type: Boolean, optional: true },
displayText: { type: Boolean, optional: true },
itemsVisible: { type: Number, optional: true },
tags: { type: Object },
@@ -3,7 +3,7 @@
<t t-name="web.KanbanMany2ManyTagsField" owl="1">
<div class="d-flex flex-wrap gap-1">
<TagsList className="'o_kanban_tags'" tags="tags" displayBadge="false"/>
<TagsList tags="tags"/>
</div>
</t>
</templates>
@@ -3,10 +3,7 @@
<t t-name="web.PropertyTags" owl="1">
<!-- Copy many2many tags style without duplicating all the CSS -->
<div t-attf-class="o_field_property_tag o_field_widget o_field_many2many_tags d-flex {{props.readonly ? 'readonly' : ''}}">
<TagsList
tags="tagListItems"
displayBadge="displayBadge"
className="props.canChangeTags ? '' : 'o_field_property_tag_readonly'"/>
<TagsList tags="tagListItems"/>
<div
t-if="!props.readonly"
class="o_field_property_dropdown_menu o_input_dropdown">