Browse Source

Remove delete button and action from gitlab integration list

jnfrati 4 years ago
parent
commit
d7c62060ea
1 changed files with 0 additions and 44 deletions
  1. 0 44
      dashboard/src/main/home/integrations/GitlabIntegrationList.tsx

+ 0 - 44
dashboard/src/main/home/integrations/GitlabIntegrationList.tsx

@@ -11,46 +11,11 @@ interface Props {
 }
 
 const GitlabIntegrationList: React.FC<Props> = (props) => {
-  const [isDelete, setIsDelete] = useState(false);
-  const [deleteIndex, setDeleteIndex] = useState(-1); // guaranteed to be set when used
-  const { currentProject, setCurrentError } = useContext(Context);
-  const deleted = useRef(new Set());
-
-  const handleDelete = () => {
-    alert("NOT IMPLEMENTED");
-    // api
-    //   .deleteSlackIntegration(
-    //     "<token>",
-    //     {},
-    //     {
-    //       project_id: currentProject.id,
-    //       slack_integration_id: props.gitlabData[deleteIndex].id,
-    //     }
-    //   )
-    //   .then(() => {
-    //     deleted.current.add(deleteIndex);
-    //     setIsDelete(false);
-    //   })
-    //   .catch((err) => {
-    //     setCurrentError(err);
-    //   });
-  };
-
   return (
     <>
-      <ConfirmOverlay
-        show={isDelete}
-        message={
-          deleteIndex != -1 &&
-          `Are you sure you want to delete the gitlab instance ${props.gitlabData[deleteIndex].instance_url}?`
-        }
-        onYes={handleDelete}
-        onNo={() => setIsDelete(false)}
-      />
       <StyledIntegrationList>
         {props.gitlabData?.length > 0 ? (
           props.gitlabData.map((inst, idx) => {
-            if (deleted.current.has(idx)) return null;
             return (
               <Integration
                 onClick={() => {}}
@@ -63,15 +28,6 @@ const GitlabIntegrationList: React.FC<Props> = (props) => {
                     <Label>{inst.instance_url}</Label>
                   </Flex>
                   <MaterialIconTray disabled={false}>
-                    <i
-                      className="material-icons"
-                      onClick={() => {
-                        setDeleteIndex(idx);
-                        setIsDelete(true);
-                      }}
-                    >
-                      delete
-                    </i>
                     <i
                       className="material-icons"
                       onClick={() => {