projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Support new package file management scheme - lots of changes" into v2.0
[osm/UI.git]
/
skyquake
/
plugins
/
launchpad
/
src
/
virtual_links
/
nsVirtualLinkCreateStore.js
diff --git
a/skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreateStore.js
b/skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreateStore.js
index
61ebe3d
..
ac050e4
100644
(file)
--- a/
skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreateStore.js
+++ b/
skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreateStore.js
@@
-18,7
+18,9
@@
import NSVirtualLinkCreateActions from './nsVirtualLinkCreateActions.js';
import NSVirtualLinkCreateSource from './nsVirtualLinkCreateSource.js';
import Alt from '../alt';
import NSVirtualLinkCreateActions from './nsVirtualLinkCreateActions.js';
import NSVirtualLinkCreateSource from './nsVirtualLinkCreateSource.js';
import Alt from '../alt';
-import _ from 'lodash';
+import _cloneDeep from 'lodash/cloneDeep';
+import _pickBy from 'lodash/pickBy';
+import _identity from 'lodash/identity';
class NSVirtualLinkCreateStore {
constructor() {
class NSVirtualLinkCreateStore {
constructor() {
@@
-84,7
+86,8
@@
class NSVirtualLinkCreateStore {
saveVnfdIdRefs: this.saveVnfdIdRefs,
saveIpProfileNames: this.saveIpProfileNames,
removeVirtualLink: this.removeVirtualLink,
saveVnfdIdRefs: this.saveVnfdIdRefs,
saveIpProfileNames: this.saveIpProfileNames,
removeVirtualLink: this.removeVirtualLink,
- saveMode: this.saveMode
+ saveMode: this.saveMode,
+ saveOnSuccess: this.saveOnSuccess
});
}
});
}
@@
-97,6
+100,12
@@
class NSVirtualLinkCreateStore {
});
}
});
}
+ saveOnSuccess = (onSuccess) => {
+ this.setState({
+ onSuccess: onSuccess
+ })
+ }
+
saveMode = (mode) => {
this.setState({
mode: mode
saveMode = (mode) => {
this.setState({
mode: mode
@@
-134,7
+143,7
@@
class NSVirtualLinkCreateStore {
}
updateFirstLevelKey = (key, e) => {
}
updateFirstLevelKey = (key, e) => {
- let vld = _
.
cloneDeep(this.vld);
+ let vld = _cloneDeep(this.vld);
let value = e.target.nodeName == "SELECT" ? JSON.parse(e.target.value) : e.target.value;
vld[key] = value;
this.setState({
let value = e.target.nodeName == "SELECT" ? JSON.parse(e.target.value) : e.target.value;
vld[key] = value;
this.setState({
@@
-143,7
+152,7
@@
class NSVirtualLinkCreateStore {
}
updateSecondLevelKey = (firstLevelKey, secondLevelKey, e) => {
}
updateSecondLevelKey = (firstLevelKey, secondLevelKey, e) => {
- let vld = _
.
cloneDeep(this.vld);
+ let vld = _cloneDeep(this.vld);
if (!vld[firstLevelKey]) {
vld[firstLevelKey] = {};
}
if (!vld[firstLevelKey]) {
vld[firstLevelKey] = {};
}
@@
-169,7
+178,7
@@
class NSVirtualLinkCreateStore {
}
updateVLDInitParamsValue = (currentVLDInitParamsType, e) => {
}
updateVLDInitParamsValue = (currentVLDInitParamsType, e) => {
- let vld = _
.
cloneDeep(this.vld);
+ let vld = _cloneDeep(this.vld);
this.vldInitParamsTypes.map((vldInitParamType) => {
if (currentVLDInitParamsType == vldInitParamType) {
let value = e.target.nodeName == "SELECT" ? JSON.parse(e.target.value) : e.target.value;
this.vldInitParamsTypes.map((vldInitParamType) => {
if (currentVLDInitParamsType == vldInitParamType) {
let value = e.target.nodeName == "SELECT" ? JSON.parse(e.target.value) : e.target.value;
@@
-185,7
+194,7
@@
class NSVirtualLinkCreateStore {
}
updateFirstLevelListKeyChange = (listName, index, keyName, e) => {
}
updateFirstLevelListKeyChange = (listName, index, keyName, e) => {
- let vld = _
.
cloneDeep(this.vld);
+ let vld = _cloneDeep(this.vld);
!vld[listName] && (vld[listName] = []);
!vld[listName] && (vld[listName] = []);
@@
-200,7
+209,7
@@
class NSVirtualLinkCreateStore {
addConnectionPointRef = () => {
let vld = {};
if (this.vld) {
addConnectionPointRef = () => {
let vld = {};
if (this.vld) {
- vld = _
.
cloneDeep(this.vld);
+ vld = _cloneDeep(this.vld);
if (!vld['vnfd-connection-point-ref']) {
vld['vnfd-connection-point-ref'] = [];
}
if (!vld['vnfd-connection-point-ref']) {
vld['vnfd-connection-point-ref'] = [];
}
@@
-217,7
+226,7
@@
class NSVirtualLinkCreateStore {
}
removeConnectionPointRef = (vnfdConnectionPointRefIndex) => {
}
removeConnectionPointRef = (vnfdConnectionPointRefIndex) => {
- let vld = _
.
cloneDeep(this.vld);
+ let vld = _cloneDeep(this.vld);
vld['vnfd-connection-point-ref'].splice(vnfdConnectionPointRefIndex, 1);
this.setState({
vld: vld
vld['vnfd-connection-point-ref'].splice(vnfdConnectionPointRefIndex, 1);
this.setState({
vld: vld
@@
-240,27
+249,18
@@
class NSVirtualLinkCreateStore {
}
createVirtualLinkSuccess(data) {
}
createVirtualLinkSuccess(data) {
- this.setState({
- // vld: this.vld,
- mode: 'editing',
- isLoading: false
- });
+ this.onSuccess();
}
editVirtualLinkSuccess(data) {
}
editVirtualLinkSuccess(data) {
- this.setState({
- mode: 'editing',
- isLoading: false
- });
+ this.onSuccess();
}
deleteVirtualLinkSuccess(data) {
}
deleteVirtualLinkSuccess(data) {
- this.setState({
- deleteState: 'success'
- });
+ this.onSuccess();
}
cleanupPayload = (mode, vld) => {
// Do necessary cleanup here
}
cleanupPayload = (mode, vld) => {
// Do necessary cleanup here
- let cleanVld = _
.pickBy(vld, _.
identity);
+ let cleanVld = _
pickBy(vld, _
identity);
return cleanVld;
}
return cleanVld;
}