diff --git a/client/src/Components/Event/Create/Tabs/Technical.js b/client/src/Components/Event/Create/Tabs/Technical.js
index a463b151d..56bdf46f9 100644
--- a/client/src/Components/Event/Create/Tabs/Technical.js
+++ b/client/src/Components/Event/Create/Tabs/Technical.js
@@ -1,4 +1,6 @@
import React from 'react';
+import { Query } from 'react-apollo';
+
import {
Typography,
FormControl,
@@ -8,10 +10,11 @@ import {
FormHelperText,
MenuItem,
} from '@material-ui/core';
-
import { withStyles } from '@material-ui/core/styles';
import styles from '../styles';
+import { getOptionsCalls } from '../../../../GraphQL/Calls/index';
+
class Technical extends React.Component {
render() {
@@ -25,17 +28,38 @@ class Technical extends React.Component {
Select the formula
- }
- displayEmpty
- className={classes.selectEmpty}
- onChange={newVal => edit('formulaId', newVal.target.value)}
- >
-
-
-
-
+
+ {({ loading, error, data }) => {
+ if (loading) {
+ return (
+ }
+ displayEmpty
+ className={classes.selectEmpty}
+ disabled
+ >
+
+
+ );
+ }
+ if (error) return `Error! ${error.message}`;
+ const selects = data.events_Formulas.map((formula, index) => (
+
+ ));
+ return (
+ }
+ displayEmpty
+ className={classes.selectEmpty}
+ onChange={newVal => edit('formulaId', newVal.target.value)}
+ >
+ {selects}
+
+ );
+ }}
+
console.log('Comming soon in a modaal')}>
To create a new formula, click here
@@ -44,17 +68,38 @@ class Technical extends React.Component {
Select the Plotter
- }
- displayEmpty
- className={classes.selectEmpty}
- onChange={newVal => edit('plotterId', newVal.target.value)}
- >
-
-
-
-
+
+ {({ loading, error, data }) => {
+ if (loading) {
+ return (
+ }
+ displayEmpty
+ className={classes.selectEmpty}
+ disabled
+ >
+
+
+ );
+ }
+ if (error) return `Error! ${error.message}`;
+ const selects = data.events_Plotters.map((plotter, index) => (
+
+ ));
+ return (
+ }
+ displayEmpty
+ className={classes.selectEmpty}
+ onChange={newVal => edit('plotterId', newVal.target.value)}
+ >
+ {selects}
+
+ );
+ }}
+
To create a new plotter, click here
diff --git a/client/src/GraphQL/Calls/getOptions.js b/client/src/GraphQL/Calls/getOptions.js
new file mode 100644
index 000000000..f7bd3edf0
--- /dev/null
+++ b/client/src/GraphQL/Calls/getOptions.js
@@ -0,0 +1,31 @@
+import gql from 'graphql-tag';
+
+const EVENTS_FORMULAS = gql`
+ query Events_Formulas{
+ events_Formulas {
+ id
+ ownerId
+ isTemplate
+ name
+ }
+ }
+`;
+
+const EVENTS_PLOTTERS = gql`
+ query Events_Plotters{
+ events_Plotters {
+ id
+ ownerId
+ isTemplate
+ name
+ host
+ repo
+ moduleName
+ }
+ }
+`;
+
+export default {
+ EVENTS_PLOTTERS,
+ EVENTS_FORMULAS,
+};
diff --git a/client/src/GraphQL/Calls/index.js b/client/src/GraphQL/Calls/index.js
index 334af1c78..b8225b64b 100644
--- a/client/src/GraphQL/Calls/index.js
+++ b/client/src/GraphQL/Calls/index.js
@@ -1,9 +1,11 @@
import hostedEventsCalls from './hostedEvents';
import listEventsCalls from './listEvents';
import showEventCalls from './showEvent';
+import getOptionsCalls from './getOptions';
export {
hostedEventsCalls,
listEventsCalls,
showEventCalls,
+ getOptionsCalls,
};