From 300e47cfb3e9b017970afe2630708b609f36ed61 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:33:49 -0500 Subject: [PATCH] Fix editing tags (#117) `tagLabel` expects an object with an isChild method, so we can just wrap needed data in a Tag object. We don't want to update `this.tag`, since that would mess things up if the user exits the modal without saving. --- .../js/src/admin/components/EditTagModal.js | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/extensions/tags/js/src/admin/components/EditTagModal.js b/extensions/tags/js/src/admin/components/EditTagModal.js index acd2cd3f4..81d3aa95b 100644 --- a/extensions/tags/js/src/admin/components/EditTagModal.js +++ b/extensions/tags/js/src/admin/components/EditTagModal.js @@ -31,11 +31,7 @@ export default class EditTagModal extends Modal { title() { return this.name() - ? tagLabel({ - name: this.name, - color: this.color, - icon: this.icon, - }) + ? tagLabel(app.store.createRecord('tags', { attributes: this.submitData() })) : app.translator.trans('flarum-tags.admin.edit_tag.title'); } @@ -57,36 +53,36 @@ export default class EditTagModal extends Modal { { this.name(e.target.value); this.slug(slug(e.target.value)); - }}/> + }} /> , 50); items.add('slug',
- +
, 40); items.add('description',
-