ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/components/vm-server-relationship-form/vm-server-relationship-form.schema.js

Summary

Maintainability
A
0 mins
Test Coverage
import { componentTypes } from '@@ddf';

const createSchema = (promise) => ({
  fields: [{
    component: componentTypes.SELECT,
    name: 'serverId',
    id: 'serverId',
    label: __('Select Server:'),
    placeholder: `<${__('Not a Server')}>`,
    includeEmpty: true,
    loadOptions: () => promise.then(({ resources }) => resources.map(({ id, name }) => ({ label: name, value: id }))),
  }],
});

export default createSchema;