diff options
author | sstoykov <stela.stoykova@amdocs.com> | 2018-11-26 16:20:40 -0500 |
---|---|---|
committer | sstoykov <stela.stoykova@amdocs.com> | 2018-11-26 16:22:05 -0500 |
commit | 20d0dc060ba6b264b82a265c487d350e498a5135 (patch) | |
tree | 038c018e990e68bb3025a7da5c892e0b00673922 | |
parent | 94aebf60f65131426665b5cdbd56dec069299732 (diff) |
Removed edit attribute code
Removed obsolete code related to the edit attributes feature from sparky-fe.
Issue-ID: AAI-1956
Change-Id: I2a125b825991b832d6249acfcd03a189005e52b4
Signed-off-by: sstoykov <stela.stoykova@amdocs.com>
20 files changed, 4 insertions, 963 deletions
diff --git a/gulpfile.js b/gulpfile.js index fcb485d..93670fc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -37,14 +37,11 @@ let dist = 'dist/'; let path = { output: dist, aaiOutput: dist + '/aai/', - saOutput: dist + '/editAttributes/', assets: './resources/**/*.{css,png,svg,eot,ttf,woff,woff2,otf}', json: './src/**/*.json', aaiIndex: './src/index.html', - saIndex: './src/editAttributes/index.html', scss: './resources/scss/**/*.scss', aaiCss: dist + '/css', - saCss: dist + '/editAttributes/css', war: [dist + '**/*.html', dist + '**/*.js', dist + '**/*.{css,png,svg,eot,ttf,woff,woff2,otf}', dist + '**/*.json', 'webapp/**'], bundleSrc:[dist + '**/*.map'], wardest: dist @@ -52,19 +49,17 @@ let path = { taskMaker.defineTask('clean', {taskName: 'clean', src: path.output}); taskMaker.defineTask('copy', {taskName: 'copy-aai-index.html', src: path.aaiIndex, dest: path.output, rename: 'index.html'}); -taskMaker.defineTask('copy', {taskName: 'copy-sa-index.html', src: path.saIndex, dest: path.saOutput, rename: 'index.html'}); -taskMaker.defineTask('copy', {taskName: 'copy-sa-index.html', src: path.saIndex, dest: path.saOutput, rename: 'index.html'}); taskMaker.defineTask('copy', {taskName: 'copy-map-file', src: path.bundleSrc, dest: path.output, rename: 'mappingFile'}); taskMaker.defineTask('clean', {taskName: 'clean-map-file', src: path.bundleSrc}); /** Uncomment the loine below to generate a .war file with a local build */ // taskMaker.defineTask('compress', {taskName: 'compress-war', src: path.war, filename: appName + '.war', dest: path.wardest}) gulp.task('copy-dev-stuff', callback => { - return runSequence(['copy-aai-index.html', 'copy-sa-index.html'], callback); + return runSequence(['copy-aai-index.html'], callback); }); gulp.task('copy-stuff', callback => { - return runSequence(['copy-aai-index.html', 'copy-sa-index.html'], callback); + return runSequence(['copy-aai-index.html'], callback); }); gulp.task('dev', callback => { diff --git a/resources/scss/_modules.scss b/resources/scss/_modules.scss index e5ca532..4ac848f 100644 --- a/resources/scss/_modules.scss +++ b/resources/scss/_modules.scss @@ -25,7 +25,6 @@ @import "tier-support/splitPane"; @import "d3/_forceDirectedGraph.scss"; @import "d3/_aggregationMap.scss"; -@import "setAttribute/editAttributeform.scss"; @import "inventory/inventory.scss"; @import "vnfSearch/vnfSearch.scss"; @import "tier-support/tierSupport.scss"; diff --git a/resources/scss/setAttribute/_editAttributeform.scss b/resources/scss/setAttribute/_editAttributeform.scss deleted file mode 100644 index ceb5d45..0000000 --- a/resources/scss/setAttribute/_editAttributeform.scss +++ /dev/null @@ -1,119 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -html { - font-family: $base-font-regular; -} - -form { - margin: 50px 20px 20px 20px; - font-size: $body-font-1; -} - -div.attribute-field, div.centre { - display: flex; - flex-flow: row; - justify-content: center; - margin: 10px 5px; -} - -form > div > h2, -div.centre > span.error-message{ - min-width: 550px; - margin: 15px 0px 5px 0px; -} - -div.attribute-field > label { - font-weight: bold; - margin-right: 10px; - min-width: 170px; - text-align: right; - padding: 6px 9px; -} - -div.attribute-field > div { - flex: 1; - max-width: 500px; - display: flex; - flex-flow: column; - position: relative; -} - -div.attribute-field > div > * { - flex: 1; - padding: 5px 8px; - border: solid 1px $border-color5; -} - -div.attribute-field > div > select { - min-height: 30px; -} - -div > span.error-message { - font-weight: bold; - color: $background-color10; - border: none; -} - -div > span.error-message:before { - display: inline-block; - text-rendering: auto; - content: '\F06A'; - margin-right: 5px; - font: normal normal normal 14px/1 FontAwesome; -} - -form > div > button { - margin: 10px; - border-radius: 5px; - padding: 10px 5px 5px 5px; - font-weight: bold; - font-size: $heading-font-3; -} - -form > div > button[type=submit] { - color: $primary-background-color; - background-image: linear-gradient($background-color12, $background-color5); - border: solid 1px $border-color3; -} - -form > div > button[type=submit]:before { - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - text-rendering: auto; - content: '\F1D8'; - margin-right: 5px; -} - -form>div button[type=submit][disabled] { - opacity: .6; - cursor: not-allowed; -} - -form > div > button[type=button] { - color: $text-color3; - background-image: linear-gradient($primary-background-color, $background-color8); - border: solid 1px $border-color5; -} - -form>div button[type=button][disabled] { - opacity: .6; - cursor: not-allowed; -} diff --git a/src/editAttributes/AppStore.js b/src/editAttributes/AppStore.js deleted file mode 100644 index 888c659..0000000 --- a/src/editAttributes/AppStore.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import {combineReducers, createStore, compose, applyMiddleware} from 'redux'; -import thunkMiddleware from 'redux-thunk'; -import {reducer as formReducer} from 'redux-form'; - -import SetAttributeReducer from './EditAttributeReducer.js'; - -function createCompose() { - if (window.devToolsExtension) { - return compose( - applyMiddleware(thunkMiddleware), - window.devToolsExtension()); - } - else { - return applyMiddleware(thunkMiddleware); - } -} - -export const storeCreator = (initialState) => createStore( - combineReducers({ - setAttributes: SetAttributeReducer, - form: formReducer - }), - initialState, - createCompose() -); - - -const store = storeCreator(); - -export default store; - diff --git a/src/editAttributes/Application.jsx b/src/editAttributes/Application.jsx deleted file mode 100644 index 0817795..0000000 --- a/src/editAttributes/Application.jsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import React, {Component} from 'react'; -import {Provider} from 'react-redux'; -import store from 'editAttributes/AppStore.js'; - - -class Application extends Component { - - render() { - return ( - <Provider store={store}> - {this.props.children} - </Provider> - ); - } -} - -export default Application; diff --git a/src/editAttributes/EditAttributeActions.js b/src/editAttributes/EditAttributeActions.js deleted file mode 100644 index 468d7f4..0000000 --- a/src/editAttributes/EditAttributeActions.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import NetworkCalls from './networking/NetworkCalls.js'; -import { - POST, - BACKEND_POST_HEADER, - CREDENTIALS -} from './networking/NetworkConstants.js'; -import { - createEditEntityAttributeRequestObject -} from './networking/NetworkUtils.js'; -import { - setAttributesActionTypes, - EDIT_ENTITY_ATTRIBUTES_URL, - RESPONSE_CODE_SUCCESS, - RESPONSE_CODE_NOT_AUTHORIZED, - RESPONSE_MESSAGE_SUCCESS, - RESPONSE_MESSAGE_NOT_AUTHORIZED, - RESPONSE_MESSAGE_FAILURE, - RESPONSE_MESSAGE_NETWORK_ERROR -} from './EditAttributeConstants.js'; - -function errorReturnedEvent(errorMsg) { - return { - type: setAttributesActionTypes.SET_ATTRIBUTE_ERROR, - data: {errorMsg: errorMsg} - }; -} - -function successReturnedEvent() { - return { - type: setAttributesActionTypes.SET_ATTRIBUTE_SUCCESS, - data: {successMsg: RESPONSE_MESSAGE_SUCCESS} - }; -} - -function clearFeedbackMessageEvent() { - return { - type: setAttributesActionTypes.CLEAR_FEEDBACK_MESSAGE, - data: {} - }; -} - -export function clearFeebackMessage() { - return dispatch => { - dispatch(clearFeedbackMessageEvent()); - }; -} - -export function requestEditEntityAttributes(entityURI, entityAttributes) { - - let postBody = JSON.stringify( - createEditEntityAttributeRequestObject(entityURI, entityAttributes)); - return dispatch => { - return NetworkCalls.fetchRequest(EDIT_ENTITY_ATTRIBUTES_URL, - CREDENTIALS, POST, BACKEND_POST_HEADER, postBody).then( - (responseJson) => { - if (responseJson) { - if (responseJson.resultCode === RESPONSE_CODE_SUCCESS) { - dispatch(successReturnedEvent()); - } else if (responseJson.resultCode === RESPONSE_CODE_NOT_AUTHORIZED) { - dispatch(errorReturnedEvent(RESPONSE_MESSAGE_NOT_AUTHORIZED)); - } else { - dispatch(errorReturnedEvent(RESPONSE_MESSAGE_FAILURE)); - } - } - } - ).catch( - () => { - dispatch(errorReturnedEvent(RESPONSE_MESSAGE_NETWORK_ERROR)); - } - ); - }; -} diff --git a/src/editAttributes/EditAttributeConstants.js b/src/editAttributes/EditAttributeConstants.js deleted file mode 100644 index c0a35ed..0000000 --- a/src/editAttributes/EditAttributeConstants.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import keyMirror from 'utils/KeyMirror.js'; -import { - BASE_URL -} from './networking/NetworkConstants.js'; - -export const SET_ATTRIBUTE_TITLE = 'A&AI'; -export const ATTRIBUTE_MODIFICATION = 'ATTRIBUTE MODIFICATION'; - - - -export const EDIT_ENTITY_ATTRIBUTES_URL = BASE_URL + '/editEntity/editAttributes'; - -export const RESPONSE_CODE_SUCCESS = 200; -export const RESPONSE_CODE_NOT_AUTHORIZED = 403; - -export const RESPONSE_MESSAGE_SUCCESS = 'Success'; -export const RESPONSE_MESSAGE_NOT_AUTHORIZED = 'User not authorized'; -export const RESPONSE_MESSAGE_FAILURE = 'Failed to update entity'; -export const RESPONSE_MESSAGE_NETWORK_ERROR = 'Network error'; - -export const setAttributesActionTypes = keyMirror({ - SET_ATTRIBUTE_ERROR: null, - SET_ATTRIBUTE_SUCCESS: null, - CLEAR_FEEDBACK_MESSAGE: null -}); diff --git a/src/editAttributes/EditAttributeReducer.js b/src/editAttributes/EditAttributeReducer.js deleted file mode 100644 index 90c959d..0000000 --- a/src/editAttributes/EditAttributeReducer.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import {setAttributesActionTypes} from './EditAttributeConstants.js'; -import { - MESSAGE_LEVEL_SUCCESS, - MESSAGE_LEVEL_DANGER -} from 'utils/GlobalConstants.js'; - -export default (state = {}, action) => { - switch (action.type) { - case setAttributesActionTypes.SET_ATTRIBUTE_ERROR: - return { - ...state, - feedbackMsgText: action.data.errorMsg, - feedbackMsgSeverity: MESSAGE_LEVEL_DANGER - }; - - case setAttributesActionTypes.SET_ATTRIBUTE_SUCCESS: - return { - ...state, - feedbackMsgText: action.data.successMsg, - feedbackMsgSeverity: MESSAGE_LEVEL_SUCCESS - }; - - case setAttributesActionTypes.CLEAR_FEEDBACK_MESSAGE: - return { - ...state, - feedbackMsgText: '', - feedbackMsgSeverity: '' - }; - } - return state; -}; diff --git a/src/editAttributes/EditAttributes.jsx b/src/editAttributes/EditAttributes.jsx deleted file mode 100644 index 6aa390f..0000000 --- a/src/editAttributes/EditAttributes.jsx +++ /dev/null @@ -1,111 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import React, {Component} from 'react'; -import {connect} from 'react-redux'; -import i18n from 'utils/i18n/i18n'; - -import InlineMessage from 'generic-components/InlineMessage/InlineMessage.jsx'; -import { - clearFeebackMessage, - requestEditEntityAttributes -} from './EditAttributeActions.js'; -import { - SET_ATTRIBUTE_TITLE, - ATTRIBUTE_MODIFICATION -} from './EditAttributeConstants.js'; -import ChangeAttributeForm from 'editAttributes/changeAttributeForm/ChangeAttributeForm.jsx'; -import {NO_VALUE_SELECTED} from 'editAttributes/changeAttributeForm/ChangeAttributeFormConstants.js'; - -let mapStateToProps = ({setAttributes}) => { - let { - feedbackMsgText = '', - feedbackMsgSeverity = '' - } = setAttributes; - - return { - feedbackMsgText, - feedbackMsgSeverity - }; -}; - -let mapActionToProps = (dispatch) => { - return { - handleSubmit: (values) => { - let uri = values.uri; - let attrMap = new Map(); - attrMap.set('provStatus', 'prov-status'); - attrMap.set('inMaint', 'in-maint'); - attrMap.set('isClosedLoopDisabled', 'is-closed-loop-disabled'); - - let attributes = {}; - let valueString = JSON.stringify(values); - JSON.parse(valueString, (key, value) => { - if(value !== NO_VALUE_SELECTED) { - let formattedKey = attrMap.get(key); - if(formattedKey !== undefined) { - attributes = { - ...attributes, [formattedKey]: value - }; - } - return value; - } - }); - - dispatch(requestEditEntityAttributes(uri, attributes)); - }, - clearFeedbackMessage: () => { - dispatch(clearFeebackMessage()); - } - }; -}; - -class SetAttribute extends Component { - render() { - let { - feedbackMsgText, - feedbackMsgSeverity, - handleSubmit, - clearFeedbackMessage} = this.props; - return ( - <div> - <div className='header'> - <div className='application-title'>{i18n(SET_ATTRIBUTE_TITLE)}</div> - </div> - <div className='secondary-header'> - <span - className='secondary-title'>{i18n(ATTRIBUTE_MODIFICATION)}</span> - <InlineMessage level={feedbackMsgSeverity} - messageTxt={feedbackMsgText}/> - </div> - - <ChangeAttributeForm - onSubmit={(values) => { - handleSubmit(values); - }} - buttonSelected={() => { - clearFeedbackMessage(); - }}/> - </div> - ); - } -} - -export default connect(mapStateToProps, mapActionToProps)(SetAttribute); diff --git a/src/editAttributes/changeAttributeForm/ChangeAttributeForm.jsx b/src/editAttributes/changeAttributeForm/ChangeAttributeForm.jsx deleted file mode 100644 index b97d6bd..0000000 --- a/src/editAttributes/changeAttributeForm/ChangeAttributeForm.jsx +++ /dev/null @@ -1,156 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import React, {Component} from 'react'; -import {Field, Fields, reduxForm, propTypes} from 'redux-form'; -import i18n from 'utils/i18n/i18n'; - -import { - LABEL_NODE_URI, - LABEL_PROV_STATUS, - LABEL_ATTRIBUTES, - LABEL_IN_MAINT, - LABEL_IS_CLOSED_LOOP, - BUTTON_SUBMIT, - BUTTON_CLEAR, - NO_VALUE_SELECTED, - PREPROV, - NVTPROV, - DECOM, - PROV, - CAPPED, - RETIRED, - TRUE, - FALSE -} from './ChangeAttributeFormConstants.js'; -import validate from './validate.js'; - -class ChangeAttributeForm extends Component { - - static propTypes = { - ...propTypes - }; - - renderTextField = ({input, label, type, meta: {touched, error}}) => ( - <div className='attribute-field'> - <label>{label}</label> - <div> - <input {...input} placeholder={label} type={type} - onBlur={() => input.value === '' ? input.onBlur(' ') : input.onBlur()}/> - {touched && ((error && <span className='error-message'>{error}</span>))} - </div> - </div> - ); - - - booleanOptions = [ - <option value={NO_VALUE_SELECTED}>{i18n(NO_VALUE_SELECTED)}</option>, - <option value='true'>{i18n(TRUE)}</option>, - <option value='false'>{i18n(FALSE)}</option> - ]; - - provStatusOptions = [ - <option value={NO_VALUE_SELECTED}>{i18n(NO_VALUE_SELECTED)}</option>, - <option value={PREPROV}>{PREPROV}</option>, - <option value={NVTPROV}>{NVTPROV}</option>, - <option value={PROV}>{PROV}</option>, - <option value={CAPPED}>{CAPPED}</option>, - <option value={DECOM}>{DECOM}</option>, - <option value={RETIRED}>{RETIRED}</option> - ]; - - renderAttributeFields = (fields) => ( - <div> - <div className='centre'> - {(fields.provStatus.meta.touched || - fields.inMaint.meta.touched || - fields.isClosedLoopDisabled.meta.touched) && - fields.provStatus.meta.error && - <span className='error-message'>{fields.provStatus.meta.error}</span>} - </div> - <div className='attribute-field'> - <label>{LABEL_PROV_STATUS}</label> - <div> - <select {...fields.provStatus.input}> - {this.provStatusOptions} - </select> - </div> - </div> - <div className='attribute-field'> - <label>{LABEL_IN_MAINT}</label> - <div> - <select {...fields.inMaint.input}> - {this.booleanOptions} - </select> - </div> - </div> - <div className='attribute-field'> - <label>{LABEL_IS_CLOSED_LOOP}</label> - <div> - <select {...fields.isClosedLoopDisabled.input}> - {this.booleanOptions} - </select> - </div> - </div> - </div> - ); - - render() { - const { - handleSubmit, - buttonSelected, - pristine, - reset, - submitting} = this.props; - - return ( - <form onSubmit={handleSubmit}> - <Field name='uri' type='text' component={this.renderTextField} - label={i18n(LABEL_NODE_URI)}/> - <div className='centre'><h2>{i18n(LABEL_ATTRIBUTES)}</h2></div> - <Fields names={['provStatus', 'inMaint', 'isClosedLoopDisabled']} - component={this.renderAttributeFields}/> - <div className='centre'> - <button type='submit' - disabled={pristine || submitting} - onClick={() => { - buttonSelected(); - }}> - {i18n(BUTTON_SUBMIT)} - </button> - <button type='button' - disabled={pristine || submitting} - onClick={() => { - reset(); - buttonSelected(); - }}> - {i18n(BUTTON_CLEAR)} - </button> - </div> - </form> - ); - } -} - -export default reduxForm({ - form: 'changeAttributeForm', - validate -})(ChangeAttributeForm); - diff --git a/src/editAttributes/changeAttributeForm/ChangeAttributeFormConstants.js b/src/editAttributes/changeAttributeForm/ChangeAttributeFormConstants.js deleted file mode 100644 index ae6eee5..0000000 --- a/src/editAttributes/changeAttributeForm/ChangeAttributeFormConstants.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -export const LABEL_NODE_URI = 'Target Entity URI'; -export const LABEL_PROV_STATUS = 'prov-status'; -export const LABEL_IN_MAINT = 'in-maint'; -export const LABEL_IS_CLOSED_LOOP = 'is-closed-loop-disabled'; -export const LABEL_ATTRIBUTES = 'ATTRIBUTES'; - -export const BUTTON_SUBMIT = 'Submit'; -export const BUTTON_CLEAR = 'Clear'; - -export const NO_VALUE_SELECTED = 'No Value Selected'; -export const PREPROV = 'PREPROV'; -export const NVTPROV = 'NVTPROV'; -export const PROV = 'PROV'; -export const CAPPED = 'CAPPED'; -export const DECOM = 'DECOM'; -export const RETIRED = 'RETIRED'; -export const TRUE = 'TRUE'; -export const FALSE = 'FALSE'; - -export const ERROR_MISSING_ATTR = 'At least one attribute must be set'; -export const ERROR_REQUIRED = 'Required'; diff --git a/src/editAttributes/changeAttributeForm/ChangeAttributeFormReducer.js b/src/editAttributes/changeAttributeForm/ChangeAttributeFormReducer.js deleted file mode 100644 index 4edd1eb..0000000 --- a/src/editAttributes/changeAttributeForm/ChangeAttributeFormReducer.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -/*import { combineReducers } from 'redux' - import { reducer as formReducer } from 'redux-form' - - - - const reducer = combineReducers({ - form: formReducer.validation({ - changeAttributeForm: validate - }) - }); - - export default reducer; - */ diff --git a/src/editAttributes/changeAttributeForm/validate.js b/src/editAttributes/changeAttributeForm/validate.js deleted file mode 100644 index 450bb02..0000000 --- a/src/editAttributes/changeAttributeForm/validate.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import i18n from 'utils/i18n/i18n'; - -import { - ERROR_MISSING_ATTR, - ERROR_REQUIRED, - NO_VALUE_SELECTED -} from './ChangeAttributeFormConstants.js'; - -const validate = (values) => { - const errors = {}; - - if (!values.uri || values.uri.replace(/\s/g, '') === '') { - errors.uri = i18n(ERROR_REQUIRED); - } - if ((!values.provStatus || values.provStatus === NO_VALUE_SELECTED) && - (!values.inMaint || values.inMaint === NO_VALUE_SELECTED) && - (!values.isClosedLoopDisabled || - values.isClosedLoopDisabled === - NO_VALUE_SELECTED)) { - errors.provStatus = i18n(ERROR_MISSING_ATTR); - } - - return errors; -}; - -export default validate; diff --git a/src/editAttributes/index.html b/src/editAttributes/index.html deleted file mode 100644 index afd9a22..0000000 --- a/src/editAttributes/index.html +++ /dev/null @@ -1,34 +0,0 @@ -<!-- - - ============LICENSE_START======================================================= - org.onap.aai - ================================================================================ - Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - Copyright © 2017-2018 Amdocs - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - ---> -<html> -<head> - <meta charset="utf-8"> - <title>Edit Attributes</title> -</head> - -<body> -<div id="set-attribute-app"></div> -</body> - -<script src="editAttributesBundle.js"></script> -</html> diff --git a/src/editAttributes/main.app.jsx b/src/editAttributes/main.app.jsx deleted file mode 100644 index 17a4b18..0000000 --- a/src/editAttributes/main.app.jsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -import React from 'react'; -import ReactDOM from 'react-dom'; - -import 'resources/scss/bootstrap.scss'; -import 'resources/css/font-awesome.min.css'; -import 'resources/scss/style.scss'; - -import Application from './Application.jsx'; -import SetAttribute from './EditAttributes.jsx'; - -ReactDOM.render( - <Application><SetAttribute /></Application>, - document.getElementById('set-attribute-app')); diff --git a/src/editAttributes/networking/NetworkCalls.js b/src/editAttributes/networking/NetworkCalls.js deleted file mode 100644 index 7038e5e..0000000 --- a/src/editAttributes/networking/NetworkCalls.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -export default { - fetchRequest(URL, CREDENTIALS, METHOD, HEADER, BODY) { - return fetch(URL, { - credentials: CREDENTIALS, - method: METHOD, - headers: HEADER, - body: BODY - }).then( - (response) => response.json() - ); - } -}; diff --git a/src/editAttributes/networking/NetworkConstants.js b/src/editAttributes/networking/NetworkConstants.js deleted file mode 100644 index 09629fc..0000000 --- a/src/editAttributes/networking/NetworkConstants.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -export const POST = 'POST'; -export const POST_HEADER = { - 'Accept': 'application/json' -}; -export const BACKEND_POST_HEADER = { - 'Accept': 'application/json', - 'Content-Type': 'application/json' -}; -export const CREDENTIALS = 'same-origin'; -export const ERROR_RETRIEVING_DATA = 'Error fetching data from server'; -const BACKEND_IP_ADDRESS = document.location.hostname; -const BACKEND_PORT_NUMBER = window.location.port; -const PROTOCOL = window.location.protocol; -export const BASE_URL = PROTOCOL + '//' + BACKEND_IP_ADDRESS + ':' + BACKEND_PORT_NUMBER; diff --git a/src/editAttributes/networking/NetworkUtils.js b/src/editAttributes/networking/NetworkUtils.js deleted file mode 100644 index c8e65cb..0000000 --- a/src/editAttributes/networking/NetworkUtils.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -export function createEditEntityAttributeRequestObject(uri, attributes) { - return { - 'entity-uri': uri, - 'attributes': { - ...attributes - } - }; -} diff --git a/webpack.config.js b/webpack.config.js index b357f9a..7d2e53a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,10 +30,6 @@ module.exports = { bundle: [ 'app/main.app.jsx', 'webpack/hot/only-dev-server' - ], - 'editAttributes/editAttributesBundle': [ - 'editAttributes/main.app.jsx', - 'webpack/hot/only-dev-server' ] }, output: { @@ -48,8 +44,7 @@ module.exports = { app: 'src/app', 'generic-components': 'src/generic-components', utils: 'src/utils', - images: 'resources/images', - editAttributes: 'src/editAttributes' + images: 'resources/images' }, extensions: ["", ".webpack.js", ".web.js", ".js", ".json", ".jsx"] }, diff --git a/webpack.devConfig.js b/webpack.devConfig.js index 9f13b15..9e58faf 100644 --- a/webpack.devConfig.js +++ b/webpack.devConfig.js @@ -31,10 +31,6 @@ module.exports = { bundle: [ 'app/main.app.jsx', 'webpack/hot/only-dev-server' - ], - 'editAttributes/editAttributesBundle': [ - 'editAttributes/main.app.jsx', - 'webpack/hot/only-dev-server' ] }, output: { @@ -49,8 +45,7 @@ module.exports = { app: 'src/app', 'generic-components': 'src/generic-components', utils: 'src/utils', - images: 'resources/images', - editAttributes: 'src/editAttributes' + images: 'resources/images' }, extensions: ["", ".webpack.js", ".web.js", ".js", ".json", ".jsx"] }, |