e2corporation commented on code in PR #3017:
URL: https://github.com/apache/incubator-devlake/pull/3017#discussion_r966587232


##########
config-ui/src/pages/connections/webhook/index.jsx:
##########
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import React, { useState } from "react";
+import { Link } from "react-router-dom";
+import { Icon, Button } from "@blueprintjs/core";
+
+import Nav from "@/components/Nav";
+import Sidebar from "@/components/Sidebar";
+import Content from "@/components/Content";
+import AppCrumbs from "@/components/Breadcrumbs";
+import { ReactComponent as WebHookProvider } from 
"@/images/integrations/webhook.svg";
+import { ReactComponent as Edit } from "@/images/icons/setting-con.svg";
+import { ReactComponent as Delete } from "@/images/icons/delete.svg";
+
+import { FormModal } from "./form-modal";
+import * as S from "./styled";
+
+export const WebHook = () => {
+  const [visible, setVisible] = useState(false);
+  // defined the form modal is add | edit | delete
+  const [modalType, setModalType] = useState("add");
+  // defined the edit or delete record
+  const [record, setRecord] = useState();
+
+  const handleShowModal = (mt, r) => {
+    setVisible(true);
+    setModalType(mt);
+    if (r) {
+      setRecord(r);
+    }
+  };
+
+  const handleHideModal = () => {
+    setVisible(false);
+    setModalType("add");
+    setRecord();
+  };
+
+  const handleAddWebhook = (name) => {
+    console.log(name);
+    handleHideModal();
+  };
+
+  const handleEditWebhook = (id, name) => {
+    console.log(id, name);
+    handleHideModal();
+  };
+
+  const handleDeleteWebhook = (id) => {
+    console.log(id);
+    handleHideModal();
+  };
+
+  return (
+    <div className="container">
+      <Nav />
+      <Sidebar />
+      <Content>
+        <div className="main">
+          <AppCrumbs
+            items={[
+              { href: "/", icon: false, text: "Dashboard" },
+              // use /connections replace here
+              { href: "/integrations", icon: false, text: "Integrations" },
+              {
+                href: `/connections/webhook`,
+                icon: false,
+                text: "WebHook",
+                current: true,
+              },
+            ]}
+          />
+          <div className="headlineContainer">
+            <div
+              style={{
+                display: "flex",
+                alignItems: "center",
+                justifyContent: "space-between",
+                marginBottom: 12,
+              }}
+            >
+              <div style={{ display: "flex", alignItems: "center" }}>
+                <WebHookProvider
+                  className="providerIconSvg"
+                  width="30"
+                  height="30"
+                />
+                <h1 style={{ margin: "0 0 0 8px" }}>WebHook</h1>
+              </div>
+              <Link style={{ color: "#777777" }} to="/integrations">
+                <Icon icon="undo" size={16} /> Go Back
+              </Link>
+            </div>
+            <div className="page-description">
+              Use Webhooks to define Incidents and Deployments for your CI 
tools
+              if they are not listed in Data Sources.
+            </div>
+          </div>
+          <div className="manageProvider">
+            <S.Container>
+              <span>
+                <Button
+                  intent="primary"
+                  text="Add Webhook"
+                  onClick={() => handleShowModal("add")}
+                />
+              </span>
+              <S.Wrapper>
+                <S.Grid className="title">
+                  <li>ID</li>
+                  <li>Webhook Name</li>
+                  <li></li>
+                </S.Grid>
+                <S.Grid>
+                  <li>1</li>
+                  <li>CI-webhook-1</li>
+                  <li>
+                    <Edit

Review Comment:
   Instead of using these SVG's directly as actionable triggers, the SVG should 
be used as an **Icon** for a minimal style **Button** component. The Icons are 
also a bit large in their current form (see previous comments about making SVGs 
responsive). After making the SVG icons responsive, these need to be changed to 
use **Button** component Instead. You can look at the Data Grid on other areas 
such as the Data Integrations table to see similar examples for action icons.
   
   
   
   `Before`
   <img width="920" alt="Screen Shot 2022-09-08 at 11 02 42 PM" 
src="https://user-images.githubusercontent.com/1742233/189265021-71b9aa4b-d7dd-47fd-886c-d2598a9f5201.png";>
   
   `After` using **Button** + Custom SVG Icon
   <img width="926" alt="Screen Shot 2022-09-08 at 11 15 32 PM" 
src="https://user-images.githubusercontent.com/1742233/189265055-8310d759-7257-4964-b295-b0e40cc1e4da.png";>
   
   ```
   <Button intent={Intent.PRIMARY} icon={<EditIcon width={16} height={16} />} 
onClick={() => {}} minimal small />
   <Button intent={Intent.PRIMARY} icon={<DeleteIcon width={16} height={16} />} 
onClick={() => {}} minimal small />
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to