Skip to content

Commit

Permalink
Hosting dashboard: clean up Deployments tab (#94538)
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored Sep 13, 2024
1 parent 3b22148 commit 9f3b9c3
Show file tree
Hide file tree
Showing 95 changed files with 49 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ExternalLink } from '@automattic/components';
import { createInterpolateElement } from '@wordpress/element';
import { translate } from 'i18n-calypso';
import { useWorkflowTemplate } from 'calypso/my-sites/github-deployments/components/deployment-style/use-get-workflow-template-query';
import { GitHubRepositoryData } from '../../use-github-repositories-query';
import { useWorkflowTemplate } from '../deployment-style/use-get-workflow-template-query';
import { NewWorkflowWizard } from './new-workflow-wizard';
import { Workflow } from './use-deployment-workflows-query';
import { WorkflowPicker } from './workflow-picker';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
import { addQueryArgs } from '@wordpress/url';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { GitHubRepositoryData } from 'calypso/my-sites/github-deployments/use-github-repositories-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../../constants';
import { GitHubRepositoryData } from '../../use-github-repositories-query';

export const CODE_DEPLOYMENTS_QUERY_KEY = 'code-deployments';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query';
import { useCallback } from 'react';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../../constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from '../../deployments/use-code-deployments-query';

interface MutationVariables {
repositoryId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
import { addQueryArgs } from '@wordpress/url';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { GitHubRepositoryData } from 'calypso/my-sites/github-deployments/use-github-repositories-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../../constants';
import { GitHubRepositoryData } from '../../use-github-repositories-query';

export const CODE_DEPLOYMENTS_QUERY_KEY = 'code-deployments';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
import { addQueryArgs } from '@wordpress/url';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../../constants';

export const CODE_DEPLOYMENTS_QUERY_KEY = 'code-deployments';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
import { addQueryArgs } from '@wordpress/url';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../../constants';

export const WORKFLOW_TEMPLATES = 'workflow-templates';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import FormFieldset from 'calypso/components/forms/form-fieldset';
import FormSelect from 'calypso/components/forms/form-select';
import FormSettingExplanation from 'calypso/components/forms/form-setting-explanation';
import { HostingCardHeading, HostingCardDescription } from 'calypso/components/hosting-card';
import { useGithubRepositoryBranchesQuery } from 'calypso/my-sites/github-deployments/use-github-repository-branches-query';
import { useGithubRepositoryChecksQuery } from 'calypso/my-sites/github-deployments/use-github-repository-checks-query';
import { GitHubRepositoryData } from '../../use-github-repositories-query';
import { useGithubRepositoryBranchesQuery } from '../../use-github-repository-branches-query';
import { useGithubRepositoryChecksQuery } from '../../use-github-repository-checks-query';
import { AutomatedDeploymentsToggle } from '../automated-deployments-toggle';
import { DeploymentStyle } from '../deployment-style';
import { useCheckWorkflowQuery } from '../deployment-style/use-check-workflow-query';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Button } from '@automattic/components';
import { useLocale } from '@automattic/i18n-utils';
import { __ } from '@wordpress/i18n';
import { Icon, lock } from '@wordpress/icons';
import { formatDate } from 'calypso/my-sites/github-deployments/utils/dates';
import { GitHubRepositoryData } from '../../use-github-repositories-query';
import { formatDate } from '../../utils/dates';

interface GitHubRepositoryListItemProps {
repository: GitHubRepositoryData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useI18n } from '@wordpress/react-i18n';
import { SortButton } from 'calypso/my-sites/github-deployments/components/sort-button/sort-button';
import { SortDirection } from 'calypso/my-sites/github-deployments/components/sort-button/use-sort';
import { GitHubRepositoryData } from '../../use-github-repositories-query';
import { SortButton } from '../sort-button/sort-button';
import { SortDirection } from '../sort-button/use-sort';
import { GitHubRepositoryListItem } from './repository-list-item';

interface GitHubInstallationListTableProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import { ExternalLink, Spinner } from '@wordpress/components';
import { useI18n } from '@wordpress/react-i18n';
import { useLayoutEffect, useState } from 'react';
import Pagination from 'calypso/components/pagination';
import {
SortDirection,
useSort,
} from 'calypso/my-sites/github-deployments/components/sort-button/use-sort';
import { GitHubInstallationData } from '../../use-github-installations-query';
import {
GitHubRepositoryData,
useGithubRepositoriesQuery,
} from '../../use-github-repositories-query';
import { SortDirection, useSort } from '../sort-button/use-sort';
import { NoResults } from './no-results';
import { GitHubRepositoryListTable } from './repository-list-table';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query';
import { useCallback } from 'react';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from '../deployments/use-code-deployments-query';

export interface MutationVariables {
externalRepositoryId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { __, sprintf } from '@wordpress/i18n';
import { useMemo } from 'react';
import { GitHubConnectionForm } from 'calypso/my-sites/github-deployments/components/github-connection-form';
import { recordTracksEvent } from 'calypso/state/analytics/actions';
import { errorNotice, successNotice } from 'calypso/state/notices/actions';
import { getSelectedSiteId } from 'calypso/state/ui/selectors';
import { useDispatch, useSelector } from '../../../state';
import { GitHubConnectionForm } from '../components/github-connection-form';
import { getDeploymentTypeFromPath } from '../deployment-creation/deployment-creation-form';
import { CodeDeploymentData } from '../deployments/use-code-deployments-query';
import { useUpdateCodeDeployment } from './use-update-code-deployment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query';
import { useCallback } from 'react';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from '../deployments/use-code-deployments-query';

interface MutationVariables {
externalRepositoryId: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ import { useLocale } from '@automattic/i18n-utils';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { chevronDown, chevronUp, Icon } from '@wordpress/icons';
import { GitHubLoadingPlaceholder } from 'calypso/my-sites/github-deployments/components/loading-placeholder/index';
import { DeploymentAuthor } from 'calypso/my-sites/github-deployments/deployment-run-logs/deployment-author';
import { useCodeDeploymentsRunLogQuery } from 'calypso/my-sites/github-deployments/deployment-run-logs/use-code-deployment-run-log-query';
import { DeploymentCommitDetails } from 'calypso/my-sites/github-deployments/deployments/deployment-commit-details';
import { DeploymentDuration } from 'calypso/my-sites/github-deployments/deployments/deployment-duration';
import {
DeploymentStatus,
DeploymentStatusValue,
} from 'calypso/my-sites/github-deployments/deployments/deployment-status';
import { formatDate } from 'calypso/my-sites/github-deployments/utils/dates';
import { recordTracksEvent } from 'calypso/state/analytics/actions';
import { useDispatch, useSelector } from 'calypso/state/index';
import { getSelectedSiteId } from 'calypso/state/ui/selectors/index';
import { GitHubLoadingPlaceholder } from '../components/loading-placeholder/index';
import { DeploymentAuthor } from '../deployment-run-logs/deployment-author';
import { useCodeDeploymentsRunLogQuery } from '../deployment-run-logs/use-code-deployment-run-log-query';
import { DeploymentCommitDetails } from '../deployments/deployment-commit-details';
import { DeploymentDuration } from '../deployments/deployment-duration';
import { DeploymentStatus, DeploymentStatusValue } from '../deployments/deployment-status';
import { formatDate } from '../utils/dates';
import { DeploymentRunLogs } from './deployment-run-logs';
import { DeploymentRun } from './use-code-deployment-run-query';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useI18n } from '@wordpress/react-i18n';
import { SortButton } from 'calypso/my-sites/github-deployments/components/sort-button/sort-button';
import { SortDirection } from 'calypso/my-sites/github-deployments/components/sort-button/use-sort';
import { SortButton } from '../components/sort-button/sort-button';
import { SortDirection } from '../components/sort-button/use-sort';
import { DeploymentsRunItem } from './deployments-run-item';
import { DeploymentRun } from './use-code-deployment-run-query';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { __ } from '@wordpress/i18n';
import ActionPanel from 'calypso/components/action-panel';
import HeaderCake from 'calypso/components/header-cake';
import HeaderCakeBack from 'calypso/components/header-cake/back';
import { PageShell } from 'calypso/my-sites/github-deployments/components/page-shell';
import { useSort } from 'calypso/my-sites/github-deployments/components/sort-button/use-sort';
import { DeploymentsRunsTable } from 'calypso/my-sites/github-deployments/deployment-run-logs/deployments-run-table';
import { useCodeDeploymentsRunsQuery } from 'calypso/my-sites/github-deployments/deployment-run-logs/use-code-deployment-run-query';
import { indexPage } from 'calypso/my-sites/github-deployments/routes';
import { useSelector } from 'calypso/state';
import { getSelectedSiteId, getSelectedSiteSlug } from 'calypso/state/ui/selectors';
import { PageShell } from '../components/page-shell';
import { useSort } from '../components/sort-button/use-sort';
import { DeploymentsRunsTable } from '../deployment-run-logs/deployments-run-table';
import { useCodeDeploymentsRunsQuery } from '../deployment-run-logs/use-code-deployment-run-query';
import { indexPage } from '../routes';

import './style.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CodeDeploymentData } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { DeploymentRun } from '../deployment-run-logs/use-code-deployment-run-query';
import { CodeDeploymentData } from '../deployments/use-code-deployments-query';

import './styles.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ import { useState } from '@wordpress/element';
import { sprintf } from '@wordpress/i18n';
import { useI18n } from '@wordpress/react-i18n';
import { translate } from 'i18n-calypso';
import { DeploymentCommitDetails } from 'calypso/my-sites/github-deployments/deployments/deployment-commit-details';
import { DeploymentDuration } from 'calypso/my-sites/github-deployments/deployments/deployment-duration';
import {
DeploymentStatus,
DeploymentStatusValue,
} from 'calypso/my-sites/github-deployments/deployments/deployment-status';
import { useCreateCodeDeploymentRun } from 'calypso/my-sites/github-deployments/deployments/use-create-code-deployment-run';
import { formatDate } from 'calypso/my-sites/github-deployments/utils/dates';
import { recordTracksEvent } from 'calypso/state/analytics/actions';
import { errorNotice, removeNotice, successNotice } from 'calypso/state/notices/actions';
import { getSelectedSiteSlug } from 'calypso/state/ui/selectors';
import { useDispatch, useSelector } from '../../../state';
import { manageDeploymentPage, viewDeploymentLogs } from '../routes';
import { formatDate } from '../utils/dates';
import { DeleteDeploymentDialog } from './delete-deployment-dialog';
import { DeploymentCommitDetails } from './deployment-commit-details';
import { DeploymentDuration } from './deployment-duration';
import { DeploymentStarterMessage } from './deployment-starter-message';
import { DeploymentStatus, DeploymentStatusValue } from './deployment-status';
import { DeploymentsListItemActions } from './deployments-list-item-actions';
import { CodeDeploymentData } from './use-code-deployments-query';
import { useCreateCodeDeploymentRun } from './use-create-code-deployment-run';

const noticeOptions = {
duration: 3000,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { __ } from '@wordpress/i18n';
import { useMemo } from 'react';
import { SortButton } from 'calypso/my-sites/github-deployments/components/sort-button/sort-button';
import { SortDirection } from 'calypso/my-sites/github-deployments/components/sort-button/use-sort';
import { CodeDeploymentData } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { SortButton } from '../components/sort-button/sort-button';
import { SortDirection } from '../components/sort-button/use-sort';
import { CodeDeploymentData } from '../deployments/use-code-deployments-query';
import { DeploymentsListItem } from './deployments-list-item';

interface DeploymentsListProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from '../deployments/use-code-deployments-query';

interface MutationResponse {
message: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useCallback } from 'react';
import wp from 'calypso/lib/wp';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from 'calypso/my-sites/github-deployments/deployments/use-code-deployments-query';
import { GITHUB_DEPLOYMENTS_QUERY_KEY } from '../constants';
import { CODE_DEPLOYMENTS_QUERY_KEY } from './use-code-deployments-query';

interface MutationResponse {
message: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
deploymentManagement,
deploymentRunLogs,
deploymentsList,
} from 'calypso/my-sites/github-deployments/controller';
} from './controller';

export default function () {
page( '/github-deployments', siteSelection, sites, makeLayout, clientRender );
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 0 additions & 54 deletions client/my-sites/github-deployments/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion client/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ const sections = [
{
name: 'github-deployments',
paths: [ '/github-deployments' ],
module: 'calypso/github-deployments',
module: 'calypso/hosting/deployments',
group: 'sites',
},
{
Expand Down

0 comments on commit 9f3b9c3

Please sign in to comment.