Skip to content

Commit

Permalink
WIP - Remove console.log etc..
Browse files Browse the repository at this point in the history
  • Loading branch information
paustint committed Mar 23, 2024
1 parent 26b82e5 commit cd77497
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css } from '@emotion/react';
import { useNonInitialEffect, useRollbar } from '@jetstream/shared/ui-utils';
import { DeployOptions, ListMetadataResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { Grid, GridCol, Icon, Modal } from '@jetstream/ui';
import JSZip from 'jszip';
import { Fragment, FunctionComponent, useEffect, useRef, useState } from 'react';
Expand All @@ -17,7 +17,7 @@ export interface DeleteMetadataConfigModalProps {
onSelection?: (deployOptions: DeployOptions) => void;
onClose: () => void;
onDeploy: (file: ArrayBuffer, deployOptions: DeployOptions) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Undefinable<string>) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Maybe<string>) => void;
}

export const DeleteMetadataConfigModal: FunctionComponent<DeleteMetadataConfigModalProps> = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ANALYTICS_KEYS } from '@jetstream/shared/constants';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { FileDownloadModal } from '@jetstream/ui';
import { Fragment, FunctionComponent, useState } from 'react';
import { useRecoilState } from 'recoil';
Expand All @@ -25,7 +25,7 @@ export const DeleteMetadataModal: FunctionComponent<DeleteMetadataModalProps> =
const [file, setFile] = useState<ArrayBuffer>();
const [deployOptions, setDeployOptions] = useState<DeployOptions>();
const [deployResultsData, setDeployResultsData] = useState<MapOf<any[]>>();
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Undefinable<string>>(undefined);
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Maybe<string>>(undefined);

function handleDeploy(file: ArrayBuffer, deployOptions: DeployOptions) {
setFile(file);
Expand All @@ -44,7 +44,6 @@ export const DeleteMetadataModal: FunctionComponent<DeleteMetadataModalProps> =
setDeployResultsData(getDeployResultsExcelData(deployResults, deploymentUrl));
setDownloadResultsModalOpen(true);
}
console.log('deploymentHistoryName Delete Parent:', deploymentHistoryName);

return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNonInitialEffect } from '@jetstream/shared/ui-utils';
import { DeployOptions, DeployResult, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { SalesforceLogin } from '@jetstream/ui';
import { Fragment, FunctionComponent, useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
Expand All @@ -11,24 +11,24 @@ import { getStatusValue, useDeployMetadataPackage } from '../utils/useDeployMeta
export interface DeployMetadataPackageStatusModalProps {
destinationOrg: SalesforceOrgUi;
deployOptions: DeployOptions;
deploymentHistoryName?: Maybe<string>;
file: ArrayBuffer;
// used to hide while download window is open
hideModal: boolean;
onGoBack?: () => void;
onClose: () => void;
onDownload: (deployResults: DeployResult, deploymentUrl: string) => void;
deploymentHistoryName?: Undefinable<string>;
}

export const DeployMetadataPackageStatusModal: FunctionComponent<DeployMetadataPackageStatusModalProps> = ({
destinationOrg,
deployOptions,
deploymentHistoryName,
file,
hideModal,
onGoBack,
onClose,
onDownload,
deploymentHistoryName,
}) => {
const { serverUrl } = useRecoilValue(applicationCookieState);
const skipFrontDoorAuth = useRecoilValue(selectSkipFrontdoorAuth);
Expand All @@ -51,8 +51,6 @@ export const DeployMetadataPackageStatusModal: FunctionComponent<DeployMetadataP
}
}, [deployId]);

console.log('Delete STATUS', deploymentHistoryName);

return (
<DeployMetadataStatusModal
destinationOrg={destinationOrg}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ANALYTICS_KEYS } from '@jetstream/shared/constants';
import { DeployOptions, DeployResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { FileDownloadModal, Icon } from '@jetstream/ui';
import classNames from 'classnames';
import { Fragment, FunctionComponent, useState } from 'react';
Expand Down Expand Up @@ -28,7 +28,7 @@ export const DeployMetadataPackage: FunctionComponent<DeployMetadataPackageProps
);
const [deployOptions, setDeployOptions] = useState<DeployOptions>();
const [deployResultsData, setDeployResultsData] = useState<MapOf<any[]>>();
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Undefinable<string>>(undefined);
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Maybe<string>>(undefined);

function handleClick() {
setDestinationOrg(initialSelectedOrg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { css } from '@emotion/react';
import { logger } from '@jetstream/shared/client-logger';
import { INPUT_ACCEPT_FILETYPES } from '@jetstream/shared/constants';
import { useNonInitialEffect, useRollbar } from '@jetstream/shared/ui-utils';
import { DeployOptions, InputReadFileContent, Maybe, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, InputReadFileContent, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { FileSelector, Grid, GridCol, Modal } from '@jetstream/ui';
import JSZip from 'jszip';
import { Fragment, FunctionComponent, useEffect, useRef, useState } from 'react';
Expand All @@ -29,7 +29,7 @@ export interface DeployMetadataPackageConfigModalProps {
destinationOrg: SalesforceOrgUi,
deployOptions: DeployOptions
) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Undefinable<string>) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Maybe<string>) => void;
}

export const DeployMetadataPackageConfigModal: FunctionComponent<DeployMetadataPackageConfigModalProps> = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNonInitialEffect } from '@jetstream/shared/ui-utils';
import { DeployOptions, DeployResult, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { SalesforceLogin } from '@jetstream/ui';
import { Fragment, FunctionComponent, useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
Expand All @@ -11,33 +11,33 @@ import { getStatusValue, useDeployMetadataPackage } from '../utils/useDeployMeta
export interface DeployMetadataPackageStatusModalProps {
destinationOrg: SalesforceOrgUi;
deployOptions: DeployOptions;
deploymentHistoryName?: Maybe<string>;
file: ArrayBuffer;
// used to hide while download window is open
hideModal: boolean;
onGoBack?: () => void;
onClose: () => void;
onDownload: (deployResults: DeployResult, deploymentUrl: string) => void;
deploymentHistoryName?: Undefinable<string>;
}

export const DeployMetadataPackageStatusModal: FunctionComponent<DeployMetadataPackageStatusModalProps> = ({
destinationOrg,
deployOptions,
deploymentHistoryName,
file,
hideModal,
onGoBack,
onClose,
onDownload,
deploymentHistoryName,
}) => {
const { serverUrl } = useRecoilValue(applicationCookieState);
const skipFrontDoorAuth = useRecoilValue(selectSkipFrontdoorAuth);
const [deployStatusUrl, setDeployStatusUrl] = useState<string | null>(null);
const { deployMetadata, results, deployId, loading, status, lastChecked, hasError, errorMessage } = useDeployMetadataPackage(
destinationOrg,
deployOptions,
file,
deploymentHistoryName
deploymentHistoryName,
file
);

useEffect(() => {
Expand All @@ -50,7 +50,7 @@ export const DeployMetadataPackageStatusModal: FunctionComponent<DeployMetadataP
setDeployStatusUrl(getDeploymentStatusUrl(deployId));
}
}, [deployId]);
console.log('PACKAGE STATUS', deploymentHistoryName);

return (
<DeployMetadataStatusModal
destinationOrg={destinationOrg}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ANALYTICS_KEYS } from '@jetstream/shared/constants';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { FileDownloadModal, Icon } from '@jetstream/ui';
import { Fragment, FunctionComponent, useState } from 'react';
import { useRecoilState } from 'recoil';
Expand Down Expand Up @@ -29,7 +29,7 @@ export const DeployMetadataToOrg: FunctionComponent<DeployMetadataToOrgProps> =
const [deployMetadataOptions, setDeployMetadataOptions] = useState<DeployOptions | null>(null);

const [selectedMetadata, setSelectedMetadata] = useState<MapOf<ListMetadataResult[]>>();
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Undefinable<string>>(undefined);
const [deploymentHistoryName, setDeploymentHistoryName] = useState<Maybe<string>>(undefined);

function handleClick() {
setConfigModalOpen(true);
Expand Down Expand Up @@ -59,8 +59,6 @@ export const DeployMetadataToOrg: FunctionComponent<DeployMetadataToOrgProps> =
setDownloadResultsModalOpen(true);
}

console.log('deploymentHistoryName Parent:', deploymentHistoryName);

return (
<Fragment>
<button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css } from '@emotion/react';
import { useNonInitialEffect } from '@jetstream/shared/ui-utils';
import { DeployOptions, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { Grid, GridCol, Icon, Modal } from '@jetstream/ui';
import { Fragment, FunctionComponent, useEffect, useRef, useState } from 'react';
import { useRecoilValue } from 'recoil';
Expand All @@ -19,7 +19,7 @@ export interface DeployMetadataToOrgConfigModalProps {
onSelection?: (deployOptions: DeployOptions) => void;
onClose: () => void;
onDeploy: (destinationOrg: SalesforceOrgUi, deployOptions: DeployOptions) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Undefinable<string>) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Maybe<string>) => void;
}

export const DeployMetadataToOrgConfigModal: FunctionComponent<DeployMetadataToOrgConfigModalProps> = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNonInitialEffect } from '@jetstream/shared/ui-utils';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployResult, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { SalesforceLogin } from '@jetstream/ui';
import { Fragment, FunctionComponent, useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
Expand All @@ -11,26 +11,26 @@ import { getStatusValue, useDeployMetadataBetweenOrgs } from '../utils/useDeploy
export interface DeployMetadataToOrgStatusModalProps {
sourceOrg: SalesforceOrgUi;
destinationOrg: SalesforceOrgUi;
deploymentHistoryName?: Maybe<string>;
selectedMetadata: MapOf<ListMetadataResult[]>;
deployOptions: DeployOptions;
// used to hide while download window is open
hideModal: boolean;
onGoBack: () => void;
onClose: () => void;
onDownload: (deployResults: DeployResult, deploymentUrl: string) => void;
deploymentHistoryName?: Undefinable<string>;
}

export const DeployMetadataToOrgStatusModal: FunctionComponent<DeployMetadataToOrgStatusModalProps> = ({
sourceOrg,
destinationOrg,
deploymentHistoryName,
selectedMetadata,
deployOptions,
hideModal,
onGoBack,
onClose,
onDownload,
deploymentHistoryName,
}) => {
const { serverUrl } = useRecoilValue(applicationCookieState);
const skipFrontDoorAuth = useRecoilValue(selectSkipFrontdoorAuth);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css } from '@emotion/react';
import { useNonInitialEffect } from '@jetstream/shared/ui-utils';
import { DeployOptions, DeployOptionsTestLevel, Undefinable } from '@jetstream/types';
import { DeployOptions, DeployOptionsTestLevel, Maybe } from '@jetstream/types';
import { Checkbox, Icon, Input, Radio, RadioGroup, Textarea, Tooltip } from '@jetstream/ui';
import { Fragment, FunctionComponent, useState } from 'react';

Expand All @@ -20,7 +20,7 @@ export interface DeployMetadataOptionsProps {
disabledOptions?: Set<keyof DeployOptions>;
isSinglePackage?: boolean;
onChange: (deployOptions: DeployOptions) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Undefinable<string>) => void;
setDeploymentHistoryName?: (deploymentHistoryName: Maybe<string>) => void;
}

export const DeployMetadataOptions: FunctionComponent<DeployMetadataOptionsProps> = ({
Expand All @@ -40,7 +40,7 @@ export const DeployMetadataOptions: FunctionComponent<DeployMetadataOptionsProps
const [singlePackage, setSinglePackage] = useState(deployOptions.singlePackage ?? true);
const [testLevel, setTestLevel] = useState<DeployOptionsTestLevel | undefined>(deployOptions.testLevel ?? undefined);
const [runTests, setRunTests] = useState<string[]>(deployOptions.runTests ?? []);
// const [deployName, setDeployName] = useState<Undefinable<string>>();
// const [deployName, setDeployName] = useState<Maybe<string>>();

const [runSpecifiedTestsVisible, setRunSpecifiedTestsVisible] = useState(testLevel === 'RunSpecifiedTests');
const [runTestsStr, setRunTestsStr] = useState<string>(deployOptions.runTests?.join('\n') ?? '');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { css } from '@emotion/react';
import { ANALYTICS_KEYS, DATE_FORMATS } from '@jetstream/shared/constants';
import { DeployResult, Maybe, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployResult, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { Grid, GridCol, Icon, Modal, TabsRef } from '@jetstream/ui';
import formatDate from 'date-fns/format';
import { Fragment, FunctionComponent, useEffect, useRef, useState } from 'react';
import { useAmplitude } from '../../core/analytics';
import ConfirmPageChange from '../../core/ConfirmPageChange';
import OrgLabelBadge from '../../core/OrgLabelBadge';
import { useAmplitude } from '../../core/analytics';
import { DeployMetadataStatus } from '../deploy-metadata.types';
import DeployMetadataProgressSummary from './DeployMetadataProgressSummary';
import DeployMetadataResultsTables from './DeployMetadataResultsTables';
Expand Down Expand Up @@ -49,7 +49,6 @@ export interface DeployMetadataStatusModalProps {
onGoBack?: () => void;
onClose: () => void;
onDownload?: (deployResults: DeployResult, deploymentUrl: string) => void;
deploymentHistoryName?: Undefinable<string>;
}

export const DeployMetadataStatusModal: FunctionComponent<DeployMetadataStatusModalProps> = ({
Expand All @@ -73,7 +72,6 @@ export const DeployMetadataStatusModal: FunctionComponent<DeployMetadataStatusMo
onGoBack,
onClose,
onDownload,
deploymentHistoryName,
}) => {
const isDone = results?.done;
const { trackEvent } = useAmplitude();
Expand Down Expand Up @@ -128,7 +126,6 @@ export const DeployMetadataStatusModal: FunctionComponent<DeployMetadataStatusMo
});
onGoBack && onGoBack();
}
console.log('deploymentHistoryName Delete Status Modal:', deploymentHistoryName);

return (
<Modal
Expand Down Expand Up @@ -297,7 +294,6 @@ export const DeployMetadataStatusModal: FunctionComponent<DeployMetadataStatusMo
)}
</Grid>
)}
{deploymentHistoryName && 'Deployment History Name:' + deploymentHistoryName}
</GridCol>
<GridCol grow className="slds-scrollable">
{results && <DeployMetadataResultsTables results={results} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
DeployResult,
ListMetadataResult,
MapOf,
Maybe,
SalesforceDeployHistoryItem,
SalesforceDeployHistoryType,
SalesforceOrgUi,
Undefinable,
} from '@jetstream/types';
import {
ColumnWithFilter,
Expand Down Expand Up @@ -79,7 +79,7 @@ export async function saveHistory({
}: {
sourceOrg?: SalesforceOrgUi;
destinationOrg: SalesforceOrgUi;
deploymentHistoryName?: Undefinable<string>;
deploymentHistoryName?: Maybe<string>;
type: SalesforceDeployHistoryType;
start: Date;
metadata?: MapOf<ListMetadataResult[]>;
Expand Down Expand Up @@ -111,7 +111,7 @@ export async function saveHistory({
label: destinationOrg.label,
orgName: destinationOrg.orgName || '',
},
deploymentHistoryName: deploymentHistoryName,
deploymentHistoryName,
start,
finish: new Date(),
url: results?.id ? getDeploymentStatusUrl(results.id) : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export function useAddItemsToChangeset(
dispatch({ type: 'SUCCESS', payload: { results } });
saveHistory({
destinationOrg: selectedOrg,
deploymentHistoryName: 'test change set',
type: 'changeset',
start,
metadata: selectedMetadata,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { logger } from '@jetstream/shared/client-logger';
import { retrieveMetadataFromListMetadata } from '@jetstream/shared/data';
import { pollAndDeployMetadataResultsWhenReady, pollMetadataResultsUntilDone, useBrowserNotifications } from '@jetstream/shared/ui-utils';
import { DeployResult, ListMetadataResult, MapOf, SalesforceOrgUi, Undefinable } from '@jetstream/types';
import { DeployResult, ListMetadataResult, MapOf, Maybe, SalesforceOrgUi } from '@jetstream/types';
import { useCallback, useEffect, useReducer, useRef, useState } from 'react';
import { useRecoilState } from 'recoil';
import { applicationCookieState } from '../../../app-state';
Expand Down Expand Up @@ -76,7 +76,7 @@ export function useDeployMetadataBetweenOrgs(
destinationOrg: SalesforceOrgUi,
selectedMetadata: MapOf<ListMetadataResult[]>,
deployOptions: DeployOptions,
deploymentHistoryName?: Undefinable<string>
deploymentHistoryName?: Maybe<string>
) {
const isMounted = useRef(true);

Expand Down
Loading

0 comments on commit cd77497

Please sign in to comment.