Loading js-apps/frontend/package-lock.json +2 −2 Changes for js-apps/frontend/package-lock.json: 2 added lines, 2 removed lines. Original line number Diff line number Diff line { "name": "mec-sandbox", "name": "edgenative-connector-frontend", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mec-sandbox", "name": "edgenative-connector-frontend", "version": "1.0.0", "license": "ISC", "dependencies": { Loading js-apps/frontend/src/js/app-constants.js +2 −0 Changes for js-apps/frontend/src/js/app-constants.js: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ export const DIALOG_VERSION = 'DIALOG_VERSION'; // Alert Types export const ALERT_DEGRADED_NETWORK = 'ALERT_DEGRADED_NETWORK'; export const ALERT_NEM_NOT_RUNNING = 'ALERT_NEM_NOT_RUNNING'; export const MSG_NEM_NOT_RUNNING = 'The Network Emulation stack is not running'; // Trivia export const NO_SCENARIO_NAME = 'NO_SCENARIO_NAME_12Q(*&HGHG___--9098'; Loading js-apps/frontend/src/js/containers/sandbox/configuration-pane.js +14 −1 Changes for js-apps/frontend/src/js/containers/sandbox/configuration-pane.js: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import { DEFAULT_NO_NETWORK_FILE_SELECTED, NO_SCENARIO_NAME, ALERT_DEGRADED_NETWORK, ALERT_NEM_NOT_RUNNING, MSG_NEM_NOT_RUNNING, DIALOG_CONFIRM_DELETE_APP, DIALOG_CREATE_NEW_APP, MAX_NB_USER_APPS, Loading Loading @@ -499,6 +501,11 @@ class ConfigPane extends Component { }} value={this.props.networkFileSelected} /> {this.props.currentAlert === ALERT_NEM_NOT_RUNNING && <Typography use="subtitle2" style={styles.nemErrorText}> {MSG_NEM_NOT_RUNNING} </Typography> } </GridCell> </Grid> Loading Loading @@ -690,7 +697,7 @@ class ConfigPane extends Component { </Grid> } <div hidden={!this.props.currentAlert} style={{ width: '100%', borderTop: '2px solid #e4e4e4', marginTop: 30, marginBottom: 10}} /> <div hidden={this.props.currentAlert !== ALERT_DEGRADED_NETWORK} style={{ width: '100%', borderTop: '2px solid #e4e4e4', marginTop: 30, marginBottom: 10}} /> <div hidden={(this.props.currentAlert !== ALERT_DEGRADED_NETWORK)}> <Grid> Loading Loading @@ -751,6 +758,12 @@ const styles = { }, select: { width: '100%' }, nemErrorText: { color: 'red', fontWeight: 'bold', display: 'block', marginTop: 10 } }; Loading js-apps/frontend/src/js/containers/sandbox/sandbox-page-container.js +18 −4 Changes for js-apps/frontend/src/js/containers/sandbox/sandbox-page-container.js: 18 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -15,13 +15,17 @@ import DetailedDataDialog from '../../components/dialogs/detailed-data-dialog'; import { uiChangeCurrentDialog, uiChangeCurrentAlert, uiSandboxChangeNetworkFilesList } from '../../state/ui'; import { StatusCodes } from 'http-status-codes'; import { PAGE_SANDBOX, DEFAULT_NO_NETWORK_FILE_SELECTED, DIALOG_DETAILED_DATA DIALOG_DETAILED_DATA, ALERT_NEM_NOT_RUNNING } from '../../app-constants'; Loading @@ -47,18 +51,26 @@ class SandboxPageContainer extends Component { * @param {module:model/ScenarioList} data The data returned by the service call. * @param {String} response The complete HTTP response. */ getScenarioListLoadCb(error, data /*, response*/) { getScenarioListLoadCb(error, data, response) { if (error !== null) { // TODO: consider showgina an alert const status = (error && error.status) || (response && response.status); if (status === StatusCodes.BAD_GATEWAY || status === StatusCodes.GATEWAY_TIMEOUT || status === StatusCodes.REQUEST_TIMEOUT || status === 0) { this.props.changeCurrentAlert(ALERT_NEM_NOT_RUNNING); } return; } if (this.props.currentAlert === ALERT_NEM_NOT_RUNNING) { this.props.changeCurrentAlert(null); } if (!data.scenarios) { return; } let files = _.map(data.scenarios, 'name'); files.unshift(DEFAULT_NO_NETWORK_FILE_SELECTED); this.props.changeNetworkFilesList(files); } updateNetworkFileList() { Loading Loading @@ -185,6 +197,7 @@ const mapStateToProps = state => { return { page: state.ui.page, currentDialog: state.ui.currentDialog, currentAlert: state.ui.currentAlert, detailedData: state.ui.detailedData }; }; Loading @@ -192,6 +205,7 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { changeCurrentDialog: type => dispatch(uiChangeCurrentDialog(type)), changeCurrentAlert: alert => dispatch(uiChangeCurrentAlert(alert)), changeNetworkFilesList: list => dispatch(uiSandboxChangeNetworkFilesList(list)) }; }; Loading Loading
js-apps/frontend/package-lock.json +2 −2 Changes for js-apps/frontend/package-lock.json: 2 added lines, 2 removed lines. Original line number Diff line number Diff line { "name": "mec-sandbox", "name": "edgenative-connector-frontend", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mec-sandbox", "name": "edgenative-connector-frontend", "version": "1.0.0", "license": "ISC", "dependencies": { Loading
js-apps/frontend/src/js/app-constants.js +2 −0 Changes for js-apps/frontend/src/js/app-constants.js: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ export const DIALOG_VERSION = 'DIALOG_VERSION'; // Alert Types export const ALERT_DEGRADED_NETWORK = 'ALERT_DEGRADED_NETWORK'; export const ALERT_NEM_NOT_RUNNING = 'ALERT_NEM_NOT_RUNNING'; export const MSG_NEM_NOT_RUNNING = 'The Network Emulation stack is not running'; // Trivia export const NO_SCENARIO_NAME = 'NO_SCENARIO_NAME_12Q(*&HGHG___--9098'; Loading
js-apps/frontend/src/js/containers/sandbox/configuration-pane.js +14 −1 Changes for js-apps/frontend/src/js/containers/sandbox/configuration-pane.js: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import { DEFAULT_NO_NETWORK_FILE_SELECTED, NO_SCENARIO_NAME, ALERT_DEGRADED_NETWORK, ALERT_NEM_NOT_RUNNING, MSG_NEM_NOT_RUNNING, DIALOG_CONFIRM_DELETE_APP, DIALOG_CREATE_NEW_APP, MAX_NB_USER_APPS, Loading Loading @@ -499,6 +501,11 @@ class ConfigPane extends Component { }} value={this.props.networkFileSelected} /> {this.props.currentAlert === ALERT_NEM_NOT_RUNNING && <Typography use="subtitle2" style={styles.nemErrorText}> {MSG_NEM_NOT_RUNNING} </Typography> } </GridCell> </Grid> Loading Loading @@ -690,7 +697,7 @@ class ConfigPane extends Component { </Grid> } <div hidden={!this.props.currentAlert} style={{ width: '100%', borderTop: '2px solid #e4e4e4', marginTop: 30, marginBottom: 10}} /> <div hidden={this.props.currentAlert !== ALERT_DEGRADED_NETWORK} style={{ width: '100%', borderTop: '2px solid #e4e4e4', marginTop: 30, marginBottom: 10}} /> <div hidden={(this.props.currentAlert !== ALERT_DEGRADED_NETWORK)}> <Grid> Loading Loading @@ -751,6 +758,12 @@ const styles = { }, select: { width: '100%' }, nemErrorText: { color: 'red', fontWeight: 'bold', display: 'block', marginTop: 10 } }; Loading
js-apps/frontend/src/js/containers/sandbox/sandbox-page-container.js +18 −4 Changes for js-apps/frontend/src/js/containers/sandbox/sandbox-page-container.js: 18 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -15,13 +15,17 @@ import DetailedDataDialog from '../../components/dialogs/detailed-data-dialog'; import { uiChangeCurrentDialog, uiChangeCurrentAlert, uiSandboxChangeNetworkFilesList } from '../../state/ui'; import { StatusCodes } from 'http-status-codes'; import { PAGE_SANDBOX, DEFAULT_NO_NETWORK_FILE_SELECTED, DIALOG_DETAILED_DATA DIALOG_DETAILED_DATA, ALERT_NEM_NOT_RUNNING } from '../../app-constants'; Loading @@ -47,18 +51,26 @@ class SandboxPageContainer extends Component { * @param {module:model/ScenarioList} data The data returned by the service call. * @param {String} response The complete HTTP response. */ getScenarioListLoadCb(error, data /*, response*/) { getScenarioListLoadCb(error, data, response) { if (error !== null) { // TODO: consider showgina an alert const status = (error && error.status) || (response && response.status); if (status === StatusCodes.BAD_GATEWAY || status === StatusCodes.GATEWAY_TIMEOUT || status === StatusCodes.REQUEST_TIMEOUT || status === 0) { this.props.changeCurrentAlert(ALERT_NEM_NOT_RUNNING); } return; } if (this.props.currentAlert === ALERT_NEM_NOT_RUNNING) { this.props.changeCurrentAlert(null); } if (!data.scenarios) { return; } let files = _.map(data.scenarios, 'name'); files.unshift(DEFAULT_NO_NETWORK_FILE_SELECTED); this.props.changeNetworkFilesList(files); } updateNetworkFileList() { Loading Loading @@ -185,6 +197,7 @@ const mapStateToProps = state => { return { page: state.ui.page, currentDialog: state.ui.currentDialog, currentAlert: state.ui.currentAlert, detailedData: state.ui.detailedData }; }; Loading @@ -192,6 +205,7 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { changeCurrentDialog: type => dispatch(uiChangeCurrentDialog(type)), changeCurrentAlert: alert => dispatch(uiChangeCurrentAlert(alert)), changeNetworkFilesList: list => dispatch(uiSandboxChangeNetworkFilesList(list)) }; }; Loading