Added database changes and faced issues with permissions. Added shop query.
This commit is contained in:
@@ -14,21 +14,21 @@ class WhiteBoardCard extends React.Component {
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const {
|
||||
onClick,
|
||||
className,
|
||||
name,
|
||||
cardStyle,
|
||||
body,
|
||||
dueOn,
|
||||
cardColor,
|
||||
subTitle,
|
||||
tagStyle,
|
||||
escalationText,
|
||||
tags,
|
||||
showDeleteButton,
|
||||
onDelete
|
||||
} = this.props;
|
||||
// const {
|
||||
// onClick,
|
||||
// className,
|
||||
// name,
|
||||
// cardStyle,
|
||||
// body,
|
||||
// dueOn,
|
||||
// cardColor,
|
||||
// subTitle,
|
||||
// tagStyle,
|
||||
// escalationText,
|
||||
// tags,
|
||||
// showDeleteButton,
|
||||
// onDelete
|
||||
// } = this.props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import React from "react";
|
||||
import { Query, Mutation } from "react-apollo";
|
||||
import { Query } from "react-apollo";
|
||||
|
||||
import WhiteBoardLeftSiderComponent from './white-board-left-sider.component'
|
||||
import WhiteBoardLeftSiderComponent from "./white-board-left-sider.component";
|
||||
import Spin from "../loading-spinner/loading-spinner.component";
|
||||
import { GET_WHITE_BOARD_LEFT_SIDER_VISIBLE } from "../../graphql/local.queries";
|
||||
|
||||
export default function WhiteBoardPageContainer() {
|
||||
return (
|
||||
<Query query={GET_WHITE_BOARD_LEFT_SIDER_VISIBLE}>
|
||||
{({ loading, error, data: { whiteBoardLeftSiderVisible} }) => {
|
||||
{({ loading, error, data: { whiteBoardLeftSiderVisible } }) => {
|
||||
if (loading) return <Spin />;
|
||||
if (error) return error.message;
|
||||
return <WhiteBoardLeftSiderComponent visible={whiteBoardLeftSiderVisible}/>;
|
||||
return (
|
||||
<WhiteBoardLeftSiderComponent visible={whiteBoardLeftSiderVisible} />
|
||||
);
|
||||
}}
|
||||
</Query>
|
||||
);
|
||||
|
||||
19
client/src/graphql/jobs.queries.js
Normal file
19
client/src/graphql/jobs.queries.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const GET_ALL_OPEN_JOBS = gql`
|
||||
{
|
||||
jobs {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
scheduled_completion
|
||||
scheduled_delivery
|
||||
vehicle {
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
plate_no
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
14
client/src/graphql/user.queries.js
Normal file
14
client/src/graphql/user.queries.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const UPSERT_USER = gql`
|
||||
mutation upsert_user($authEmail: String!, $authToken: String!) {
|
||||
insert_users(
|
||||
objects: [{ email: $authEmail, authid: $authToken }]
|
||||
on_conflict: { constraint: users_pkey, update_columns: [authid] }
|
||||
) {
|
||||
returning {
|
||||
authid
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,9 +1,25 @@
|
||||
import React from 'react'
|
||||
import React from "react";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
//import { GET_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
|
||||
import { gql } from "apollo-boost";
|
||||
import Spin from "../../components/loading-spinner/loading-spinner.component";
|
||||
|
||||
const g = gql`
|
||||
{
|
||||
associations {
|
||||
id
|
||||
shopid
|
||||
useremail
|
||||
active
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default function JobsPage() {
|
||||
return (
|
||||
<div>
|
||||
Jobs Master Page
|
||||
</div>
|
||||
)
|
||||
const { loading, error, data } = useQuery(g);
|
||||
|
||||
if (loading) return <Spin />;
|
||||
if (error) return `Error! ${error.message}`;
|
||||
console.log(data);
|
||||
return <div>Hi</div>;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import Board from "react-trello";
|
||||
import WhiteBoardCard from "../../components/white-board-card/white-board-card.component";
|
||||
import WhiteBoardLeftSiderContainer from "../../components/white-board-left-sider/white-board-left-sider.container";
|
||||
import { Layout, Icon, Menu } from "antd";
|
||||
import { Layout } from "antd";
|
||||
|
||||
export default function WhiteBoardPage({ whiteBoardLeftSiderVisible }) {
|
||||
const data = {
|
||||
|
||||
Reference in New Issue
Block a user