Skip to content

Render organizer message in CallListItem#1037

Open
MikaelJohnAndersson wants to merge 7 commits into
masterfrom
enhancement/CallList-organizer-msg
Open

Render organizer message in CallListItem#1037
MikaelJohnAndersson wants to merge 7 commits into
masterfrom
enhancement/CallList-organizer-msg

Conversation

@MikaelJohnAndersson

@MikaelJohnAndersson MikaelJohnAndersson commented Jan 23, 2020

Copy link
Copy Markdown
Contributor

This PR adds functionality for displaying the message to organizer in CallListItem.

Since message_to_organizer only is included in the data when retrieving a single call, CallListItem dispatches an action for retrieving additional data once the item is in view, displaying a loading (dots) animation while the request is pending.

In cases where there is no message_to_organizer data, a fallback message is rendered.

Examples of truncated message, full message and message placeholder:

Skärmavbild 2020-01-29 kl  13 22 34

Loading animation:

calllistitem-msg-loading

Closes #933

@jensborje

Copy link
Copy Markdown
Collaborator

Would it be possible to include a screenshot? I can't test it myself on my local machine atm.

@MikaelJohnAndersson

Copy link
Copy Markdown
Contributor Author

@jensborje Sure! I updated the PR with added screenshots.

@jensborje jensborje left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good! Well done!

@martinajsongren martinajsongren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I left a comment where you missed a semicolon.

Comment thread src/components/lists/items/CallListItem.jsx Outdated
);
}
else if (call.message_to_organizer && call.message_to_organizer.length > 180) {
messageContent = call.message_to_organizer.substr(0, 180) + '...';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this?

let len = 0;
messageContent = call.message_to_organizer.split(' ').filter(s => (len += s.length + 1) && len < 40).join(' ') + '...';

0% { content: '.'; }
33% { content: '..'; }
66% { content: '...'; }
99% { content: '.'; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render organizer message in CallList

4 participants