Further cleanup of components for subscription use
This commit is contained in:
@@ -38,7 +38,7 @@ class AppContainer extends Component {
|
|||||||
// split based on operation type
|
// split based on operation type
|
||||||
({ query }) => {
|
({ query }) => {
|
||||||
const definition = getMainDefinition(query);
|
const definition = getMainDefinition(query);
|
||||||
console.log("000000", definition.operation);
|
console.log("##Intercepted GQL Transaction##", query);
|
||||||
return (
|
return (
|
||||||
definition.kind === "OperationDefinition" &&
|
definition.kind === "OperationDefinition" &&
|
||||||
definition.operation === "subscription"
|
definition.operation === "subscription"
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default () => {
|
|||||||
mutation: UPSERT_USER,
|
mutation: UPSERT_USER,
|
||||||
variables: { authEmail: user.email, authToken: user.uid }
|
variables: { authEmail: user.email, authToken: user.uid }
|
||||||
})
|
})
|
||||||
.then(r => console.log("Successful Upsert", r))
|
.then()
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log("Upsert error!!!!", error);
|
console.log("Upsert error!!!!", error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,16 +12,12 @@ class SignInForm extends React.Component {
|
|||||||
|
|
||||||
handleSubmit = e => {
|
handleSubmit = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const { apolloClient } = this.props;
|
|
||||||
|
|
||||||
this.props.form.validateFields(async (err, values) => {
|
this.props.form.validateFields(async (err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
const { email, password } = values;
|
const { email, password } = values;
|
||||||
try {
|
try {
|
||||||
const { user } = await auth.signInWithEmailAndPassword(
|
await auth.signInWithEmailAndPassword(email, password);
|
||||||
email,
|
|
||||||
password
|
|
||||||
);
|
|
||||||
|
|
||||||
this.props.form.resetFields();
|
this.props.form.resetFields();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Redirect } from "react-router-dom";
|
//import { Redirect } from "react-router-dom";
|
||||||
import firebase from "../../firebase/firebase.utils";
|
import firebase from "../../firebase/firebase.utils";
|
||||||
export default class SignOut extends Component {
|
export default class SignOut extends Component {
|
||||||
state = {
|
state = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { gql } from "apollo-boost";
|
import { gql } from "apollo-boost";
|
||||||
|
|
||||||
export const GET_ALL_OPEN_JOBS = gql`
|
export const GET_ALL_OPEN_JOBS = gql`
|
||||||
query {
|
{
|
||||||
jobs {
|
jobs {
|
||||||
id
|
id
|
||||||
est_number
|
est_number
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useQuery, useSubscription } from "@apollo/react-hooks";
|
import { useQuery, useSubscription } from "@apollo/react-hooks";
|
||||||
|
import AlertComponent from "../../components/alert/alert.component";
|
||||||
//import { GET_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
|
//import { GET_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
|
||||||
import { Table, Divider, Icon } from "antd";
|
import { Table, Divider, Icon } from "antd";
|
||||||
|
|
||||||
@@ -76,9 +77,7 @@ export default function JobsPage() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
//if (loading) return "Loading";
|
//if (loading) return "Loading";
|
||||||
if (error) return `Error! ${error.message}`;
|
if (error) return <AlertComponent message={error.message} />;
|
||||||
//console.log("$$$Develop (jobs.page.jsx) | jobs", jobs);
|
|
||||||
console.log("JobsPage Rendering...");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user