WIP for viewing CSI question sets BOD-380
This commit is contained in:
@@ -4004,6 +4004,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>csiq</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>customtemplates</name>
|
<name>customtemplates</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -4025,6 +4046,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>employees</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>intake</name>
|
<name>intake</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -4088,6 +4130,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>licensing</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>notemplatesavailable</name>
|
<name>notemplatesavailable</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -6499,6 +6562,32 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>csi</name>
|
<name>csi</name>
|
||||||
<children>
|
<children>
|
||||||
|
<folder_node>
|
||||||
|
<name>actions</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>activate</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>errors</name>
|
<name>errors</name>
|
||||||
<children>
|
<children>
|
||||||
@@ -7877,6 +7966,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>view</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Form } from "antd";
|
||||||
|
import ConfigFormComponents from "../config-form-components/config-form-components.component";
|
||||||
|
|
||||||
|
export default function ShopCsiConfigForm({ selectedCsi }) {
|
||||||
|
console.log("ShopCsiConfigForm -> selectedCsi", selectedCsi);
|
||||||
|
const readOnly = !!selectedCsi;
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const handleFinish = (values) => {
|
||||||
|
console.log("values :>> ", values);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
The Config Form {readOnly}
|
||||||
|
{selectedCsi && (
|
||||||
|
<Form form={form} onFinish={handleFinish}>
|
||||||
|
<ConfigFormComponents
|
||||||
|
readOnly={selectedCsi}
|
||||||
|
componentList={selectedCsi.config}
|
||||||
|
/>
|
||||||
|
</Form>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import { CheckCircleFilled } from "@ant-design/icons";
|
||||||
|
import { Button, Col, List, Row } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useQuery } from "react-apollo";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { GET_ALL_QUESTION_SETS } from "../../graphql/csi.queries";
|
||||||
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import ShopCsiConfigForm from "../shop-csi-config-form/shop-csi-config-form.component";
|
||||||
|
|
||||||
|
export default function ShopCsiConfig() {
|
||||||
|
const { loading, error, data } = useQuery(GET_ALL_QUESTION_SETS);
|
||||||
|
const [selectedCsi, setselectedCsi] = useState(null);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
if (loading) return <LoadingSpinner />;
|
||||||
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
The Config Form
|
||||||
|
<Row>
|
||||||
|
<Col span={3}>
|
||||||
|
<List
|
||||||
|
dataSource={data ? data.csiquestions : []}
|
||||||
|
renderItem={(item) => (
|
||||||
|
<List.Item>
|
||||||
|
<DateFormatter>{item.created_at}</DateFormatter>
|
||||||
|
{item.csis_aggregate.aggregate.count}
|
||||||
|
<Button onClick={() => setselectedCsi(item)}>
|
||||||
|
{t("general.actions.view")}
|
||||||
|
</Button>
|
||||||
|
{item.current ? (
|
||||||
|
<CheckCircleFilled />
|
||||||
|
) : (
|
||||||
|
<Button>{t("csi.actions.activate")}</Button>
|
||||||
|
)}
|
||||||
|
</List.Item>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={21}>
|
||||||
|
<ShopCsiConfigForm selectedCsi={selectedCsi} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -22,6 +22,22 @@ export const COMPLETE_SURVEY = gql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const GET_ALL_QUESTION_SETS = gql`
|
||||||
|
query GET_ALL_QUESTION_SETS {
|
||||||
|
csiquestions(order_by: { created_at: desc }) {
|
||||||
|
id
|
||||||
|
created_at
|
||||||
|
config
|
||||||
|
current
|
||||||
|
csis_aggregate {
|
||||||
|
aggregate {
|
||||||
|
count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
export const GET_CURRENT_QUESTIONSET_ID = gql`
|
export const GET_CURRENT_QUESTIONSET_ID = gql`
|
||||||
query GET_CURRENT_QUESTIONSET_ID {
|
query GET_CURRENT_QUESTIONSET_ID {
|
||||||
csiquestions(where: { current: { _eq: true } }) {
|
csiquestions(where: { current: { _eq: true } }) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React, { useEffect } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ShopEmployeesContainer from "../../components/shop-employees/shop-employees.container";
|
import ShopEmployeesContainer from "../../components/shop-employees/shop-employees.container";
|
||||||
import ShopInfoContainer from "../../components/shop-info/shop-info.container";
|
import ShopInfoContainer from "../../components/shop-info/shop-info.container";
|
||||||
|
import ShopCsiConfig from "../../components/shop-csi-config/shop-csi-config.component";
|
||||||
|
|
||||||
export default function ShopPage() {
|
export default function ShopPage() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -12,15 +13,18 @@ export default function ShopPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tabs.TabPane tab="Shop Info" key="info">
|
<Tabs.TabPane tab={t("bodyshop.labels.shopinfo")} key="info">
|
||||||
<ShopInfoContainer />
|
<ShopInfoContainer />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab="Employees" key="employees">
|
<Tabs.TabPane tab={t("bodyshop.labels.employees")} key="employees">
|
||||||
<ShopEmployeesContainer />
|
<ShopEmployeesContainer />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab="Licensing" key="licensing">
|
<Tabs.TabPane tab={t("bodyshop.labels.licensing")} key="licensing">
|
||||||
Licensing
|
Licensing
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane tab={t("bodyshop.labels.csiq")} key="csiq">
|
||||||
|
<ShopCsiConfig />
|
||||||
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,10 +262,13 @@
|
|||||||
"accountingtiers": "Number of Tiers to Use for Export",
|
"accountingtiers": "Number of Tiers to Use for Export",
|
||||||
"alljobstatuses": "All Job Statuses",
|
"alljobstatuses": "All Job Statuses",
|
||||||
"allopenjobstatuses": "All Open Job Statuses",
|
"allopenjobstatuses": "All Open Job Statuses",
|
||||||
|
"csiq": "CSI Questions",
|
||||||
"customtemplates": "Custom Templates",
|
"customtemplates": "Custom Templates",
|
||||||
|
"employees": "Employees",
|
||||||
"intake": "Job Intake",
|
"intake": "Job Intake",
|
||||||
"jobstatuses": "Job Statuses",
|
"jobstatuses": "Job Statuses",
|
||||||
"laborrates": "Labor Rates",
|
"laborrates": "Labor Rates",
|
||||||
|
"licensing": "Licensing",
|
||||||
"notemplatesavailable": "No templates available to add.",
|
"notemplatesavailable": "No templates available to add.",
|
||||||
"orderstatuses": "Order Statuses",
|
"orderstatuses": "Order Statuses",
|
||||||
"rbac": "Role Based Access Control",
|
"rbac": "Role Based Access Control",
|
||||||
@@ -424,6 +427,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"csi": {
|
"csi": {
|
||||||
|
"actions": {
|
||||||
|
"activate": "Activate"
|
||||||
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"creating": "Error creating survey {{message}}",
|
"creating": "Error creating survey {{message}}",
|
||||||
"notconfigured": "You do not have any current CSI Question Sets configured.",
|
"notconfigured": "You do not have any current CSI Question Sets configured.",
|
||||||
@@ -530,7 +536,8 @@
|
|||||||
"save": "Save",
|
"save": "Save",
|
||||||
"saveandnew": "Save and New",
|
"saveandnew": "Save and New",
|
||||||
"submit": "Submit",
|
"submit": "Submit",
|
||||||
"submitticket": "Submit a Support Ticket"
|
"submitticket": "Submit a Support Ticket",
|
||||||
|
"view": "View"
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "CC Contract",
|
"contract": "CC Contract",
|
||||||
|
|||||||
@@ -262,10 +262,13 @@
|
|||||||
"accountingtiers": "",
|
"accountingtiers": "",
|
||||||
"alljobstatuses": "",
|
"alljobstatuses": "",
|
||||||
"allopenjobstatuses": "",
|
"allopenjobstatuses": "",
|
||||||
|
"csiq": "",
|
||||||
"customtemplates": "",
|
"customtemplates": "",
|
||||||
|
"employees": "",
|
||||||
"intake": "",
|
"intake": "",
|
||||||
"jobstatuses": "",
|
"jobstatuses": "",
|
||||||
"laborrates": "",
|
"laborrates": "",
|
||||||
|
"licensing": "",
|
||||||
"notemplatesavailable": "",
|
"notemplatesavailable": "",
|
||||||
"orderstatuses": "",
|
"orderstatuses": "",
|
||||||
"rbac": "",
|
"rbac": "",
|
||||||
@@ -424,6 +427,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"csi": {
|
"csi": {
|
||||||
|
"actions": {
|
||||||
|
"activate": ""
|
||||||
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"creating": "",
|
"creating": "",
|
||||||
"notconfigured": "",
|
"notconfigured": "",
|
||||||
@@ -530,7 +536,8 @@
|
|||||||
"save": "Salvar",
|
"save": "Salvar",
|
||||||
"saveandnew": "",
|
"saveandnew": "",
|
||||||
"submit": "",
|
"submit": "",
|
||||||
"submitticket": ""
|
"submitticket": "",
|
||||||
|
"view": ""
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "",
|
"contract": "",
|
||||||
|
|||||||
@@ -262,10 +262,13 @@
|
|||||||
"accountingtiers": "",
|
"accountingtiers": "",
|
||||||
"alljobstatuses": "",
|
"alljobstatuses": "",
|
||||||
"allopenjobstatuses": "",
|
"allopenjobstatuses": "",
|
||||||
|
"csiq": "",
|
||||||
"customtemplates": "",
|
"customtemplates": "",
|
||||||
|
"employees": "",
|
||||||
"intake": "",
|
"intake": "",
|
||||||
"jobstatuses": "",
|
"jobstatuses": "",
|
||||||
"laborrates": "",
|
"laborrates": "",
|
||||||
|
"licensing": "",
|
||||||
"notemplatesavailable": "",
|
"notemplatesavailable": "",
|
||||||
"orderstatuses": "",
|
"orderstatuses": "",
|
||||||
"rbac": "",
|
"rbac": "",
|
||||||
@@ -424,6 +427,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"csi": {
|
"csi": {
|
||||||
|
"actions": {
|
||||||
|
"activate": ""
|
||||||
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"creating": "",
|
"creating": "",
|
||||||
"notconfigured": "",
|
"notconfigured": "",
|
||||||
@@ -530,7 +536,8 @@
|
|||||||
"save": "sauvegarder",
|
"save": "sauvegarder",
|
||||||
"saveandnew": "",
|
"saveandnew": "",
|
||||||
"submit": "",
|
"submit": "",
|
||||||
"submitticket": ""
|
"submitticket": "",
|
||||||
|
"view": ""
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "",
|
"contract": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user