-
Notifications
You must be signed in to change notification settings - Fork 437
[NEW] Remove SlackTextViewController #2195
Conversation
…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 { |
There was a problem hiding this comment.
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) | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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)
…dated-items [FIX] Recalculate sequential messages size when they were not sequential before an update
…poser_support_themes
…emes [NEW] Support themes in new composer & minor fixes
| // 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)
[FIX] Light keyboard showing in dark themes in composer
[CHORE] Remove SlackTextViewController and old chat implementation
[FIX] Add trailing space after autocompletion
| } | ||
|
|
||
| chatViewController?.toggleActions() | ||
| // TODO: Replace for our composer |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)

@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