Skip to content

Commit 2096002

Browse files
committed
UI: Undo remove
Added 'undo' functionality when removing config items. Added new 'RemovedConfigStore' to take care of storing these items and added 'UndoRemoveAlert.react' component to take care of display & 'undo link' interaction.
1 parent 1d56397 commit 2096002

File tree

9 files changed

+721
-333
lines changed

9 files changed

+721
-333
lines changed

css/app.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ body {
77
margin-bottom: 20px;
88
}
99

10+
/* Alert styles */
11+
.alert-info a{
12+
color: #bddaed;
13+
}
14+
15+
.alert a:hover {
16+
cursor:pointer;
17+
}
1018

19+
/* Ajax progress bar */
1120
/* Make clicks pass-through */
1221
#nprogress {
1322
pointer-events: none;

js/actions/ConfigActions.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,35 @@ import CentralConfigConstants from '../constants/CentralConfigConstants';
33

44
class ConfigActions {
55

6-
recieveConfigData(configData) {
6+
// Updates the 'config items' store
7+
recieveConfigData(configData) {
78

8-
AppDispatcher.dispatch({
9-
actionType: CentralConfigConstants.RECIEVE_RAW_CONFIGITEMS,
10-
configData: configData
11-
});
9+
AppDispatcher.dispatch({
10+
actionType: CentralConfigConstants.RECIEVE_RAW_CONFIGITEMS,
11+
configData: configData
12+
});
1213

13-
}
14+
}
15+
16+
// Updates the 'removed item' store
17+
recieveRemovedConfigData(configData) {
18+
19+
AppDispatcher.dispatch({
20+
actionType: CentralConfigConstants.RECIEVE_REMOVED_CONFIGITEM,
21+
removedItem: configData
22+
});
23+
24+
}
25+
26+
// Clears the 'removed item' store
27+
clearRemovedConfigData() {
28+
29+
AppDispatcher.dispatch({
30+
actionType: CentralConfigConstants.RECIEVE_REMOVED_CONFIGITEM,
31+
removedItem: null
32+
});
33+
34+
}
1435

1536
}
1637

0 commit comments

Comments
 (0)