Comparing version 0.0.4 to 0.0.5
@@ -107,2 +107,2 @@ 'use strict'; | ||
}; | ||
}; | ||
}; |
@@ -108,2 +108,2 @@ "use strict"; | ||
this.contentItem = new ContentItem(state.contentItemState.name, state.contentItemState.type, state.contentItemState.id); | ||
}; | ||
}; |
@@ -35,2 +35,2 @@ 'use strict'; | ||
*/ | ||
exports.default = bsdmReducer; | ||
exports.default = bsdmReducer; |
@@ -47,2 +47,2 @@ 'use strict'; | ||
exports.default = eventReducer; | ||
exports.default = eventReducer; |
@@ -75,2 +75,2 @@ 'use strict'; | ||
}); | ||
}); | ||
}); |
@@ -39,2 +39,2 @@ "use strict"; | ||
exports.default = signReducer; | ||
exports.default = signReducer; |
@@ -49,2 +49,2 @@ "use strict"; | ||
exports.default = transitionReducer; | ||
exports.default = transitionReducer; |
@@ -84,2 +84,2 @@ 'use strict'; | ||
} | ||
}; | ||
}; |
@@ -15,2 +15,2 @@ 'use strict'; | ||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); | ||
} | ||
} |
{ | ||
"name": "bsdm", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "BrightSign Data Model", | ||
@@ -21,4 +21,6 @@ "scripts": { | ||
"eslint": "^3.7.1", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"webpack": "^1.13.2" | ||
} | ||
} |
@@ -6,3 +6,3 @@ /** | ||
import { ADD_ZONE, UPDATE_ZONE } from '../bsDmActions'; | ||
import { ADD_ZONE, UPDATE_ZONE, ADD_MEDIA_STATE } from '../bsDmActions'; | ||
import { Zone } from '../bsDmClasses'; | ||
@@ -19,3 +19,3 @@ | ||
nonInteractive: nonInteractive, | ||
initialMediaStateId: id | ||
initialMediaStateId: "" | ||
}); | ||
@@ -36,2 +36,12 @@ | ||
return Object.assign({}, state, {[id]: updatedZone}); | ||
case ADD_MEDIA_STATE : | ||
// First media state added to a zone always becomes the initial state | ||
// For this action, action.id == mediaStateId, mediaState.container.id == ZoneId | ||
let {container} = payload; | ||
let zone = state[container.id]; | ||
if (zone && zone.initialMediaStateId === "") { | ||
let updatedZone = Object.assign({}, state[container.id], {initialMediaStateId: id}); | ||
return Object.assign({}, state, {[container.id]: updatedZone}); | ||
} | ||
break; | ||
} | ||
@@ -38,0 +48,0 @@ return state; |
43
test.js
@@ -46,5 +46,8 @@ /** | ||
zone1 = getZoneById(store.getState(), {id: zone1Id}); | ||
console.log(zone1); | ||
state = store.getState(); | ||
console.log("state after adding media state1:"); | ||
console.log(state); | ||
// console.log("state after adding media state1:"); | ||
// console.log(state); | ||
@@ -54,4 +57,4 @@ let mediaState1Id = msAction.id; | ||
let mediaState1 = getMediaStateById(state, {id: mediaState1Id}); | ||
console.log("mediaState1:"); | ||
console.log(mediaState1); | ||
// console.log("mediaState1:"); | ||
// console.log(mediaState1); | ||
@@ -62,13 +65,13 @@ state = store.getState(); | ||
let zone1States = getMediaStatesForZone(state, {id: zone1Id}); | ||
console.log("zone1States:"); | ||
console.log(zone1States); | ||
// console.log("zone1States:"); | ||
// console.log(zone1States); | ||
store.dispatch(baUpdateZone(zone1Id,{name:"Zone1x"})); | ||
state = store.getState(); | ||
console.log("state after adding updating zone:"); | ||
console.log(state); | ||
// console.log("state after adding updating zone:"); | ||
// console.log(state); | ||
zone1 = getZoneById(store.getState(), {id: zone1Id}); | ||
console.log("zone1:"); | ||
console.log(zone1); | ||
// console.log("zone1:"); | ||
// console.log(zone1); | ||
@@ -78,13 +81,13 @@ msAction = store.dispatch(baAddMediaState('State2', zone1Container, contentItem2)); | ||
state = store.getState(); | ||
console.log("state after adding media state2:"); | ||
console.log(state); | ||
// console.log("state after adding media state2:"); | ||
// console.log(state); | ||
let mediaState2Id = msAction.id; | ||
let mediaState2 = getMediaStateById(state, {id: mediaState2Id}); | ||
console.log("mediaState2"); | ||
console.log(mediaState2); | ||
// console.log("mediaState2"); | ||
// console.log(mediaState2); | ||
zone1States = getMediaStatesForZone(state, {id: zone1Id}); | ||
console.log("zone1States after adding mediaState2:"); | ||
console.log(zone1States); | ||
// console.log("zone1States after adding mediaState2:"); | ||
// console.log(zone1States); | ||
@@ -94,4 +97,4 @@ // Make State 2 the initial state | ||
zone1 = getZoneById(store.getState(), {id: zone1Id}); | ||
console.log("zone1:"); | ||
console.log(zone1); | ||
// console.log("zone1:"); | ||
// console.log(zone1); | ||
@@ -106,4 +109,4 @@ // Event added to State 2 (now the initial event) | ||
state = store.getState(); | ||
console.log("state after adding transition:"); | ||
console.log(state); | ||
// console.log("state after adding transition:"); | ||
// console.log(state); | ||
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161787
27
4569
8