Skip to content

Commit 66f04c0

Browse files
authored
Merge pull request #1274 from layer5io/chore/remove-notify-checkbox-v2
feat: make notify checkbox optional
2 parents 942740a + e2e66c3 commit 66f04c0

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sistent/sistent",
3-
"version": "0.0.2",
3+
"version": "0.16.5",
44
"description": "Reusable React Components and SVG Icons library",
55
"repository": {
66
"type": "git",

src/custom/UserSearchField/UserSearchFieldInput.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ interface UserSearchFieldProps {
3333
setUsersData: React.Dispatch<React.SetStateAction<User[]>>;
3434
label?: string;
3535
setDisableSave?: (disable: boolean) => void;
36-
// Deprecated: remove notify controls from embedded contexts (e.g., audit filters)
3736
handleNotifyPref?: () => void;
3837
notifyUpdate?: boolean;
38+
showNotifyCheckbox?: boolean;
3939
isCreate?: boolean;
4040
searchType?: string;
4141
disabled?: boolean;
@@ -54,6 +54,7 @@ const UserSearchField: React.FC<UserSearchFieldProps> = ({
5454
setDisableSave,
5555
handleNotifyPref,
5656
notifyUpdate,
57+
showNotifyCheckbox = true,
5758
isCreate,
5859
searchType,
5960
disabled = false,
@@ -230,7 +231,23 @@ const UserSearchField: React.FC<UserSearchFieldProps> = ({
230231
</li>
231232
)}
232233
/>
233-
{/* Notify checkbox removed */}
234+
{showNotifyCheckbox && !isCreate && handleNotifyPref && (
235+
<FormGroup row={true}>
236+
<div style={{ display: 'flex', flexWrap: 'nowrap' }}>
237+
<FormControlLabel
238+
control={
239+
<Checkbox
240+
checked={notifyUpdate}
241+
onChange={handleNotifyPref}
242+
name="notify"
243+
color="primary"
244+
/>
245+
}
246+
label={`Notify ${searchType} of membership change`}
247+
/>
248+
</div>
249+
</FormGroup>
250+
)}
234251
<Box
235252
sx={{
236253
display: 'flex',

0 commit comments

Comments
 (0)