Simplify available jobs page IO-454
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Button } from "antd";
|
||||
import JobsAvailableContainer from "../../components/jobs-available-new/jobs-available-new.container";
|
||||
import JobsAvailableSupplementContainer from "../../components/jobs-available-supplement/jobs-available-supplement.container";
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function JobsAvailablePageComponent({
|
||||
deleteJob,
|
||||
estDataLazyLoad
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Link to="/manage/jobs/new">
|
||||
<Button>{t("jobs.actions.manualnew")}</Button>
|
||||
</Link>
|
||||
|
||||
<JobsAvailableContainer
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
|
||||
<JobsAvailableSupplementContainer
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
import { Button } from "antd";
|
||||
import React, { useEffect } from "react";
|
||||
import { useMutation, useLazyQuery } from "@apollo/react-hooks";
|
||||
import {
|
||||
DELETE_AVAILABLE_JOB,
|
||||
QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK,
|
||||
} from "../../graphql/available-jobs.queries";
|
||||
import JobsAvailablePageComponent from "./jobs-available.page.component";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import JobsAvailableTableContainer from "../../components/jobs-available-table/jobs-available-table.container";
|
||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||
|
||||
import {
|
||||
setBreadcrumbs,
|
||||
setSelectedHeader,
|
||||
} from "../../redux/application/application.actions";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
setSelectedHeader: (key) => dispatch(setSelectedHeader(key)),
|
||||
@@ -22,11 +19,8 @@ export function JobsAvailablePageContainer({
|
||||
setBreadcrumbs,
|
||||
setSelectedHeader,
|
||||
}) {
|
||||
const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const estDataLazyLoad = useLazyQuery(QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.jobsavailable");
|
||||
setSelectedHeader("availablejobs");
|
||||
@@ -38,10 +32,10 @@ export function JobsAvailablePageContainer({
|
||||
return (
|
||||
<RbacWrapper action="jobs:available-list">
|
||||
<div>
|
||||
<JobsAvailablePageComponent
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
<Link to="/manage/jobs/new">
|
||||
<Button>{t("jobs.actions.manualnew")}</Button>
|
||||
</Link>
|
||||
<JobsAvailableTableContainer />
|
||||
</div>
|
||||
</RbacWrapper>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user