Namespace selection for users, reports and report-templates

This commit is contained in:
Tomas Bures 2017-07-24 14:43:32 +03:00
parent 4822a50d0b
commit e7bdfb7745
16 changed files with 210 additions and 62 deletions

View file

@ -0,0 +1,30 @@
'use strict';
import React, { Component } from 'react';
import { translate } from 'react-i18next';
import { TreeTableSelect } from './form';
@translate()
class NamespaceSelect extends Component {
render() {
const t = this.props.t;
return (
<TreeTableSelect id="namespace" label={t('Namespace')} dataUrl="/rest/namespaces-tree"/>
);
}
}
function validateNamespace(t, state) {
if (!state.getIn(['namespace', 'value'])) {
state.setIn(['namespace', 'error'], t('Namespace must be selected'));
} else {
state.setIn(['namespace', 'error'], null);
}
}
export {
NamespaceSelect,
validateNamespace
};