-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[NEW] Add Discussions to RoomActionsView #3287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 71 commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
a0eecdc
Add Discussions to RoomActionsView
gerzonc 659f2c8
Add Discussions to ThreadMessagesView
gerzonc c066c20
Update DiscussionMessagesView and add to stacks
gerzonc daba3b4
Fix DiscussionMessagesView
gerzonc da3bdd4
Fix search
gerzonc 9ad45f0
Add E2E test
gerzonc fc59b74
Remove old changes from ThreadMessagesView
gerzonc b4c55b3
Merge develop
gerzonc 82b306b
Minor tweak
gerzonc 7feb509
Add discussions for channels
gerzonc e6e6c9e
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 618eb53
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 2d89d07
Minor tweak
gerzonc cc404b1
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 330ab40
Fix navToRoomInfo
gerzonc 2b1f78f
Fix search
gerzonc 7429e4b
Add getDiscussions endpoint
gerzonc ad612e6
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 91dedfb
Convert SearchHeader to reusable component and minor tweaks to Discus…
gerzonc f4c86ec
Merge develop into branch
gerzonc cc2a34c
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 565f5d7
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc f88a6fa
Fix lint
gerzonc 191e71c
Merge branch 'develop' into new.add-discusions-roomactionsview
diegolmello 8ccce58
Minor tweaks
gerzonc ecee12c
Migrate to TypeScript, update interfaces and some changes to containe…
gerzonc 55b89e6
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 6128bc4
Migrate SearchHeader to TS
gerzonc 88dbf34
Update e2e tests
gerzonc 9473bf4
Minor tweaks
gerzonc c641bf5
Fix threads
gerzonc cc07128
Remove unused params
gerzonc ec665e0
Simplify logic
gerzonc 5379109
Rollback interfaces changes
gerzonc df480fb
Update property type rule
gerzonc d1d35c7
Minor tweak
gerzonc f9dc2a9
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc eedfd42
Minor tweak
gerzonc b48a189
Update Storyshots.test.js.snap
gerzonc 89a2381
test commit
gerzonc a226cad
Undo changes, add timeFormat prop
gerzonc da7f954
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 1d40c3b
Update snapshots
gerzonc dcb79b1
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 714608c
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 0242fb1
Fix en.json
gerzonc 086d13b
Remove no-non-null-assertion
gerzonc 35d869d
Update types and onCancelSearchPress
gerzonc 8e064a5
Fix lint
gerzonc 5dc0a0a
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc f911100
Fix lint
gerzonc 47f7ee8
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc ffb17d6
Minor tweaks
gerzonc a1c8ce0
Minor tweak
gerzonc 767637b
Merge branch 'develop' into new.add-discusions-roomactionsview
AlexAlexandre 0a3bdb6
Update index.tsx
gerzonc bd534f5
Minor tweak
gerzonc 184799e
Update 04-discussion.spec.js
gerzonc c858218
Minor tweak
gerzonc 2b7f589
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc dc70bf6
Add DiscussionDetails and Item for DiscussionsView; update ThreadDeta…
gerzonc e010d80
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 18da04b
update definitions
gerzonc eb1712e
minor tweak
gerzonc 89ae430
add storybooks, update snapshots and DiscussionsView
gerzonc 680476a
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 6c9a3f9
Minor tweaks
gerzonc 23244e3
Fix lint
gerzonc 79eeb55
Remove unused import
gerzonc 6be5b7e
Merge branch 'develop' into new.add-discusions-roomactionsview
diegolmello ea9a2da
Merge branch 'develop' into new.add-discusions-roomactionsview
diegolmello 0a6e5d3
Move onDiscussionpress logic on message, update SearchHeader and Disc…
gerzonc ce8a208
Update interfaces and minor tweaks to DiscussionsView screen and comp…
gerzonc bce775d
Fix navigation logic and update interfaces
gerzonc 5d84468
Minor tweaks
gerzonc 4995df2
Undo change on project.pbxproj
gerzonc 67e034c
Update project.pbxproj
gerzonc 42946c1
Update project.pbxproj
gerzonc 4f9460b
Remove style.ts
gerzonc e0d7cbb
Minor tweak
gerzonc a1a2e5c
update snapshots
gerzonc 5a320a8
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc a093af3
test
gerzonc 350a20d
remove console.log
gerzonc 89613bb
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 67541ba
Add missing DiscussionsView snapshot
gerzonc c0e7f43
fix build and useless done and async generator
dnlsilva 93edb9b
update snapshot
dnlsilva 04f3c7e
Merge branch 'fix-ci-limiter-and-test' into new.add-discusions-roomac…
gerzonc 7278241
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 9caff40
Merge branch 'develop' into new.add-discusions-roomactionsview
gerzonc 1b6f574
Merge branch 'new.add-discusions-roomactionsview' of https://github.c…
gerzonc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,6 @@ const Thread = React.memo( | |
| item={{ | ||
| tcount, | ||
| replies, | ||
| tlm, | ||
| id | ||
| }} | ||
| user={user} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import React from 'react'; | ||
| import { StyleSheet, Text, View, ViewStyle } from 'react-native'; | ||
|
|
||
| import { TThreadModel } from '../../definitions/IThread'; | ||
| import { CustomIcon } from '../../lib/Icons'; | ||
| import { themes } from '../../constants/colors'; | ||
| import sharedStyles from '../Styles'; | ||
| import { useTheme } from '../../theme'; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| flexDirection: 'row', | ||
| alignItems: 'center' | ||
| }, | ||
| detailsContainer: { | ||
| flex: 1, | ||
| flexDirection: 'row' | ||
| }, | ||
| detailContainer: { | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| marginRight: 8 | ||
| }, | ||
| detailText: { | ||
| fontSize: 10, | ||
| marginLeft: 2, | ||
| ...sharedStyles.textSemibold | ||
| } | ||
| }); | ||
|
|
||
| interface IDiscussionDetails { | ||
| item: TThreadModel; | ||
| user: { | ||
| id: string; | ||
| }; | ||
| time: string; | ||
| style: ViewStyle; | ||
| } | ||
|
|
||
| const DiscussionDetails = ({ item, time, style }: IDiscussionDetails) => { | ||
|
gerzonc marked this conversation as resolved.
Outdated
|
||
| const { theme } = useTheme(); | ||
| let { dcount } = item; | ||
|
|
||
| if (dcount! >= 1000) { | ||
| dcount = '+999'; | ||
| } | ||
|
|
||
| return ( | ||
| <View style={[styles.container, style]}> | ||
| <View style={styles.detailsContainer}> | ||
| <View style={styles.detailContainer}> | ||
| <CustomIcon name={'discussions'} size={24} color={themes[theme!].auxiliaryText} /> | ||
| <Text style={[styles.detailText, { color: themes[theme!].auxiliaryText }]} numberOfLines={1}> | ||
| {dcount} | ||
| </Text> | ||
| </View> | ||
|
|
||
| <View style={styles.detailContainer}> | ||
| <CustomIcon name={'clock'} size={24} color={themes[theme!].auxiliaryText} /> | ||
| <Text style={[styles.detailText, { color: themes[theme!].auxiliaryText }]} numberOfLines={1}> | ||
| {time} | ||
| </Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| export default DiscussionDetails; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should evaluate this later with UX team if we can reuse it on Message component, like we do with Threads. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| /* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions, react/prop-types */ | ||
| import React from 'react'; | ||
| import { storiesOf } from '@storybook/react-native'; | ||
| import { ScrollView } from 'react-native'; | ||
| import { Provider } from 'react-redux'; | ||
|
|
||
| import * as List from '../../containers/List'; | ||
| import { themes } from '../../constants/colors'; | ||
| import { ThemeContext } from '../../theme'; | ||
| import { store } from '../../../storybook/stories'; | ||
| import Item from './Item'; | ||
|
|
||
| const author = { | ||
| _id: 'userid', | ||
| username: 'rocket.cat', | ||
| name: 'Rocket Cat' | ||
| }; | ||
| const baseUrl = 'https://open.rocket.chat'; | ||
| const date = new Date(2020, 10, 10, 10); | ||
| const longText = | ||
| 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; | ||
| const defaultItem = { | ||
| msg: 'Message content', | ||
| tcount: 1, | ||
| replies: [1], | ||
| ts: date, | ||
| tlm: date, | ||
| u: author, | ||
| attachments: [] | ||
| }; | ||
|
|
||
| const BaseItem = ({ item, ...props }) => ( | ||
| <Item | ||
| baseUrl={baseUrl} | ||
| item={{ | ||
| ...defaultItem, | ||
| ...item | ||
| }} | ||
| onPress={() => alert('pressed')} | ||
| {...props} | ||
| /> | ||
| ); | ||
|
|
||
| const listDecorator = story => ( | ||
| <ScrollView> | ||
| <List.Separator /> | ||
| {story()} | ||
| <List.Separator /> | ||
| </ScrollView> | ||
| ); | ||
|
|
||
| const stories = storiesOf('Discussions.Item', module) | ||
| .addDecorator(listDecorator) | ||
| .addDecorator(story => <Provider store={store}>{story()}</Provider>); | ||
|
|
||
| stories.add('content', () => ( | ||
| <> | ||
| <BaseItem /> | ||
| <List.Separator /> | ||
| <BaseItem | ||
| item={{ | ||
| msg: longText | ||
| }} | ||
| /> | ||
| <List.Separator /> | ||
| <BaseItem | ||
| item={{ | ||
| dcount: 1000, | ||
| replies: [...new Array(1000)] | ||
| }} | ||
| /> | ||
| <List.Separator /> | ||
| <BaseItem | ||
| item={{ | ||
| msg: '', | ||
| attachments: [{ title: 'Attachment title' }] | ||
| }} | ||
| /> | ||
| <List.Separator /> | ||
| <BaseItem useRealName /> | ||
| </> | ||
| )); | ||
|
|
||
| const ThemeStory = ({ theme }) => ( | ||
| <ThemeContext.Provider value={{ theme }}> | ||
| <BaseItem badgeColor={themes[theme].mentionMeColor} /> | ||
| </ThemeContext.Provider> | ||
| ); | ||
|
|
||
| stories.add('themes', () => ( | ||
| <> | ||
| <ThemeStory theme='light' /> | ||
| <ThemeStory theme='dark' /> | ||
| <ThemeStory theme='black' /> | ||
| </> | ||
| )); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.