Skip to content

Commit

Permalink
cursor disable
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmi2506 committed Feb 6, 2024
1 parent c230197 commit 4c0e689
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/js/components/tasks/retrieveMetadata/changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const ChangesForm = ({
slds-p-vertical_x-small
slds-p-right_medium"
>
Non-Source-Trackable
Non-Source-Trackable-Changes
{refreshing ? (
<SpinnerWrapper size="small" variant="brand"></SpinnerWrapper>
) : (
Expand Down
41 changes: 24 additions & 17 deletions src/js/components/tasks/retrieveMetadata/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Button from '@salesforce/design-system-react/components/button';
import Card from '@salesforce/design-system-react/components/card';
import Modal from '@salesforce/design-system-react/components/modal';
import classNames from 'classnames';
import React, { FormEvent, ReactNode, useState } from 'react';
import React, { FormEvent, ReactNode, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';

Expand Down Expand Up @@ -71,6 +71,7 @@ export const ModalCard = ({
const RetrieveMetadataModal = ({ org, isOpen, closeModal }: Props) => {
const { t } = useTranslation();
const [retrievingChanges, setRetrievingChanges] = useState(false);
const [refreshingChanges, setRefreshingChanges] = useState(false);
const [ignoringChanges, setIgnoringChanges] = useState(false);
const [pageIndex, setPageIndex] = useState(0);
const { showTransientMessage, isShowingTransientMessage } =
Expand All @@ -82,6 +83,10 @@ const RetrieveMetadataModal = ({ org, isOpen, closeModal }: Props) => {
setPageIndex(pageIndex + 1);
};

useEffect(() => {
setRefreshingChanges(org.currently_refreshing_changes);
}, [org.currently_refreshing_changes]);

const prevPage = () => {
setPageIndex(Math.max(pageIndex - 1, 0));
};
Expand Down Expand Up @@ -244,21 +249,23 @@ const RetrieveMetadataModal = ({ org, isOpen, closeModal }: Props) => {
{
heading: t('Select the changes to retrieve or ignore'),
contents: (
<ChangesForm
key="page-2-contents"
changeset={org.unsaved_changes}
ignoredChanges={org.ignored_changes}
inputs={inputs as MetadataCommit}
changesChecked={changesChecked}
ignoredChecked={ignoredChecked}
errors={errors}
setInputs={setInputs}
ignoredSuccess={isShowingTransientMessage}
hasmetadatachanges={org.has_non_source_changes}
metadatachanges={org.non_source_changes}
id={org.id}
refreshing={org.currently_refreshing_changes}
/>
<div style={{ pointerEvents: refreshingChanges ? 'none' : 'auto' }}>
<ChangesForm
key="page-2-contents"
changeset={org.unsaved_changes}
ignoredChanges={org.ignored_changes}
inputs={inputs as MetadataCommit}
changesChecked={changesChecked}
ignoredChecked={ignoredChecked}
errors={errors}
setInputs={setInputs}
ignoredSuccess={isShowingTransientMessage}
hasmetadatachanges={org.has_non_source_changes}
metadatachanges={org.non_source_changes}
id={org.id}
refreshing={org.currently_refreshing_changes}
/>
</div>
),
footer: [
<Button
Expand Down Expand Up @@ -335,7 +342,7 @@ const RetrieveMetadataModal = ({ org, isOpen, closeModal }: Props) => {
<Modal
isOpen={isOpen}
size="small"
disableClose={retrievingChanges}
disableClose={retrievingChanges || refreshingChanges}
dismissOnClickOutside={false}
heading={pages[pageIndex].heading}
footer={pages[pageIndex].footer}
Expand Down

0 comments on commit 4c0e689

Please sign in to comment.