Skip to content

Commit

Permalink
Fix quickpost (#695)
Browse files Browse the repository at this point in the history
* fix button spacing, rewrite to glimmer, and change the sorting method. \nthese are attempts at fixing the problems with the qp, they solve part of the problem but it seems that some issue with randomly reordering still remains

* fix sorting issue due to polling and pushing malformed dates to the store
  • Loading branch information
DrumsnChocolate authored May 9, 2023
1 parent 9ab4668 commit ad66d0a
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 183 deletions.
42 changes: 22 additions & 20 deletions app/components/quick-post.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class='card quickpost'>
<div class='progress bg-white'>
<div
class='progress-bar bg-{{progressBarClass}}'
style={{progressBarStyle}}
class='progress-bar bg-{{this.progressBarClass}}'
style={{this.progressBarStyle}}
role='progressbar'
aria-valuenow={{characterCountPercentage}}
aria-valuenow={{this.characterCountPercentage}}
aria-valuemin='0'
aria-valuemax='100'
></div>
Expand All @@ -13,46 +13,46 @@
<div class='card-block'>
<div class='p-3 pb-5'>
<div class='row pb-2'>
<LinkTo class="p-0 w-auto" @route='users.show' @model={{session.currentUser.id}}>
<LinkTo class="p-0 w-auto" @route='users.show' @model={{this.session.currentUser.id}}>
<img
class='profile-picture profile-picture-md ms-3 p-0'
alt='{{session.currentUser.fullName}}'
src='{{session.currentUser.avatarThumbUrlOrDefault}}'
alt='{{this.session.currentUser.fullName}}'
src='{{this.session.currentUser.avatarThumbUrlOrDefault}}'
/>
</LinkTo>
<Textarea
id='qp-inputfield'
@value={{newQpMessage}}
@value={{this.newQpMessage}}
rows={{4}}
class='col form-control ms-3 me-3 qp-inputfield'
placeholder={{welcomeText}}
placeholder={{this.welcomeText}}
minlength='1'
maxlength={{maxCharacters}}
maxlength={{this.maxCharacters}}
@enter='saveMessage'
/>
</div>

<div class='d-flex float-end'>
<span
class='qp-characters-indicator
{{if tooMuchText "text-danger" "text-muted"}}
{{unless currentCharacterCount "hidden"}}
{{if this.tooMuchText "text-danger" "text-muted"}}
{{unless this.currentCharacterCount "hidden"}}
pt-2 pe-3'
>
{{currentCharacterCount}}
{{this.currentCharacterCount}}
/
{{maxCharacters}}
{{this.maxCharacters}}
</span>

<QuickPostNotificationButton />

<BsDropdown class='ms-1 d-block' @closeOnMenuClick={{true}} as |dd|>
<dd.button @type='button' class="btn-default">
<dd.button @type='button' class='btn-default'>
<FaIcon @icon='face-smile' @prefix='far' />
</dd.button>
<dd.menu class='emoticon-holder card' as |menu|>
<div class='row gx-0'>
{{#each emoticons as |emoticon|}}
{{#each this.emoticons as |emoticon|}}
<div class='emoticon' {{action 'appendSmileyToText' emoticon}}>
{{emoticon}}
</div>
Expand All @@ -62,7 +62,7 @@
</BsDropdown>

<button
class='btn btn-primary ms-1 mb-3 {{if tooMuchText "disabled"}}'
class='btn btn-primary ms-1 mb-3 {{if this.tooMuchText "disabled"}}'
{{action 'saveMessage'}}
type='button'
>
Expand All @@ -71,7 +71,7 @@
</div>
</div>

{{#each sortedMessages as |message index|}}
{{#each this.sortedMessages as |message index|}}
<hr />
<div class='row qp-message p-3'>
<LinkTo class="p-0 w-auto" @route='users.show' @model={{message.author.id}}>
Expand All @@ -89,7 +89,9 @@
@model={{message.author.id}}
class='col w-auto'
>
<b class='text-sm text-muted'> {{message.author.fullNameWithNickname}} </b>
<b class='text-sm text-muted'>
{{message.author.fullNameWithNickname}}
</b>
</LinkTo>

<small class='text-muted pe-3 w-auto'>
Expand All @@ -110,8 +112,8 @@
</div>
{{/each}}

{{#if showLoaderButton}}
<div class="d-grid">
{{#if this.showLoaderButton}}
<div class='d-grid'>
<button
class='btn btn-sm btn-secondary btn-read-more mx-2'
{{action 'loadMore'}}
Expand Down
Loading

0 comments on commit ad66d0a

Please sign in to comment.