Skip to content

Commit 70f8c65

Browse files
committed
adding delete context functionality
1 parent c8a1241 commit 70f8c65

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

app/src/components/ContextAPIManager/AssignTab/AssignContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const AssignContainer = () => {
8181
</Grid>
8282

8383
<Grid item>
84-
<DataTable target={tableState} />
84+
<DataTable target={tableState} contextInput={contextInput} />
8585
</Grid>
8686
</Grid>
8787
</Grid>

app/src/components/ContextAPIManager/AssignTab/components/ComponentTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function DataTable({ target }) {
3434
<Table sx={{ width: '510px' }} aria-label="customized table">
3535
<TableHead>
3636
<TableRow>
37-
<StyledTableCell>Contexts Consumed</StyledTableCell>
37+
<StyledTableCell align="center">Contexts Consumed</StyledTableCell>
3838
</TableRow>
3939
</TableHead>
4040
<TableBody>

app/src/components/ContextAPIManager/CreateTab/components/AddContextForm.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ const AddContextForm = ({
3636
values: []
3737
});
3838
renderTable(newValue);
39-
4039
} else {
4140
setContextInput(newValue);
4241
renderTable(newValue);
4342
}
4443
};
4544

4645
const filterOptions = (options, params) => {
47-
// setBtnDisabled(true);
46+
// setBtnDisabled(true);
4847
const filtered = filter(options, params);
4948
const { inputValue } = params;
5049
// Suggest the creation of a new contextInput
@@ -55,7 +54,7 @@ const AddContextForm = ({
5554
name: `Add "${inputValue}"`
5655
});
5756

58-
// setBtnDisabled(false);
57+
// setBtnDisabled(false);
5958
}
6059

6160
return filtered;
@@ -74,9 +73,7 @@ const AddContextForm = ({
7473
return option.name;
7574
};
7675

77-
const renderOption = (props, option) => (
78-
<li {...props}>{option.name}</li>
79-
);
76+
const renderOption = (props, option) => <li {...props}>{option.name}</li>;
8077

8178
return (
8279
<Fragment>

app/src/redux/reducers/slice/contextReducer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@ import * as types from '../../constants/actionTypes';
33
const initialState = {
44
allContext: [
55
{
6-
name: 'MainContext1',
6+
name: 'ContextExample1',
77
values: [
88
{ key: 'testKey1', value: 'testValue1' },
99
{ key: 'testKey2', value: 'testValue2' }
1010
],
1111
components: ['MainContainer', 'SubmitForm']
1212
},
1313
{
14-
name: 'MainContext3',
14+
name: 'ContextExample2',
1515
values: [
1616
{ key: 'testKey3', value: 'testValue3' },
1717
{ key: 'testKey33', value: 'testValue33' }
1818
],
1919
components: ['MainContainer', 'EditForm', 'TableContainer']
2020
}
2121
]
22+
// allContext: []
2223
};
2324

2425
const contextReducer = (state = initialState, action) => {

0 commit comments

Comments
 (0)