This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(meetings): bug fixes after test cases (#364)
- Loading branch information
1 parent
a75927b
commit 368e75c
Showing
10 changed files
with
186 additions
and
69 deletions.
There are no files selected for viewing
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
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
87 changes: 87 additions & 0 deletions
87
packages/plugin-meetings-ui/src/components/myMeetings/MyMeetings.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,87 @@ | ||
import { __, router } from '@erxes/ui/src/utils'; | ||
import React, { useState } from 'react'; | ||
|
||
import Wrapper from '@erxes/ui/src/layout/components/Wrapper'; | ||
import DataWithLoader from '@erxes/ui/src/components/DataWithLoader'; | ||
|
||
import SideBarContainer from '../myMeetings/SideBar'; | ||
import { IUser } from '@erxes/ui/src/auth/types'; | ||
import { FormControl } from '@erxes/ui/src/components'; | ||
import { MeetingsQueryResponse } from '../../types'; | ||
import MyMeetingListContainer from '../../containers/myMeetings/List'; | ||
import { menuMeeting } from '../../contants'; | ||
|
||
type Props = { | ||
meetings: any; | ||
loading: boolean; | ||
queryParams: any; | ||
route?: string; | ||
history: string; | ||
refetchQueries?: any; | ||
currentUser: IUser; | ||
meetingQuery?: MeetingsQueryResponse; | ||
}; | ||
|
||
function MyMeetings(props: Props) { | ||
const { loading, queryParams, history, currentUser } = props; | ||
const { searchValue } = queryParams; | ||
const [searchText, setSearchValue] = useState(searchValue); | ||
|
||
const searchHandler = e => { | ||
const searchValue = e.target.value; | ||
|
||
setSearchValue(searchValue); | ||
|
||
setTimeout(() => { | ||
router.removeParams(history, 'page'); | ||
router.setParams(history, { searchValue }); | ||
}, 500); | ||
}; | ||
|
||
const leftSideBar = ( | ||
<SideBarContainer | ||
history={history} | ||
queryParams={queryParams} | ||
currentUser={currentUser} | ||
/> | ||
); | ||
|
||
const actionBarRight = ( | ||
<FormControl | ||
type="text" | ||
placeholder={__('Type to search')} | ||
defaultValue={searchText} | ||
onChange={searchHandler} | ||
autoFocus={true} | ||
/> | ||
); | ||
|
||
const actionBar = <Wrapper.ActionBar right={actionBarRight} wideSpacing />; | ||
return ( | ||
<Wrapper | ||
header={ | ||
<Wrapper.Header title={__('My Meetings')} submenu={menuMeeting()} /> | ||
} | ||
actionBar={actionBar} | ||
content={ | ||
<DataWithLoader | ||
data={ | ||
<MyMeetingListContainer | ||
history={history} | ||
queryParams={queryParams} | ||
/> | ||
} | ||
loading={loading} | ||
count={1} | ||
emptyText={__('Theres no meetings')} | ||
emptyImage="/images/actions/8.svg" | ||
/> | ||
} | ||
leftSidebar={leftSideBar} | ||
transparent={true} | ||
hasBorder | ||
/> | ||
); | ||
} | ||
|
||
export default MyMeetings; |
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.