Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const CommitLabelBranchText = styled(Text)`
whitespace: nowrap;
`;

const FIRST_COMMIT = "First Commit";
const NO_CHANGES_TO_COMMIT = "No changes to commit";

interface TabDeployViewProps {
Expand All @@ -83,9 +82,7 @@ interface TabDeployViewProps {
isFetchStatusLoading: boolean;
isPullFailing: boolean;
isPullLoading: boolean;
lastDeployedAt: string | null;
pull: () => void;
remoteUrl: string | null;
statusBehindCount: number;
statusIsClean: boolean;
}
Expand All @@ -103,18 +100,14 @@ function TabDeployView({
isFetchStatusLoading = false,
isPullFailing = false,
isPullLoading = false,
lastDeployedAt = null,
pull = noop,
remoteUrl = null,
statusBehindCount = 0,
statusIsClean = false,
}: TabDeployViewProps) {
const [hasSubmitted, setHasSubmitted] = useState(false);
const hasChangesToCommit = !statusIsClean;
const commitInputRef = useRef<HTMLInputElement>(null);
const [commitMessage, setCommitMessage] = useState(
remoteUrl && lastDeployedAt ? "" : FIRST_COMMIT,
);
const [commitMessage, setCommitMessage] = useState("");
const [shouldDiscard, setShouldDiscard] = useState(false);
const [isDiscarding, setIsDiscarding] = useState(isDiscardLoading);
const [showDiscardWarning, setShowDiscardWarning] = useState(false);
Expand Down
11 changes: 0 additions & 11 deletions app/client/src/git/components/OpsModal/TabDeploy/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from "react";
import TabDeployView from "./TabDeployView";
import { useGitContext } from "git/components/GitContextProvider";
import useMetadata from "git/hooks/useMetadata";
import useBranches from "git/hooks/useBranches";
import useCommit from "git/hooks/useCommit";
import useDiscard from "git/hooks/useDiscard";
import usePull from "git/hooks/usePull";
import useStatus from "git/hooks/useStatus";
import type { GitApplicationArtifact } from "git/types";

export default function TabDeploy() {
const { artifact } = useGitContext();
const { clearCommitError, commit, commitError, isCommitLoading } =
useCommit();

Expand All @@ -20,15 +16,10 @@ export default function TabDeploy() {
const { isPullLoading, pull, pullError } = usePull();
const { isFetchStatusLoading, status } = useStatus();
const { currentBranch } = useBranches();
const { metadata } = useMetadata();

// ! git tagging: need to handle last deplyed here when tagging is implemented
const lastDeployedAt =
(artifact as GitApplicationArtifact)?.lastDeployedAt ?? null;
const isPullFailing = !!pullError;
const statusIsClean = status?.isClean ?? false;
const statusBehindCount = status?.behindCount ?? 0;
const remoteUrl = metadata?.remoteUrl ?? null;

return (
<TabDeployView
Expand All @@ -44,9 +35,7 @@ export default function TabDeploy() {
isFetchStatusLoading={isFetchStatusLoading}
isPullFailing={isPullFailing}
isPullLoading={isPullLoading}
lastDeployedAt={lastDeployedAt}
pull={pull}
remoteUrl={remoteUrl}
statusBehindCount={statusBehindCount}
statusIsClean={statusIsClean}
/>
Expand Down
Loading