Frontend Refactor#59
Conversation
|
@dsevillamartin I would be glad if you could also take a glance at this, particularly the changes in the |
dsevillamartin
left a comment
There was a problem hiding this comment.
Overall looks good, haven't tested locally though.
| import type User from 'flarum/common/models/User'; | ||
|
|
||
| export default function addBioToUserCard() { | ||
| extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>) { |
There was a problem hiding this comment.
I'd type this in the function itself - I believe this should work. (Does UserCard not have the attributes typed?)
| extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>) { | |
| extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>, this: any) { |
| */ | ||
| this.textareaRows = '5'; | ||
| export default class UserBio extends Component<UserBioAttrs> { | ||
| editing: boolean = false; |
There was a problem hiding this comment.
I'm not sure if having values moved from oninit to instance creation causes any issues or not... theoretically oninit should only be called once, and since these are primitives it shouldn't really matter as there are no side effects? Just some thoughts.
| const index = lengthBefore + lineIndex; | ||
|
|
||
| // Show the same number of lines to avoid layout shift | ||
| // @ts-ignore |
There was a problem hiding this comment.
Why are all these ts-ignores necessary?
|
Please note a minor change I made today in the released version: user-bio/js/src/forum/components/UserBio.js Line 117 in f30b872 (added |
Fixes #0000
Changes proposed in this pull request:
Reviewers should focus on:
Screenshot
Confirmed
composer test).Required changes: