-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: assign an user when scheduling an enrollment event
- Loading branch information
1 parent
5a3908a
commit a0ec795
Showing
12 changed files
with
91 additions
and
3 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
1 change: 1 addition & 0 deletions
1
src/core_modules/capture-core/components/FormFields/UserField/index.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,2 +1,3 @@ | ||
// @flow | ||
export { UserField } from './UserField.component'; | ||
export type { User as UserFormField } from './types'; |
38 changes: 38 additions & 0 deletions
38
src/core_modules/capture-core/components/WidgetEventSchedule/Assignee/Assignee.component.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// @flow | ||
import React from 'react'; | ||
import i18n from '@dhis2/d2-i18n'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import { UserField } from '../../FormFields/UserField/UserField.component'; | ||
import type { Props } from './Assignee.types'; | ||
|
||
const getStyles = () => ({ | ||
container: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
padding: '8px 8px 8px 12px', | ||
}, | ||
label: { | ||
fontSize: 14, | ||
flexBasis: 200, | ||
color: '#212934', | ||
}, | ||
field: { | ||
flexBasis: 150, | ||
flexGrow: 1, | ||
}, | ||
}); | ||
|
||
const AssigneePlain = (props: Props) => { | ||
const { classes, assignee, ...passOnProps } = props; | ||
return ( | ||
<div className={classes.container}> | ||
<div className={classes.label}>{i18n.t('Assignee')}</div> | ||
<div className={classes.field}> | ||
{/* $FlowFixMe[cannot-spread-inexact] automated comment */} | ||
<UserField inputPlaceholderText={i18n.t('Search for user')} value={assignee} {...passOnProps} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Assignee = withStyles(getStyles)(AssigneePlain); |
7 changes: 7 additions & 0 deletions
7
src/core_modules/capture-core/components/WidgetEventSchedule/Assignee/Assignee.types.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @flow | ||
import type { UserFormField } from '../../FormFields/UserField'; | ||
|
||
export type Props = { | ||
...CssClasses, | ||
assignee?: UserFormField, | ||
}; |
2 changes: 2 additions & 0 deletions
2
src/core_modules/capture-core/components/WidgetEventSchedule/Assignee/index.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @flow | ||
export { Assignee } from './Assignee.component'; |
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