From 7affec5e01622139a67cdd3a322011ab1bf34ba0 Mon Sep 17 00:00:00 2001 From: ismay Date: Thu, 27 Jul 2023 11:34:58 +0200 Subject: [PATCH] chore: remove top back to overview button --- .../add-route/back-to-all-jobs.feature | 9 ------- .../add-route/back-to-all-jobs/index.js | 4 --- .../add-sequence/back-to-all-jobs.feature | 9 ------- .../add-sequence/back-to-all-jobs/index.js | 4 --- .../edit-route/back-to-all-jobs.feature | 9 ------- .../edit-route/back-to-all-jobs/index.js | 4 --- i18n/en.pot | 10 ++++---- src/components/Forms/JobAddForm.js | 23 ++--------------- src/components/Forms/JobAddForm.test.js | 23 ----------------- src/components/Forms/JobAddFormContainer.js | 10 +------- src/components/Forms/JobEditForm.js | 23 ++--------------- src/components/Forms/JobEditForm.test.js | 25 ------------------- src/components/Forms/JobEditFormContainer.js | 6 ++--- src/components/Forms/SequenceAddForm.js | 23 ++--------------- src/components/Forms/SequenceAddForm.test.js | 21 ---------------- .../Forms/SequenceAddFormContainer.js | 10 +------- src/pages/JobAdd/JobAdd.js | 14 ++--------- src/pages/JobAdd/JobAdd.module.css | 4 --- src/pages/JobEdit/JobEdit.js | 16 ++---------- src/pages/JobEdit/JobEdit.module.css | 4 --- src/pages/JobView/JobView.js | 3 --- src/pages/SequenceAdd/SequenceAdd.js | 14 ++--------- src/pages/SequenceAdd/SequenceAdd.module.css | 4 --- src/pages/SequenceEdit/SequenceEdit.js | 8 ------ .../SequenceEdit/SequenceEdit.module.css | 4 --- 25 files changed, 21 insertions(+), 263 deletions(-) diff --git a/cypress/integration/add-route/back-to-all-jobs.feature b/cypress/integration/add-route/back-to-all-jobs.feature index 5958950f2..528db2940 100644 --- a/cypress/integration/add-route/back-to-all-jobs.feature +++ b/cypress/integration/add-route/back-to-all-jobs.feature @@ -3,15 +3,6 @@ Feature: Users should be able to navigate back to the job list Background: Given the user navigated to the add job page - Scenario: User clicks the back to all jobs link - When the user clicks the back to all jobs link - Then the job list route will be loaded - - Scenario: User clicks the back to all jobs link after editing the form - Given the user has edited the form - When the user clicks the back to all jobs link - Then the user will be asked if they want to discard the form - Scenario: User clicks the cancel button When the user clicks the cancel button Then the job list route will be loaded diff --git a/cypress/integration/add-route/back-to-all-jobs/index.js b/cypress/integration/add-route/back-to-all-jobs/index.js index 3e792a08b..6642e76ff 100644 --- a/cypress/integration/add-route/back-to-all-jobs/index.js +++ b/cypress/integration/add-route/back-to-all-jobs/index.js @@ -9,10 +9,6 @@ Given('the user has edited the form', () => { cy.findByLabelText('Name*').type('Name') }) -When('the user clicks the back to all jobs link', () => { - cy.findByRole('button', { name: 'Back to all jobs' }).click() -}) - When('the user clicks the cancel button', () => { cy.findByRole('button', { name: 'Cancel' }).click() }) diff --git a/cypress/integration/add-sequence/back-to-all-jobs.feature b/cypress/integration/add-sequence/back-to-all-jobs.feature index 3fd0cb213..dea347dc9 100644 --- a/cypress/integration/add-sequence/back-to-all-jobs.feature +++ b/cypress/integration/add-sequence/back-to-all-jobs.feature @@ -3,15 +3,6 @@ Feature: Users should be able to navigate back to the job list Background: Given the user navigated to the add sequence page - Scenario: User clicks the back to all jobs link - When the user clicks the back to all jobs link - Then the job list route will be loaded - - Scenario: User clicks the back to all jobs link after editing the form - Given the user has edited the form - When the user clicks the back to all jobs link - Then the user will be asked if they want to discard the form - Scenario: User clicks the cancel button When the user clicks the cancel button Then the job list route will be loaded diff --git a/cypress/integration/add-sequence/back-to-all-jobs/index.js b/cypress/integration/add-sequence/back-to-all-jobs/index.js index af81fa5a0..34f6d6f50 100644 --- a/cypress/integration/add-sequence/back-to-all-jobs/index.js +++ b/cypress/integration/add-sequence/back-to-all-jobs/index.js @@ -9,10 +9,6 @@ Given('the user has edited the form', () => { cy.findByLabelText('Name*').type('Name') }) -When('the user clicks the back to all jobs link', () => { - cy.findByRole('button', { name: 'Back to all jobs' }).click() -}) - When('the user clicks the cancel button', () => { cy.findByRole('button', { name: 'Cancel' }).click() }) diff --git a/cypress/integration/edit-route/back-to-all-jobs.feature b/cypress/integration/edit-route/back-to-all-jobs.feature index 3f7cf2dc6..adff034cc 100644 --- a/cypress/integration/edit-route/back-to-all-jobs.feature +++ b/cypress/integration/edit-route/back-to-all-jobs.feature @@ -4,15 +4,6 @@ Feature: Users should be able to navigate back to the job list Given a single user job exists And the user navigated to the edit job page - Scenario: User clicks the back to all jobs link - When the user clicks the back to all jobs link - Then the job list route will be loaded - - Scenario: User clicks the back to all jobs link after editing the form - Given the user has edited the form - When the user clicks the back to all jobs link - Then the user will be asked if they want to discard the form - Scenario: User clicks the cancel button When the user clicks the cancel button Then the job list route will be loaded diff --git a/cypress/integration/edit-route/back-to-all-jobs/index.js b/cypress/integration/edit-route/back-to-all-jobs/index.js index ce8ddcb13..e37d27fa1 100644 --- a/cypress/integration/edit-route/back-to-all-jobs/index.js +++ b/cypress/integration/edit-route/back-to-all-jobs/index.js @@ -16,10 +16,6 @@ Given('the user has edited the form', () => { cy.findByLabelText('Name*').type('Name') }) -When('the user clicks the back to all jobs link', () => { - cy.findByRole('button', { name: 'Back to all jobs' }).click() -}) - When('the user clicks the cancel button', () => { cy.findByRole('button', { name: 'Cancel' }).click() }) diff --git a/i18n/en.pot b/i18n/en.pot index 8a61605cd..cb284d839 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2023-07-19T12:52:52.060Z\n" -"PO-Revision-Date: 2023-07-19T12:52:52.060Z\n" +"POT-Creation-Date: 2023-07-27T09:01:30.404Z\n" +"PO-Revision-Date: 2023-07-27T09:01:30.404Z\n" msgid "Something went wrong" msgstr "Something went wrong" @@ -228,9 +228,6 @@ msgstr "Run" msgid "Toggle job" msgstr "Toggle job" -msgid "Back to all jobs" -msgstr "Back to all jobs" - msgid "New Job" msgstr "New Job" @@ -271,6 +268,9 @@ msgstr "New job" msgid "System job: {{ name }}" msgstr "System job: {{ name }}" +msgid "Back to all jobs" +msgstr "Back to all jobs" + msgid "New Sequence" msgstr "New Sequence" diff --git a/src/components/Forms/JobAddForm.js b/src/components/Forms/JobAddForm.js index a696e1304..104430850 100644 --- a/src/components/Forms/JobAddForm.js +++ b/src/components/Forms/JobAddForm.js @@ -1,7 +1,7 @@ -import React, { useEffect } from 'react' +import React from 'react' import PropTypes from 'prop-types' import i18n from '@dhis2/d2-i18n' -import { Button, CircularLoader, Box, ReactFinalForm } from '@dhis2/ui' +import { Button, CircularLoader, Box } from '@dhis2/ui' import { DiscardFormButton } from '../Buttons' import { FormErrorBox } from '../FormErrorBox' import { @@ -13,8 +13,6 @@ import { } from '../FormFields' import styles from './JobAddForm.module.css' -const { useForm } = ReactFinalForm - const JobAddForm = ({ handleSubmit, pristine, @@ -22,23 +20,7 @@ const JobAddForm = ({ submitError, hasSubmitErrors, values, - setIsPristine, }) => { - const { subscribe } = useForm() - - /** - * Lift pristine state up on changes, wrapped in useEffect because calls to setState - * outside of the component that owns the setState should not happen synchronously. - */ - useEffect(() => - /** - * The subscriber will only be called when pristine changes. It returns a - * cleanup function. - * https://final-form.org/docs/final-form/types/FormApi#subscribe - */ - subscribe(({ pristine }) => setIsPristine(pristine), { pristine: true }) - ) - // Check if there's currently a selected job type const jobType = values[fieldNames.JOB_TYPE] @@ -96,7 +78,6 @@ JobAddForm.propTypes = { handleSubmit: func.isRequired, hasSubmitErrors: bool.isRequired, pristine: bool.isRequired, - setIsPristine: func.isRequired, submitting: bool.isRequired, values: object.isRequired, submitError: array, diff --git a/src/components/Forms/JobAddForm.test.js b/src/components/Forms/JobAddForm.test.js index 4ed9b49a2..f6ca6cd19 100644 --- a/src/components/Forms/JobAddForm.test.js +++ b/src/components/Forms/JobAddForm.test.js @@ -31,7 +31,6 @@ describe('', () => { submitError: [message], hasSubmitErrors: true, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -45,23 +44,6 @@ describe('', () => { expect(actual.text()).toEqual(expect.stringContaining(message)) }) - it('calls setIsPristine on form changes', () => { - const spy = jest.fn() - const wrapper = mount( -
{}} - setIsPristine={spy} - component={JobAddForm} - /> - ) - - wrapper - .find({ id: 'name' }) - .simulate('change', { target: { value: 'A change' } }) - - expect(spy).toHaveBeenCalledWith(false) - }) - it('shows a spinner when submitting', () => { const props = { handleSubmit: () => {}, @@ -70,7 +52,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -95,7 +76,6 @@ describe('', () => { const wrapper = mount( {}} - setIsPristine={() => {}} component={JobAddForm} initialValues={{ [fieldNames.JOB_TYPE]: 'jobType', @@ -112,7 +92,6 @@ describe('', () => { const wrapper = mount( {}} - setIsPristine={() => {}} component={JobAddForm} initialValues={{ [fieldNames.JOB_TYPE]: 'jobType', @@ -133,7 +112,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -157,7 +135,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( diff --git a/src/components/Forms/JobAddFormContainer.js b/src/components/Forms/JobAddFormContainer.js index f6c85b50d..e31441afb 100644 --- a/src/components/Forms/JobAddFormContainer.js +++ b/src/components/Forms/JobAddFormContainer.js @@ -1,5 +1,4 @@ import React from 'react' -import PropTypes from 'prop-types' import { ReactFinalForm } from '@dhis2/ui' import history from '../../services/history' import { useSubmitJob } from '../../hooks/jobs' @@ -7,7 +6,7 @@ import JobAddForm from './JobAddForm' const { Form } = ReactFinalForm -const JobAddFormContainer = ({ setIsPristine }) => { +const JobAddFormContainer = () => { const redirect = () => { history.push('/') } @@ -21,16 +20,9 @@ const JobAddFormContainer = ({ setIsPristine }) => { ) } -const { func } = PropTypes - -JobAddFormContainer.propTypes = { - setIsPristine: func.isRequired, -} - export default JobAddFormContainer diff --git a/src/components/Forms/JobEditForm.js b/src/components/Forms/JobEditForm.js index 8f0061927..11d295307 100644 --- a/src/components/Forms/JobEditForm.js +++ b/src/components/Forms/JobEditForm.js @@ -1,7 +1,7 @@ -import React, { useEffect } from 'react' +import React from 'react' import PropTypes from 'prop-types' import i18n from '@dhis2/d2-i18n' -import { Button, CircularLoader, Box, ReactFinalForm } from '@dhis2/ui' +import { Button, CircularLoader, Box } from '@dhis2/ui' import history from '../../services/history' import { DiscardFormButton, DeleteJobButton } from '../Buttons' import { FormErrorBox } from '../FormErrorBox' @@ -14,8 +14,6 @@ import { } from '../FormFields' import styles from './JobEditForm.module.css' -const { useForm } = ReactFinalForm - const JobEditForm = ({ id, handleSubmit, @@ -24,23 +22,7 @@ const JobEditForm = ({ submitError, hasSubmitErrors, values, - setIsPristine, }) => { - const { subscribe } = useForm() - - /** - * Lift pristine state up on changes, wrapped in useEffect because calls to setState - * outside of the component that owns the setState should not happen synchronously. - */ - useEffect(() => - /** - * The subscriber will only be called when pristine changes. It returns a - * cleanup function. - * https://final-form.org/docs/final-form/types/FormApi#subscribe - */ - subscribe(({ pristine }) => setIsPristine(pristine), { pristine: true }) - ) - // Check if there's currently a selected job type const jobType = values[fieldNames.JOB_TYPE] @@ -107,7 +89,6 @@ JobEditForm.propTypes = { hasSubmitErrors: bool.isRequired, id: string.isRequired, pristine: bool.isRequired, - setIsPristine: func.isRequired, submitting: bool.isRequired, values: object.isRequired, submitError: array, diff --git a/src/components/Forms/JobEditForm.test.js b/src/components/Forms/JobEditForm.test.js index 7a8fe8619..0d1c269d5 100644 --- a/src/components/Forms/JobEditForm.test.js +++ b/src/components/Forms/JobEditForm.test.js @@ -32,7 +32,6 @@ describe('', () => { submitError: [message], hasSubmitErrors: true, values: {}, - setIsPristine: () => {}, refetchJobs: () => {}, } @@ -47,25 +46,6 @@ describe('', () => { expect(actual.text()).toEqual(expect.stringContaining(message)) }) - it('calls setIsPristine on form changes', () => { - const spy = jest.fn() - const wrapper = mount( - {}} - id="id" - refetchJobs={() => {}} - setIsPristine={spy} - component={JobEditForm} - /> - ) - - wrapper - .find({ id: 'name' }) - .simulate('change', { target: { value: 'A change' } }) - - expect(spy).toHaveBeenCalledWith(false) - }) - it('shows a spinner when submitting', () => { const props = { id: 'id', @@ -75,7 +55,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, refetchJobs: () => {}, } @@ -103,7 +82,6 @@ describe('', () => { id="id" refetchJobs={() => {}} onSubmit={() => {}} - setIsPristine={() => {}} component={JobEditForm} initialValues={{ [fieldNames.JOB_TYPE]: 'jobType', @@ -122,7 +100,6 @@ describe('', () => { id="id" refetchJobs={() => {}} onSubmit={() => {}} - setIsPristine={() => {}} component={JobEditForm} initialValues={{ [fieldNames.JOB_TYPE]: 'jobType', @@ -144,7 +121,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, refetchJobs: () => {}, } @@ -170,7 +146,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, refetchJobs: () => {}, } diff --git a/src/components/Forms/JobEditFormContainer.js b/src/components/Forms/JobEditFormContainer.js index ca2673caf..305602662 100644 --- a/src/components/Forms/JobEditFormContainer.js +++ b/src/components/Forms/JobEditFormContainer.js @@ -22,7 +22,7 @@ const initialFields = [ 'name', ] -const JobEditFormContainer = ({ job, setIsPristine }) => { +const JobEditFormContainer = ({ job }) => { const { id } = useParams() const redirect = () => { history.push('/') @@ -44,7 +44,6 @@ const JobEditFormContainer = ({ job, setIsPristine }) => { { ) } -const { func, object } = PropTypes +const { object } = PropTypes JobEditFormContainer.propTypes = { job: object.isRequired, - setIsPristine: func.isRequired, } export default JobEditFormContainer diff --git a/src/components/Forms/SequenceAddForm.js b/src/components/Forms/SequenceAddForm.js index f17f04b04..bd6796533 100644 --- a/src/components/Forms/SequenceAddForm.js +++ b/src/components/Forms/SequenceAddForm.js @@ -1,37 +1,19 @@ -import React, { useEffect } from 'react' +import React from 'react' import PropTypes from 'prop-types' import i18n from '@dhis2/d2-i18n' -import { Button, CircularLoader, Box, ReactFinalForm } from '@dhis2/ui' +import { Button, CircularLoader, Box } from '@dhis2/ui' import { DiscardFormButton } from '../Buttons' import { FormErrorBox } from '../FormErrorBox' import { NameField, CronField, SequenceOrderField } from '../FormFields' import styles from './SequenceAddForm.module.css' -const { useForm } = ReactFinalForm - const SequenceAddForm = ({ handleSubmit, pristine, submitting, submitError, hasSubmitErrors, - setIsPristine, }) => { - const { subscribe } = useForm() - - /** - * Lift pristine state up on changes, wrapped in useEffect because calls to setState - * outside of the component that owns the setState should not happen synchronously. - */ - useEffect(() => - /** - * The subscriber will only be called when pristine changes. It returns a - * cleanup function. - * https://final-form.org/docs/final-form/types/FormApi#subscribe - */ - subscribe(({ pristine }) => setIsPristine(pristine), { pristine: true }) - ) - // Show a spinner only when submitting const Spinner = submitting ? : null @@ -79,7 +61,6 @@ SequenceAddForm.propTypes = { handleSubmit: func.isRequired, hasSubmitErrors: bool.isRequired, pristine: bool.isRequired, - setIsPristine: func.isRequired, submitting: bool.isRequired, submitError: array, } diff --git a/src/components/Forms/SequenceAddForm.test.js b/src/components/Forms/SequenceAddForm.test.js index 7de95782e..934904ad1 100644 --- a/src/components/Forms/SequenceAddForm.test.js +++ b/src/components/Forms/SequenceAddForm.test.js @@ -24,7 +24,6 @@ describe('', () => { submitError: [message], hasSubmitErrors: true, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -40,23 +39,6 @@ describe('', () => { expect(actual.text()).toEqual(expect.stringContaining(message)) }) - it('calls setIsPristine on form changes', () => { - const spy = jest.fn() - const wrapper = mount( - {}} - setIsPristine={spy} - component={SequenceAddForm} - /> - ) - - wrapper - .find({ id: 'name' }) - .simulate('change', { target: { value: 'A change' } }) - - expect(spy).toHaveBeenCalledWith(false) - }) - it('shows a spinner when submitting', () => { const props = { handleSubmit: () => {}, @@ -65,7 +47,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -96,7 +77,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( @@ -122,7 +102,6 @@ describe('', () => { submitError: [], hasSubmitErrors: false, values: {}, - setIsPristine: () => {}, } const wrapper = mount( diff --git a/src/components/Forms/SequenceAddFormContainer.js b/src/components/Forms/SequenceAddFormContainer.js index 400352f30..545693f82 100644 --- a/src/components/Forms/SequenceAddFormContainer.js +++ b/src/components/Forms/SequenceAddFormContainer.js @@ -1,5 +1,4 @@ import React from 'react' -import PropTypes from 'prop-types' import { ReactFinalForm } from '@dhis2/ui' import history from '../../services/history' import { useSubmitJobQueue } from '../../hooks/job-queues' @@ -7,7 +6,7 @@ import SequenceAddForm from './SequenceAddForm' const { Form } = ReactFinalForm -const SequenceAddFormContainer = ({ setIsPristine }) => { +const SequenceAddFormContainer = () => { const redirect = () => { history.push('/') } @@ -21,16 +20,9 @@ const SequenceAddFormContainer = ({ setIsPristine }) => { ) } -const { func } = PropTypes - -SequenceAddFormContainer.propTypes = { - setIsPristine: func.isRequired, -} - export default SequenceAddFormContainer diff --git a/src/pages/JobAdd/JobAdd.js b/src/pages/JobAdd/JobAdd.js index dcd71c80a..3e8e36b30 100644 --- a/src/pages/JobAdd/JobAdd.js +++ b/src/pages/JobAdd/JobAdd.js @@ -1,7 +1,6 @@ -import React, { useState } from 'react' +import React from 'react' import { Card, IconInfo16 } from '@dhis2/ui' import i18n from '@dhis2/d2-i18n' -import { DiscardFormButton } from '../../components/Buttons' import { JobAddFormContainer } from '../../components/Forms' import styles from './JobAdd.module.css' @@ -9,18 +8,9 @@ const infoLink = 'https://docs.dhis2.org/en/use/user-guides/dhis-core-version-236/maintaining-the-system/scheduling.html' const JobAdd = () => { - const [isPristine, setIsPristine] = useState(true) - return (
- - {i18n.t('Back to all jobs')} -

{i18n.t('New Job')}

@@ -40,7 +30,7 @@ const JobAdd = () => { {i18n.t('About job configuration')} - +
) diff --git a/src/pages/JobAdd/JobAdd.module.css b/src/pages/JobAdd/JobAdd.module.css index 977b3935b..3d6d7d0b0 100644 --- a/src/pages/JobAdd/JobAdd.module.css +++ b/src/pages/JobAdd/JobAdd.module.css @@ -2,10 +2,6 @@ margin-bottom: var(--spacers-dp32); } -.pageHeaderButton { - margin-bottom: var(--spacers-dp16); -} - .pageHeaderTitle { font-size: 18px; font-weight: 400; diff --git a/src/pages/JobEdit/JobEdit.js b/src/pages/JobEdit/JobEdit.js index ed05463f2..b5362c851 100644 --- a/src/pages/JobEdit/JobEdit.js +++ b/src/pages/JobEdit/JobEdit.js @@ -1,9 +1,8 @@ -import React, { useState } from 'react' +import React from 'react' import { Card, IconInfo16, NoticeBox } from '@dhis2/ui' import { useParams } from 'react-router-dom' import i18n from '@dhis2/d2-i18n' import { useJobById } from '../../hooks/jobs' -import { DiscardFormButton } from '../../components/Buttons' import { JobEditFormContainer } from '../../components/Forms' import { JobDetails } from '../../components/JobDetails' import { Spinner } from '../../components/Spinner' @@ -13,7 +12,6 @@ const infoLink = 'https://docs.dhis2.org/en/use/user-guides/dhis-core-version-236/maintaining-the-system/scheduling.html' const JobEdit = () => { - const [isPristine, setIsPristine] = useState(true) const { id } = useParams() const { data, fetching, error } = useJobById(id) @@ -36,13 +34,6 @@ const JobEdit = () => { return (
- - {i18n.t('Back to all jobs')} -

{i18n.t('Job: {{ name }}', { name, @@ -74,10 +65,7 @@ const JobEdit = () => { lastExecuted={lastExecuted} /> - + ) diff --git a/src/pages/JobEdit/JobEdit.module.css b/src/pages/JobEdit/JobEdit.module.css index 38c04614a..757820884 100644 --- a/src/pages/JobEdit/JobEdit.module.css +++ b/src/pages/JobEdit/JobEdit.module.css @@ -2,10 +2,6 @@ margin-bottom: var(--spacers-dp32); } -.pageHeaderButton { - margin-bottom: var(--spacers-dp16); -} - .pageHeaderTitle { font-size: 18px; font-weight: 400; diff --git a/src/pages/JobView/JobView.js b/src/pages/JobView/JobView.js index 637381cb3..60e64730a 100644 --- a/src/pages/JobView/JobView.js +++ b/src/pages/JobView/JobView.js @@ -51,9 +51,6 @@ const JobView = () => { return (
- - {i18n.t('Back to all jobs')} -

{i18n.t('System job: {{ name }}', { name, diff --git a/src/pages/SequenceAdd/SequenceAdd.js b/src/pages/SequenceAdd/SequenceAdd.js index 171d2100a..0cfaca4b1 100644 --- a/src/pages/SequenceAdd/SequenceAdd.js +++ b/src/pages/SequenceAdd/SequenceAdd.js @@ -1,23 +1,13 @@ -import React, { useState } from 'react' +import React from 'react' import { Card, IconInfo16 } from '@dhis2/ui' import i18n from '@dhis2/d2-i18n' -import { DiscardFormButton } from '../../components/Buttons' import { SequenceAddFormContainer } from '../../components/Forms' import styles from './SequenceAdd.module.css' const SequenceAdd = () => { - const [isPristine, setIsPristine] = useState(true) - return (
- - {i18n.t('Back to all jobs')} -

{i18n.t('New Sequence')}

@@ -36,7 +26,7 @@ const SequenceAdd = () => { )}
- +
) diff --git a/src/pages/SequenceAdd/SequenceAdd.module.css b/src/pages/SequenceAdd/SequenceAdd.module.css index cbdd87400..f2ad696c6 100644 --- a/src/pages/SequenceAdd/SequenceAdd.module.css +++ b/src/pages/SequenceAdd/SequenceAdd.module.css @@ -2,10 +2,6 @@ margin-bottom: var(--spacers-dp32); } -.pageHeaderButton { - margin-bottom: var(--spacers-dp16); -} - .pageHeaderTitle { font-size: 18px; font-weight: 400; diff --git a/src/pages/SequenceEdit/SequenceEdit.js b/src/pages/SequenceEdit/SequenceEdit.js index 75128fb83..58050796c 100644 --- a/src/pages/SequenceEdit/SequenceEdit.js +++ b/src/pages/SequenceEdit/SequenceEdit.js @@ -3,7 +3,6 @@ import { Card, IconInfo16, NoticeBox } from '@dhis2/ui' import { useParams } from 'react-router-dom' import i18n from '@dhis2/d2-i18n' import { Spinner } from '../../components/Spinner' -import { DiscardFormButton } from '../../components/Buttons' import { SequenceEditFormContainer } from '../../components/Forms' import { useJobScheduleById } from '../../hooks/job-schedules' import styles from './SequenceEdit.module.css' @@ -32,13 +31,6 @@ const SequenceEdit = () => { return (
- - {i18n.t('Back to all jobs')} -

{i18n.t('Edit Sequence')}

diff --git a/src/pages/SequenceEdit/SequenceEdit.module.css b/src/pages/SequenceEdit/SequenceEdit.module.css index cbdd87400..f2ad696c6 100644 --- a/src/pages/SequenceEdit/SequenceEdit.module.css +++ b/src/pages/SequenceEdit/SequenceEdit.module.css @@ -2,10 +2,6 @@ margin-bottom: var(--spacers-dp32); } -.pageHeaderButton { - margin-bottom: var(--spacers-dp16); -} - .pageHeaderTitle { font-size: 18px; font-weight: 400;