/*!
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
*
* 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.
*/
import React from 'react';
import i18n from 'nfvo-utils/i18n/i18n.js';
import Input from 'nfvo-components/input/validation/Input.jsx';
import Form from 'nfvo-components/input/validation/Form.jsx';
import GridSection from 'nfvo-components/grid/GridSection.jsx';
import GridItem from 'nfvo-components/grid/GridItem.jsx';
import classnames from 'classnames';
const BackupSection = ({isReadOnlyMode,dataMap, onQDataChanged, qgenericFieldInfo}) => (
onQDataChanged({'storage/backup/backupSolution' : backupSolution})}
label={i18n('Backup Solution')}
type='text'
isValid={qgenericFieldInfo['storage/backup/backupSolution'].isValid}
errorText={qgenericFieldInfo['storage/backup/backupSolution'].errorText}
value={dataMap['storage/backup/backupSolution']}/>
onQDataChanged({'storage/backup/backupStorageSize' : backupStorageSize})}
label={i18n('Backup Storage Size (GB)')}
type='number'
isValid={qgenericFieldInfo['storage/backup/backupStorageSize'].isValid}
errorText={qgenericFieldInfo['storage/backup/backupStorageSize'].errorText}
value={dataMap['storage/backup/backupStorageSize']}/>
{
const selectedIndex = e.target.selectedIndex;
const val = e.target.options[selectedIndex].value;
onQDataChanged({'storage/backup/backupNIC' : val});}
}>
{i18n('Select...')}
{qgenericFieldInfo['storage/backup/backupNIC'].enum.map(hv => {hv.title} )}
);
const SnapshotBackupSection = ({dataMap, onQDataChanged, qgenericFieldInfo}) => (
onQDataChanged({'storage/snapshotBackup/snapshotFrequency' : snapshotFrequency})}
label={i18n('Backup Storage Size (GB)')}
type='number'
isValid={qgenericFieldInfo['storage/snapshotBackup/snapshotFrequency'].isValid}
errorText={qgenericFieldInfo['storage/snapshotBackup/snapshotFrequency'].errorText}
value={dataMap['storage/snapshotBackup/snapshotFrequency']}/>
);
const LogBackupSection = ({dataMap, onQDataChanged, qgenericFieldInfo}) => (
onQDataChanged({'storage/logBackup/sizeOfLogFiles' : sizeOfLogFiles})}
label={i18n('Backup Storage Size (GB)')}
type='number'
isValid={qgenericFieldInfo['storage/logBackup/sizeOfLogFiles'].isValid}
errorText={qgenericFieldInfo['storage/logBackup/sizeOfLogFiles'].errorText}
value={dataMap['storage/logBackup/sizeOfLogFiles']}/>
onQDataChanged({'storage/logBackup/logRetentionPeriod' : logRetentionPeriod})}
type='number'
isValid={qgenericFieldInfo['storage/logBackup/logRetentionPeriod'].isValid}
errorText={qgenericFieldInfo['storage/logBackup/logRetentionPeriod'].errorText}
value={dataMap['storage/logBackup/logRetentionPeriod']}/>
onQDataChanged({'storage/logBackup/logBackupFrequency' : logBackupFrequency})}
type='number'
isValid={qgenericFieldInfo['storage/logBackup/logBackupFrequency'].isValid}
errorText={qgenericFieldInfo['storage/logBackup/logBackupFrequency'].errorText}
value={dataMap['storage/logBackup/logBackupFrequency']}/>
onQDataChanged({'storage/logBackup/logFileLocation' : logFileLocation})}
type='text'
isValid={qgenericFieldInfo['storage/logBackup/logFileLocation'].isValid}
errorText={qgenericFieldInfo['storage/logBackup/logFileLocation'].errorText}
value={dataMap['storage/logBackup/logFileLocation']}/>
);
class SoftwareProductComponentStorageView extends React.Component {
static propTypes = {
componentId: React.PropTypes.string,
onQDataChanged: React.PropTypes.func,
onSubmit: React.PropTypes.func,
isReadOnlyMode: React.PropTypes.bool
};
render() {
let {onQDataChanged, dataMap, qGenericFieldInfo, isReadOnlyMode, onSubmit, qdata, version} = this.props;
return(
{qGenericFieldInfo && }
);
}
save(){
const {componentData, qdata, onSubmit, version} = this.props;
return onSubmit({componentData, qdata, version});
}
}
export default SoftwareProductComponentStorageView;