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

Conversation

@filipealva
Copy link
Contributor

@filipealva filipealva commented Sep 18, 2018

@RocketChat/ios

This PR removes SlackTextViewController and introduces RocketChatViewController.

We'll open new PRs based on this branch to replace the implementations based on SLKTextViewController.

Closes #760
Closes #2179
Closes #2178
Closes #2216
Closes #2141
Closes #2025
Closes #2009
Closes #2008
Closes #1724

@filipealva filipealva added this to the 3.2.0 milestone Sep 18, 2018
@codecov
Copy link

codecov bot commented Sep 28, 2018

Codecov Report

Merging #2195 into develop will decrease coverage by 4.25%.
The diff coverage is 20.89%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2195      +/-   ##
===========================================
- Coverage    29.79%   25.53%   -4.26%     
===========================================
  Files          383      432      +49     
  Lines        14436    15869    +1433     
===========================================
- Hits          4301     4052     -249     
- Misses       10135    11817    +1682
Impacted Files Coverage Δ
...at/Views/Cells/Subscription/SubscriptionCell.swift 0% <ø> (ø) ⬆️
...cket.Chat/Views/Chat/New Chat/Cells/FileCell.swift 0% <ø> (ø)
...ews/Chat/New Chat/Cells/BaseImageMessageCell.swift 0% <ø> (ø)
...New Chat/Cells/BaseTextAttachmentMessageCell.swift 0% <ø> (ø)
...hat/Views/Cells/Hints/UserHintAvatarViewCell.swift 0% <ø> (ø)
Rocket.Chat/Views/Chat/KeyboardFrameView.swift 0% <ø> (-30%) ⬇️
Rocket.Chat/Models/Attachment/Attachment.swift 93.75% <ø> (ø)
...ews/Chat/New Chat/Cells/BaseVideoMessageCell.swift 0% <ø> (ø)
...Chat/Views/Chat/New Chat/Cells/ReactionsCell.swift 0% <ø> (ø)
.../Views/Chat/New Chat/Cells/DateSeparatorCell.swift 0% <ø> (ø)
... and 173 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 bb03b2e...bcb7dcb. Read the comment docs.

@rafaelks
Copy link
Contributor

rafaelks commented Oct 1, 2018

THIS IS GETTING REALLY NICE GUYS!!!

rafaelks and others added 23 commits October 5, 2018 22:43
…provements

[IMPROVEMENTS] Bug fixes & improvements on the new composer & components
[BUG] Duplicated data on receiving modifications from Realm
…a_from_remote

[BUG] Missing data on the list & fixed unit tests
…imes

[IMPROVEMENT] Performance improvements, code simplification & prefetch one more page from database
func fetchMessagesQueryResults() -> Results<Message> {
var filteredMessages = self.messages.filter("userBlocked == false")
func fetchMessagesQueryResults() -> Results<Message>? {
guard var filteredMessages = self.messages?.filter("userBlocked == false AND identifier != NULL AND createdAt != NULL") else {

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)

client.updateMessage(message, text: text)
}

}

Choose a reason for hiding this comment

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

File Line Length Violation: File should contain 400 lines or less: currently contains 513 (file_length)

import DifferenceKit
import RocketChatViewController

final class MessagesViewModel {

Choose a reason for hiding this comment

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

Type Body Length Violation: Type body should span 200 lines or less excluding comments and whitespace: currently spans 217 lines (type_body_length)

// This is because we can't extend generic classes with @objc methods
// Which doesn't allow us to do themes properly.
// In Swift 5 there's a better workaround:
// TODO: Make this an empty subclass when Swift 5 is released.

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Make this an empty subclass wh...). (todo)

// This is because we can't extend generic classes with @objc methods
// Which doesn't allow us to do themes properly.
// In Swift 5 there's a better workaround:
// TODO: Make this an empty subclass when Swift 5 is released.

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Make this an empty subclass wh...). (todo)

// This is because we can't extend generic classes with @objc methods
// Which doesn't allow us to do themes properly.
// In Swift 5 there's a better workaround:
// TODO: Make this an empty subclass when Swift 5 is released.

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Make this an empty subclass wh...). (todo)

}

chatViewController?.toggleActions()
// TODO: Replace for our composer

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Replace for our composer). (todo)

}

chatViewController?.toggleUpload()
// TODO: Replace for our composer

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Replace for our composer). (todo)

self?.chatViewController?.keyboardFrame?.updateFrame()
}
}
// TODO: Adjust for our own composer

Choose a reason for hiding this comment

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

Todo Violation: TODOs should be resolved (Adjust for our own composer). (todo)

// swiftlint:enable function_body_length

func sendMessage(text: String, subscription: Subscription, id: String = String.random(18), user: User? = AuthManager.currentUser(), realm: Realm? = Realm.current) {
func sendMessage(text: String, subscription: UnmanagedSubscription, id: String = String.random(18), user: User? = AuthManager.currentUser(), realm: Realm? = Realm.current) {

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'id' (identifier_name)
Line Length Violation: Line should be 120 characters or less: currently 177 characters (line_length)

/**
Called when the content size of the text view changes and adjusts the composer height constraint.
*/
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

Choose a reason for hiding this comment

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

Block Based KVO Violation: Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. (block_based_kvo)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 158 characters (line_length)

// leftButton constraints

leftButton.leadingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leadingAnchor, constant: layoutMargins.left),
leftButton.bottomAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.bottomAnchor, constant: -layoutMargins.bottom*2)

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 138 characters (line_length)

client.updateMessage(message, text: text)
}

}

Choose a reason for hiding this comment

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

File Line Length Violation: File should contain 400 lines or less: currently contains 511 (file_length)

import DifferenceKit
import RocketChatViewController

final class MessagesViewModel {

Choose a reason for hiding this comment

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

Type Body Length Violation: Type body should span 200 lines or less excluding comments and whitespace: currently spans 216 lines (type_body_length)

return 0
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {

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 162 characters (line_length)

return 0
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {

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 175 characters (line_length)


extension MessagesViewController {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {

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 170 characters (line_length)

collectionView.register(FileCell.nib, forCellWithReuseIdentifier: FileCell.identifier)
collectionView.register(FileMessageCell.nib, forCellWithReuseIdentifier: FileMessageCell.identifier)
collectionView.register(TextAttachmentCell.nib, forCellWithReuseIdentifier: TextAttachmentCell.identifier)
collectionView.register(TextAttachmentMessageCell.nib, forCellWithReuseIdentifier: TextAttachmentMessageCell.identifier)

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 128 characters (line_length)


var frame = buttonScrollToBottom.frame
frame.origin.x = collectionView.frame.width - buttonScrollToBottomSize - view.layoutMargins.right
frame.origin.y = collectionView.frame.origin.y + collectionView.frame.height - buttonScrollToBottomSize - collectionView.layoutMargins.top - composerView.frame.height

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 182 characters (line_length)

}

func animates(_ animations: @escaping VoidCompletion) {
UIView.animate(withDuration: 0.15, delay: 0, options: UIView.AnimationOptions(rawValue: 7 << 16), animations: {

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 127 characters (line_length)

private let buttonScrollToBottomSize = CGFloat(70)
lazy var buttonScrollToBottom: UIButton = {
let button = UIButton()
button.frame = CGRect(x: .greatestFiniteMagnitude, y: .greatestFiniteMagnitude, width: buttonScrollToBottomSize, height: buttonScrollToBottomSize)

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 154 characters (line_length)

@rafaelks rafaelks changed the title [WIP][NEW] Remove SlackTextViewController [NEW] Remove SlackTextViewController Nov 8, 2018
@rafaelks rafaelks removed the 🚧 wip label Nov 8, 2018
@rafaelks rafaelks merged commit d16a1b0 into develop Nov 8, 2018
@rafaelks rafaelks deleted the feature/integrate-rc-view-controller branch November 8, 2018 01:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants