-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix access to media * search fixes * search fixes
- Loading branch information
Showing
25 changed files
with
381 additions
and
307 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
twake/frontend/src/app/components/search-popup/parts/channels-and-contacts.tsx
This file contains 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,45 @@ | ||
import Search from 'features/global/services/search-service'; | ||
import ChannelsResult from 'components/search-popup/parts/channels-result'; | ||
import UsersResult from 'components/search-popup/parts/users-result'; | ||
import React from 'react'; | ||
import { ChannelType } from 'app/features/channels/types/channel'; | ||
import { UserType } from 'features/users/types/user'; | ||
|
||
type PropsType = { | ||
channels: ChannelType[]; | ||
users: UserType[]; | ||
}; | ||
|
||
export default ({ channels, users }: PropsType): JSX.Element => { | ||
return ( | ||
<div> | ||
<div className="results-group-title ">Channels and contacts</div> | ||
|
||
{(channels && channels.length && ( | ||
<div className="result-items"> | ||
{channels.map(channel => ( | ||
<ChannelsResult | ||
channel={channel} | ||
key={channel.id} | ||
highlight={Search.value} | ||
onClick={() => Search.close()} | ||
/> | ||
))} | ||
</div> | ||
)) || <div />} | ||
|
||
{(users && users.length && ( | ||
<div className="result-items"> | ||
{users.map(user => ( | ||
<UsersResult | ||
user={user} | ||
key={user.id} | ||
highlight={Search.value} | ||
onClick={() => Search.close()} | ||
/> | ||
))} | ||
</div> | ||
)) || <div />} | ||
</div> | ||
); | ||
}; |
This file contains 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 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
32 changes: 32 additions & 0 deletions
32
twake/frontend/src/app/components/search-popup/parts/discussions.tsx
This file contains 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,32 @@ | ||
import Search from 'features/global/services/search-service'; | ||
import React from 'react'; | ||
import MessagesResult from 'components/search-popup/parts/messages-result'; | ||
import { MessageExtended } from 'features/messages/types/message'; | ||
|
||
type PropsType = { | ||
title: string; | ||
messages: MessageExtended[]; | ||
limit: number; | ||
}; | ||
|
||
export default ({ title, messages, limit }: PropsType): JSX.Element => { | ||
if (!messages) { | ||
return <div />; | ||
} | ||
|
||
return ( | ||
<div> | ||
<div className="results-group-title ">{title}</div> | ||
<div className="result-items"> | ||
{messages.slice(0, limit).map(message => ( | ||
<MessagesResult | ||
key={message.id} | ||
message={message} | ||
highlight={Search.value} | ||
onClick={() => Search.close()} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; |
42 changes: 42 additions & 0 deletions
42
twake/frontend/src/app/components/search-popup/parts/files.tsx
This file contains 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,42 @@ | ||
import PerfectScrollbar from 'react-perfect-scrollbar'; | ||
import FilesResult from 'components/search-popup/parts/recent/files-result'; | ||
import { onFileDownloadClick, onFilePreviewClick } from 'components/search-popup/parts/common'; | ||
import React from 'react'; | ||
import { FileSearchResult } from 'features/messages/types/message'; | ||
|
||
type PropsType = { | ||
title: string; | ||
files: FileSearchResult[]; | ||
limit: number; | ||
}; | ||
|
||
export default ({ files, title, limit }: PropsType): JSX.Element => { | ||
if (!files || !files.length) { | ||
return <div />; | ||
} | ||
|
||
return ( | ||
<div className="results-group"> | ||
<div className="results-group-title">{title}</div> | ||
|
||
<PerfectScrollbar | ||
options={{ suppressScrollX: true }} | ||
component="div" | ||
className="result-items-files" | ||
> | ||
{files.slice(0, limit).map(file => ( | ||
<FilesResult | ||
fileSearchResult={file} | ||
key={file.id} | ||
onPreviewClick={() => { | ||
onFilePreviewClick(file); | ||
}} | ||
onDownloadClick={() => { | ||
onFileDownloadClick(file); | ||
}} | ||
/> | ||
))} | ||
</PerfectScrollbar> | ||
</div> | ||
); | ||
}; |
39 changes: 39 additions & 0 deletions
39
twake/frontend/src/app/components/search-popup/parts/media.tsx
This file contains 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,39 @@ | ||
import PerfectScrollbar from 'react-perfect-scrollbar'; | ||
import { onFilePreviewClick } from 'components/search-popup/parts/common'; | ||
import React from 'react'; | ||
import MediaResult from 'components/search-popup/parts/recent/media-result'; | ||
import { FileSearchResult } from 'features/messages/types/message'; | ||
|
||
type PropsType = { | ||
title: string; | ||
files: FileSearchResult[]; | ||
limit: number; | ||
}; | ||
|
||
export default ({ title, files, limit }: PropsType): JSX.Element => { | ||
if (!files || !files.length) { | ||
return <div />; | ||
} | ||
|
||
return ( | ||
<div className="results-group"> | ||
<div className="results-group-title">{title}</div> | ||
|
||
<PerfectScrollbar | ||
options={{ suppressScrollY: true }} | ||
component="div" | ||
className="result-items-media" | ||
> | ||
{files.slice(0, limit).map(file => ( | ||
<MediaResult | ||
fileSearchResult={file} | ||
key={file.id} | ||
onClick={() => { | ||
onFilePreviewClick(file); | ||
}} | ||
/> | ||
))} | ||
</PerfectScrollbar> | ||
</div> | ||
); | ||
}; |
2 changes: 1 addition & 1 deletion
2
twake/frontend/src/app/components/search-popup/parts/messages-filter.js
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
|
||
import { | ||
ObjectModalFormTitle, | ||
|
2 changes: 0 additions & 2 deletions
2
twake/frontend/src/app/components/search-popup/parts/messages-result.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
twake/frontend/src/app/components/search-popup/parts/quick-result.js
This file contains 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
File renamed without changes.
This file contains 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
5 changes: 1 addition & 4 deletions
5
twake/frontend/src/app/components/search-popup/parts/recent/media-result.tsx
This file contains 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 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 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
Oops, something went wrong.