From 2bd378ada54968d497977005f85d9e7e4bac3b0f Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Mon, 8 Jan 2024 16:58:58 +0530 Subject: [PATCH] Add updates in previously implemented pages (#40) * Add cancel button in deployments status filter * Add namecheap hyperlink in domain config page * Add disconnect repo confirm dialog --- .../projects/project/DeploymentsTabPanel.tsx | 2 +- .../project/deployments/FilterForm.tsx | 22 +++++++++++---- .../project/settings/RepoConnectedSection.tsx | 27 +++++++++++++++++-- .../pages/projects/id/domain/add/Config.tsx | 5 +++- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx b/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx index 39225925..3f5449d3 100644 --- a/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx +++ b/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx @@ -12,7 +12,7 @@ import { DeploymentDetails } from '../../../types/project'; const DEFAULT_FILTER_VALUE: FilterValue = { searchedBranch: '', - status: 'All status', + status: StatusOptions.ALL_STATUS, }; const DeploymentsTabPanel = () => { diff --git a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx index b5b1860e..39d18fa9 100644 --- a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx +++ b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { DateRange } from 'react-day-picker'; -import { Option, Select } from '@material-tailwind/react'; +import { IconButton, Option, Select } from '@material-tailwind/react'; import SearchBar from '../../../SearchBar'; import DatePicker from '../../../DatePicker'; @@ -15,7 +15,7 @@ export enum StatusOptions { export interface FilterValue { searchedBranch: string; - status: string; + status: StatusOptions; updateAtRange?: DateRange; } @@ -55,14 +55,15 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => {
-
+
+ {selectedStatus !== StatusOptions.ALL_STATUS && ( +
+ setSelectedStatus(StatusOptions.ALL_STATUS)} + className="rounded-full" + size="sm" + > + X + +
+ )}
); diff --git a/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx b/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx index c824f6e7..f4228dae 100644 --- a/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx +++ b/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx @@ -1,14 +1,18 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Button, Typography } from '@material-tailwind/react'; import { RepositoryDetails } from '../../../../types/project'; +import ConfirmDialog from '../../../shared/ConfirmDialog'; const RepoConnectedSection = ({ linkedRepo, }: { linkedRepo: RepositoryDetails; }) => { + const [disconnectRepoDialogOpen, setDisconnectRepoDialogOpen] = + useState(false); + return (
^
@@ -19,10 +23,29 @@ const RepoConnectedSection = ({ Connected just now
-
+ setDisconnectRepoDialogOpen((preVal) => !preVal)} + open={disconnectRepoDialogOpen} + confirmButtonTitle="Yes, confirm disconnect" + handleConfirm={() => { + setDisconnectRepoDialogOpen((preVal) => !preVal); + }} + color="red" + > + + Any data tied to your Git project may become misconfigured. Are you + sure you want to continue? + + ); }; diff --git a/packages/frontend/src/pages/projects/id/domain/add/Config.tsx b/packages/frontend/src/pages/projects/id/domain/add/Config.tsx index b914b957..6d3be8a3 100644 --- a/packages/frontend/src/pages/projects/id/domain/add/Config.tsx +++ b/packages/frontend/src/pages/projects/id/domain/add/Config.tsx @@ -10,7 +10,10 @@ const Config = () => {
Configure DNS - Add the following records to your domain + Add the following records to your domain.  + + Go to NameCheap ^ +