Added dashboard framework. Components are not yet created nor is the query finalized. BOD-79

Missed in previous commit. BOD-79
This commit is contained in:
Patrick Fic
2020-07-14 15:21:38 -07:00
parent e91751e20c
commit 2eb8360f5d
28 changed files with 753 additions and 85 deletions

View File

@@ -3,6 +3,13 @@ import gql from "graphql-tag";
export const QUERY_BODYSHOP = gql`
query QUERY_BODYSHOP {
bodyshops(where: { associations: { active: { _eq: true } } }) {
associations {
user {
authid
email
dashboardlayout
}
}
address1
address2
city
@@ -114,3 +121,36 @@ export const QUERY_STRIPE_ID = gql`
}
}
`;
export const QUERY_DASHBOARD_DETAILS = gql`
query QUERY_DASHBOARD_DETAILS {
query
QUERY_DASHBOARD_DETAILS {
jobs {
id
clm_total
scheduled_completion
date_invoiced
ins_co_nm
}
compJobs: jobs(where: { inproduction: { _eq: true } }) {
id
scheduled_completion
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAB" } }) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" } }) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
}
`;

View File

@@ -828,6 +828,8 @@ export const QUERY_ALL_JOBS_PAGINATED = gql`
}
`;
export const QUERY_JOB_CLOSE_DETAILS = gql`
query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
jobs_by_pk(id: $id) {

View File

@@ -13,6 +13,18 @@ export const UPSERT_USER = gql`
}
`;
export const UPDATE_DASHBOARD_LAYOUT = gql`
mutation UPDATE_DASHBOARD_LAYOUT($email: String!, $layout: jsonb!) {
update_users_by_pk(
pk_columns: { email: $email }
_set: { dashboardlayout: $layout }
) {
email
dashboardlayout
}
}
`;
export const UPDATE_FCM_TOKEN = gql`
mutation UPDATE_FCM_TOKEN($authEmail: String!, $token: jsonb!) {
update_users(