IO-1167 IO-775 Minor bug fixes.

This commit is contained in:
Patrick Fic
2021-05-31 10:56:13 -07:00
parent af6bb18db2
commit afb0c85e9f
3 changed files with 21 additions and 24 deletions

View File

@@ -22,6 +22,7 @@ import { createStructuredSelector } from "reselect";
import { DELETE_JOB_LINE_BY_PK } from "../../graphql/jobs-lines.queries";
import { selectJobReadOnly } from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions";
import { selectTechnician } from "../../redux/tech/tech.selectors";
import { onlyUnique } from "../../utils/arrayHelper";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { alphaSort } from "../../utils/sorters";
@@ -37,6 +38,7 @@ import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.con
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
jobRO: selectJobReadOnly,
technician: selectTechnician,
});
const mapDispatchToProps = (dispatch) => ({
@@ -48,6 +50,7 @@ const mapDispatchToProps = (dispatch) => ({
export function JobLinesComponent({
jobRO,
technician,
setPartsOrderContext,
loading,
refetch,
@@ -364,7 +367,8 @@ export function JobLinesComponent({
disabled={
(job && !job.converted) ||
(selectedLines.length > 0 ? false : true) ||
jobRO
jobRO ||
technician
}
onClick={() => {
setPartsOrderContext({
@@ -399,7 +403,7 @@ export function JobLinesComponent({
<Button>{t("jobs.actions.mark")}</Button>
</Dropdown>
<Button
disabled={jobRO}
disabled={jobRO || technician}
onClick={() => {
setJobLineEditContext({
actions: { refetch: refetch },