Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit 33668e4

Browse files
committed
Disable notification modification since the endpoint got changed
1 parent 4856473 commit 33668e4

File tree

1 file changed

+98
-102
lines changed

1 file changed

+98
-102
lines changed

src/react/Pages/Profile/NotificationFilters.jsx

Lines changed: 98 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -59,47 +59,45 @@ class NotificationFilters extends React.Component {
5959
});
6060
};
6161

62-
updateNotificationFilters = notificationsList => {
63-
const { t, user, userType, BunqJSClient } = this.props;
64-
65-
const errorMessage = t("We failed to update your user information");
66-
this.setState({ loading: true });
67-
68-
const userInfo = {
69-
notification_filters: notificationsList
70-
};
71-
72-
const apiHandler = userType === "UserPerson" ? BunqJSClient.api.userPerson : BunqJSClient.api.userCompany;
73-
74-
apiHandler
75-
.put(user.id, userInfo)
76-
.then(response => {
77-
this.setState({ loading: false });
78-
this.props.usersUpdate(true);
79-
})
80-
.catch(error => {
81-
this.setState({ loading: false });
82-
this.props.BunqErrorHandler(error, errorMessage);
83-
});
84-
};
85-
86-
deleteNotification = index => event => {
87-
const notificationFilters = [...this.props.user.notification_filters];
88-
notificationFilters.splice(index, 1);
89-
90-
this.updateNotificationFilters(notificationFilters);
91-
};
92-
93-
addNotification = event => {
94-
const notificationFilters = [...this.props.user.notification_filters];
95-
notificationFilters.push({
96-
notification_delivery_method: "URL",
97-
category: this.state.newCallbackCategory,
98-
notification_target: this.state.newCallbackUrl
99-
});
100-
101-
this.updateNotificationFilters(notificationFilters);
102-
};
62+
// updateNotificationFilters = notificationsList => {
63+
// const { t, user, userType, BunqJSClient } = this.props;
64+
//
65+
// const errorMessage = t("We failed to update your user information");
66+
// this.setState({ loading: true });
67+
//
68+
// const userInfo = {
69+
// notification_filters: notificationsList
70+
// };
71+
//
72+
// const apiHandler = userType === "UserPerson" ? BunqJSClient.api.userPerson : BunqJSClient.api.userCompany;
73+
//
74+
// apiHandler
75+
// .put(user.id, userInfo)
76+
// .then(response => {
77+
// this.setState({ loading: false });
78+
// this.props.usersUpdate(true);
79+
// })
80+
// .catch(error => {
81+
// this.setState({ loading: false });
82+
// this.props.BunqErrorHandler(error, errorMessage);
83+
// });
84+
// };
85+
// deleteNotification = index => event => {
86+
// const notificationFilters = [...this.props.user.notification_filters];
87+
// notificationFilters.splice(index, 1);
88+
//
89+
// this.updateNotificationFilters(notificationFilters);
90+
// };
91+
// addNotification = event => {
92+
// const notificationFilters = [...this.props.user.notification_filters];
93+
// notificationFilters.push({
94+
// notification_delivery_method: "URL",
95+
// category: this.state.newCallbackCategory,
96+
// notification_target: this.state.newCallbackUrl
97+
// });
98+
//
99+
// this.updateNotificationFilters(notificationFilters);
100+
// };
103101

104102
render() {
105103
const { t, user } = this.props;
@@ -113,7 +111,7 @@ class NotificationFilters extends React.Component {
113111
<TableCell>{t("Category")}</TableCell>
114112
<TableCell>{t("Method")}</TableCell>
115113
<TableCell>{t("Value")}</TableCell>
116-
<TableCell>{""}</TableCell>
114+
{/*<TableCell>{""}</TableCell>*/}
117115
</TableRow>
118116
</TableHead>
119117
<TableBody>
@@ -129,11 +127,11 @@ class NotificationFilters extends React.Component {
129127
{notificationFilter.notification_target}
130128
{/*<TextField value={notificationFilter.notification_target} />*/}
131129
</TableCell>
132-
<TableCell style={styles.rowDeleteButtonCell}>
133-
<IconButton onClick={this.deleteNotification(index)}>
134-
<DeleteIcon />
135-
</IconButton>
136-
</TableCell>
130+
{/*<TableCell style={styles.rowDeleteButtonCell}>*/}
131+
{/* <IconButton onClick={this.deleteNotification(index)}>*/}
132+
{/* <DeleteIcon />*/}
133+
{/* </IconButton>*/}
134+
{/*</TableCell>*/}
137135
</TableRow>
138136
);
139137
})}
@@ -172,61 +170,59 @@ class NotificationFilters extends React.Component {
172170
<Typography variant="subtitle1">{t("Notification filters")}</Typography>
173171
</Grid>
174172

175-
<Grid item xs={4} sm={5}>
176-
<TextField
177-
style={styles.fullwidth}
178-
label="Callback URL"
179-
name="newCallbackUrl"
180-
placeholder="https://example.com/callback"
181-
value={this.state.newCallbackUrl}
182-
onChange={this.onChange("newCallbackUrl")}
183-
/>
184-
</Grid>
185-
186-
<Grid item xs={4} sm={5}>
187-
<FormControl style={styles.fullwidth}>
188-
<InputLabel shrink htmlFor="newCallbackCategory">
189-
{t("Category")}
190-
</InputLabel>
191-
<Select
192-
style={styles.fullwidth}
193-
value={this.state.newCallbackCategory}
194-
onChange={this.onChange("newCallbackCategory")}
195-
input={<Input name="newCallbackCategory" id="newCallbackCategory" />}
196-
>
197-
<MenuItem value={"MUTATION"}>MUTATION</MenuItem>
198-
<MenuItem value={"PAYMENT"}>PAYMENT</MenuItem>
199-
<MenuItem value={"IDEAL"}>IDEAL</MenuItem>
200-
<MenuItem value={"SOFORT"}>SOFORT</MenuItem>
201-
<MenuItem value={"BILLING"}>BILLING</MenuItem>
202-
<MenuItem value={"REQUEST"}>REQUEST</MenuItem>
203-
<MenuItem value={"CARD_TRANSACTION_SUCCESSFUL"}>
204-
CARD_TRANSACTION_SUCCESSFUL
205-
</MenuItem>
206-
<MenuItem value={"CHAT"}>CHAT</MenuItem>
207-
<MenuItem value={"DRAFT_PAYMENT"}>DRAFT_PAYMENT</MenuItem>
208-
<MenuItem value={"SCHEDULE_RESULT"}>SCHEDULE_RESULT</MenuItem>
209-
<MenuItem value={"SCHEDULE_STATUS"}>SCHEDULE_STATUS</MenuItem>
210-
<MenuItem value={"SHARE"}>SHARE</MenuItem>
211-
<MenuItem value={"TAB_RESULT"}>TAB_RESULT</MenuItem>
212-
<MenuItem value={"BUNQME_TAB"}>BUNQME_TAB</MenuItem>
213-
<MenuItem value={"SUPPORT"}>SUPPORT</MenuItem>
214-
<MenuItem value={"CARD_TRANSACTION_FAILED"}>CARD_TRANSACTION_FAILED</MenuItem>
215-
</Select>
216-
</FormControl>
217-
</Grid>
218-
219-
<Grid item xs={4} sm={2} style={styles.addButtonWrapper}>
220-
<TranslateButton
221-
style={styles.fullwidth}
222-
disabled={this.state.loading || this.state.newCallbackUrl.length === 0}
223-
onClick={this.addNotification}
224-
variant="outlined"
225-
color="primary"
226-
>
227-
Add
228-
</TranslateButton>
229-
</Grid>
173+
{/*<Grid item xs={4} sm={5}>*/}
174+
{/* <TextField*/}
175+
{/* style={styles.fullwidth}*/}
176+
{/* label="Callback URL"*/}
177+
{/* name="newCallbackUrl"*/}
178+
{/* placeholder="https://example.com/callback"*/}
179+
{/* value={this.state.newCallbackUrl}*/}
180+
{/* onChange={this.onChange("newCallbackUrl")}*/}
181+
{/* />*/}
182+
{/*</Grid>*/}
183+
{/*<Grid item xs={4} sm={5}>*/}
184+
{/* <FormControl style={styles.fullwidth}>*/}
185+
{/* <InputLabel shrink htmlFor="newCallbackCategory">*/}
186+
{/* {t("Category")}*/}
187+
{/* </InputLabel>*/}
188+
{/* <Select*/}
189+
{/* style={styles.fullwidth}*/}
190+
{/* value={this.state.newCallbackCategory}*/}
191+
{/* onChange={this.onChange("newCallbackCategory")}*/}
192+
{/* input={<Input name="newCallbackCategory" id="newCallbackCategory" />}*/}
193+
{/* >*/}
194+
{/* <MenuItem value={"MUTATION"}>MUTATION</MenuItem>*/}
195+
{/* <MenuItem value={"PAYMENT"}>PAYMENT</MenuItem>*/}
196+
{/* <MenuItem value={"IDEAL"}>IDEAL</MenuItem>*/}
197+
{/* <MenuItem value={"SOFORT"}>SOFORT</MenuItem>*/}
198+
{/* <MenuItem value={"BILLING"}>BILLING</MenuItem>*/}
199+
{/* <MenuItem value={"REQUEST"}>REQUEST</MenuItem>*/}
200+
{/* <MenuItem value={"CARD_TRANSACTION_SUCCESSFUL"}>*/}
201+
{/* CARD_TRANSACTION_SUCCESSFUL*/}
202+
{/* </MenuItem>*/}
203+
{/* <MenuItem value={"CHAT"}>CHAT</MenuItem>*/}
204+
{/* <MenuItem value={"DRAFT_PAYMENT"}>DRAFT_PAYMENT</MenuItem>*/}
205+
{/* <MenuItem value={"SCHEDULE_RESULT"}>SCHEDULE_RESULT</MenuItem>*/}
206+
{/* <MenuItem value={"SCHEDULE_STATUS"}>SCHEDULE_STATUS</MenuItem>*/}
207+
{/* <MenuItem value={"SHARE"}>SHARE</MenuItem>*/}
208+
{/* <MenuItem value={"TAB_RESULT"}>TAB_RESULT</MenuItem>*/}
209+
{/* <MenuItem value={"BUNQME_TAB"}>BUNQME_TAB</MenuItem>*/}
210+
{/* <MenuItem value={"SUPPORT"}>SUPPORT</MenuItem>*/}
211+
{/* <MenuItem value={"CARD_TRANSACTION_FAILED"}>CARD_TRANSACTION_FAILED</MenuItem>*/}
212+
{/* </Select>*/}
213+
{/* </FormControl>*/}
214+
{/*</Grid>*/}
215+
{/*<Grid item xs={4} sm={2} style={styles.addButtonWrapper}>*/}
216+
{/* <TranslateButton*/}
217+
{/* style={styles.fullwidth}*/}
218+
{/* disabled={this.state.loading || this.state.newCallbackUrl.length === 0}*/}
219+
{/* onClick={this.addNotification}*/}
220+
{/* variant="outlined"*/}
221+
{/* color="primary"*/}
222+
{/* >*/}
223+
{/* Add*/}
224+
{/* </TranslateButton>*/}
225+
{/*</Grid>*/}
230226

231227
<Grid item xs={12}>
232228
{notificationFilterTable}

0 commit comments

Comments
 (0)