Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[NEW] Support announcements #2514

Merged
merged 4 commits into from Jan 28, 2019

Conversation

blewjy
Copy link
Contributor

@blewjy blewjy commented Jan 24, 2019

@RocketChat/ios

Closes #1593.

Two main additions to the application:

  1. Announcement can be seen on ChannelActionsView as one of the channel's information. Placed between Description and Topic, similar to the desktop client.

annoucement-action-view

  1. Announcement can also be seen on the main chat view pinned to the top as a banner, similar to the desktop client as well. Implemented as a new UIView class, ChatAnnouncementView. This banner will follow the colour scheme of the current active theme, with the background being bannerBackground and label text auxiliaryText.

Light theme - iPhone XS Max
announcement-light

Dark theme - iPad Pro 12.9 inch (Please ignore the test channels... :P)
announcement-dark-ipad

Black theme - iPhone SE (also a deliberately long announcement to see the text formatting when the label overflows the screen.)
announcement-black-se

Lastly, I have also updated the subscription test to include testing for this new feature.

Please feel free to let me know if there are any changes to be made. Cheers!

@codecov
Copy link

codecov bot commented Jan 24, 2019

Codecov Report

Merging #2514 into develop will increase coverage by 0.13%.
The diff coverage is 86.95%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2514      +/-   ##
===========================================
+ Coverage    26.33%   26.46%   +0.13%     
===========================================
  Files          456      457       +1     
  Lines        16928    16957      +29     
===========================================
+ Hits          4458     4488      +30     
+ Misses       12470    12469       -1
Impacted Files Coverage Δ
...at/Models/Subscription/UnmanagedSubscription.swift 0% <ø> (ø) ⬆️
...ontrollers/Chat/ChannelActionsViewController.swift 0% <ø> (ø) ⬆️
Rocket.Chat/Models/Subscription/Subscription.swift 50% <ø> (ø) ⬆️
...Chat/Models/Mapping/SubscriptionModelMapping.swift 87.71% <100%> (+0.21%) ⬆️
...Chat/Controllers/Chat/MessagesViewController.swift 32.78% <85.71%> (-1.69%) ⬇️
Rocket.Chat/Views/Chat/ChatAnnouncementView.swift 86.66% <86.66%> (ø)
...ocket.Chat/Extensions/Models/ObjectExtension.swift 80% <0%> (-20%) ⬇️
...ontrollers/Base/Main/MainSplitViewController.swift 45% <0%> (-7.5%) ⬇️
...Managers/Model/MessageManager/MessageManager.swift 23.76% <0%> (-4.48%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 842b292...de54420. Read the comment docs.

Copy link
Contributor

@rafaelks rafaelks left a comment

Choose a reason for hiding this comment

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

It looks pretty nice, thank you very much for the PR! Just one small thing about translation. Thanks!

@@ -45,6 +46,10 @@ class ChannelActionsViewController: BaseViewController {
title: localized("chat.info.item.description"),
descriptionText: hasDescription ? subscription.roomDescription : localized("chat.info.item.no_description")
),
ChannelInfoDescriptionCellData(
title: "Announcement",
descriptionText: hasAnnouncement ? subscription.roomAnnouncement : "No announcement"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's localize the string "No announcement" please!

Copy link
Contributor Author

@blewjy blewjy Jan 25, 2019

Choose a reason for hiding this comment

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

@rafaelks Yes, I overlooked this! Am I supposed to add a string to each of the files and Google translate each language? Or do I just add the English version only?

Copy link
Contributor

Choose a reason for hiding this comment

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

@blewjy Just English is fine, you can just input the English translation in all other languages and you can use Sem anúncio for pt-BR 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rafaelks Done!

@rafaelks rafaelks added this to In progress in Cycle 13: 01/05 ~ 02/05 via automation Jan 25, 2019
@rafaelks rafaelks added this to the 3.3.0 milestone Jan 25, 2019
@@ -45,6 +46,10 @@ class ChannelActionsViewController: BaseViewController {
title: localized("chat.info.item.description"),
descriptionText: hasDescription ? subscription.roomDescription : localized("chat.info.item.no_description")
),
ChannelInfoDescriptionCellData(
title: localized("chat.info.item.announcement"),
descriptionText: hasAnnouncement ? subscription.roomAnnouncement : localized("chat.info.item.no_announcement")

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 134 characters (line_length)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected.

@rafaelks
Copy link
Contributor

@blewjy Thank you!!! 👍

@rafaelks rafaelks merged commit 92cb228 into RocketChat:develop Jan 28, 2019
Cycle 13: 01/05 ~ 02/05 automation moved this from In progress to Done Jan 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants